Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps an MCP stdio client for communicating with MCP servers like ogden.
func NewClient ¶
func NewClient(ctx context.Context, cfg ServerConfig) (*Client, error)
NewClient spawns an MCP server as a child process and initializes the connection.
func (*Client) CallTool ¶
func (c *Client) CallTool(ctx context.Context, name string, arguments map[string]any) (string, time.Duration, error)
CallTool invokes a tool on the MCP server. Uses the provided context for timeout control — callers should set appropriate deadlines. Returns the text content of the response, duration of the call, or empty string on error.
type ServerConfig ¶
type ServerConfig struct {
Command string // e.g., "ogden"
Args []string // e.g., ["mcp"]
Env []string // additional env vars
}
ServerConfig defines how to connect to an MCP server.
func ConfigFromEnv ¶
func ConfigFromEnv() ServerConfig
ConfigFromEnv builds ServerConfig from OGCODE_MCP_* environment variables.
Click to show internal directories.
Click to hide internal directories.