Documentation
¶
Overview ¶
Package mcp implements a minimal MCP client (JSON-RPC 2.0 over stdio, newline-delimited) so external MCP servers' tools mount directly into Factor's tool registry as <server>__<tool>.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is one connected MCP server process.
func Connect ¶
func Connect(ctx context.Context, name, command string, args []string, env map[string]string) (*Client, error)
Connect spawns the server, performs the initialize handshake, and returns a ready client.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager owns MCP server connections and mounts their tools into the registry as <server>__<tool>. It also persists server definitions to the config file so the agent can extend itself durably.
func (*Manager) Connect ¶
Connect spawns one server and mounts its tools. A reservation held for the whole connect prevents two concurrent adds of the same name from spawning a duplicate, orphaned server process.
func (*Manager) Disconnect ¶
Disconnect closes a server and unmounts its tools.