mcp

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2026 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyRunning = errors.New("mcp server already running")
	ErrNotRunning     = errors.New("mcp server not running")
)

Functions

func ServeStdio

func ServeStdio(cfg Config, rpc rpcpb.SliverRPCClient) error

ServeStdio runs the MCP server over stdio using the provided configuration.

func Start

func Start(cfg Config, rpc rpcpb.SliverRPCClient) error

Start launches the MCP server using the provided configuration.

func Stop

func Stop(ctx context.Context) error

Stop shuts down the MCP server.

Types

type Config

type Config struct {
	Transport     Transport
	ListenAddress string
	ServerName    string
	ServerVersion string
}

Config controls the local MCP server settings.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the baseline MCP configuration.

func (Config) EndpointURL

func (c Config) EndpointURL() (string, error)

EndpointURL returns the base URL for clients to connect.

func (Config) Validate

func (c Config) Validate() error

Validate ensures the configuration can be used for a server start.

func (Config) WithDefaults

func (c Config) WithDefaults() Config

WithDefaults fills any empty fields with defaults.

type SliverMCPServer

type SliverMCPServer struct {
	Rpc rpcpb.SliverRPCClient
	// contains filtered or unexported fields
}

SliverMCPServer wraps the MCP server with Sliver RPC access for handlers.

type Status

type Status struct {
	Running   bool
	StartedAt time.Time
	Config    Config
	LastError string
}

Status describes the running state of the MCP server.

func GetStatus

func GetStatus() Status

GetStatus returns the current MCP server state.

type Transport

type Transport string

Transport identifies the MCP server transport to expose.

const (
	TransportHTTP Transport = "http"
	TransportSSE  Transport = "sse"
)

func ParseTransport

func ParseTransport(raw string) (Transport, error)

ParseTransport validates an input transport string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL