Documentation
¶
Overview ¶
Package mcp integrates Model Context Protocol tools (FR-10). It speaks JSON-RPC 2.0 over a newline-delimited stdio transport to external MCP servers and also supports in-process servers (Go functions). Every MCP tool is adapted to a tool.CoreTool named mcp__<server>__<tool> (FR-10.2/10.3).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InProcessServer ¶
func InProcessServer(server string, tools []InProcessTool) []tool.CoreTool
InProcessServer adapts a set of in-process tools to CoreTools (FR-10.3).
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a connection to one MCP server.
func NewStdioClient ¶
func NewStdioClient(ctx context.Context, server, command string, env map[string]string, args ...string) (*Client, error)
NewStdioClient spawns an MCP server as a subprocess, performs the handshake, and returns a connected Client (FR-10.1). Call Close to terminate it.
env holds extra environment variables (e.g. API tokens an MCP server needs) applied on top of the parent process environment; pass nil for none.