Documentation
¶
Overview ¶
Package server wires the mcpsmithy tool engine to the MCP SDK.
The MCP framing (initialize, tools/list, tools/call, list-changed notifications) and transports (stdio, Streamable HTTP) live in github.com/modelcontextprotocol/go-sdk/mcp. This package owns the bridge: turn each Engine tool into an mcp.Tool, decode arguments, and pipe results back as CallToolResult.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine interface {
Tools() map[string]config.Tool
Execute(ctx context.Context, name string, params map[string]any) (string, error)
}
Engine is the interface that tool engines must implement to be served by the MCP server. Both tools.Engine (config-driven) and setup.Engine (config-authoring) satisfy this interface.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server adapts an Engine to mcp.Server. It supports two transports: stdio (default) and Streamable HTTP, selected via Option.
func (*Server) Serve ¶
Serve starts the configured transport and blocks until ctx is cancelled or the underlying connection closes.
func (*Server) SwapEngine ¶
SwapEngine atomically replaces the running engine. Adding/removing tools triggers tools/list_changed notifications via the SDK.