server

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const LatestProtocolVersion = "2025-06-18"

LatestProtocolVersion is the MCP revision this server prefers when a client asks for one it does not know.

Variables

This section is empty.

Functions

func Instructions added in v1.9.0

func Instructions() string

Instructions returns the server instructions sent during initialize.

Types

type JSONRPCError

type JSONRPCError struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type JSONRPCRequest

type JSONRPCRequest = middleware.JSONRPCRequest

JSON-RPC 2.0 structures

type JSONRPCResponse

type JSONRPCResponse struct {
	JSONRPC string        `json:"jsonrpc"`
	ID      interface{}   `json:"id,omitempty"`
	Result  interface{}   `json:"result,omitempty"`
	Error   *JSONRPCError `json:"error,omitempty"`
}

type MCPServer

type MCPServer struct {
	// contains filtered or unexported fields
}

MCP Server

func NewMCPServer

func NewMCPServer(config MCPServerConfig, client client.Client) *MCPServer

Create new MCP server

func (*MCPServer) Done added in v1.9.0

func (s *MCPServer) Done() <-chan struct{}

Done is closed once the server stops handling messages, which happens when the client closes the input stream. Callers wait on it so that a disconnected client ends the process instead of leaving it running with nothing to read.

func (*MCPServer) IsRunning

func (s *MCPServer) IsRunning() bool

Check if server is running

func (*MCPServer) Start

func (s *MCPServer) Start() error

Start the MCP server

func (*MCPServer) Stop

func (s *MCPServer) Stop() error

Stop the MCP server

type MCPServerConfig

type MCPServerConfig struct {
	Transport    string `yaml:"transport" mapstructure:"transport"`
	Port         int    `yaml:"port" mapstructure:"port"`
	AuditLogging bool   `yaml:"audit_logging" mapstructure:"audit_logging"`

	// AllowExec lets exec_service run commands inside a customer's containers.
	// Off by default: it is the one tool here that executes arbitrary code in a
	// running environment, so it is the operator's call, not the assistant's.
	AllowExec bool `yaml:"allow_exec" mapstructure:"allow_exec"`
}

MCP Server configuration

func LoadMCPServerConfig

func LoadMCPServerConfig() MCPServerConfig

Load configuration from Viper

Jump to

Keyboard shortcuts

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