Documentation
¶
Overview ¶
Package mcp implements a Model Context Protocol server over stdio.
This is a thin adapter over github.com/BackendStack21/go-mcp, which provides the core MCP protocol implementation. This package converts odek's tool interface to go-mcp's Tool type and manages transport.
Architecture:
MCP Client (Claude Code) odek mcp (this package → go-mcp)
┌─────────────────────┐ ┌─────────────────────────────────┐
│ tools/list ─────────────► │ go-mcp dispatches to handlers │
│ │ │ │
│ tools/call ─────────────► │ go-mcp calls Tool.Handler │
│ │ │ │
│ ◄────── result ────│ │ │
└─────────────────────┘ └─────────────────────────────────┘
stdin/stdout stdin/stdout
Security: uses the same DangerousConfig + Approver system as CLI mode. In MCP mode there's no TTY — the NonInteractiveAction fallback applies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NativeTool ¶
type NativeTool struct {
Name string
Description string
Schema any
CallFn func(args string) (string, error)
}
NativeTool wraps a odek Tool interface for MCP exposure.
func BuildNativeTools ¶
func BuildNativeTools(callers []ToolCaller) []NativeTool
BuildNativeTools wraps a slice of odek.Tool-compatible values as MCP NativeTool entries for the server. Skips tools that don't make sense in MCP context (delegate_tasks, memory).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements the MCP protocol over stdio transport. It reads JSON-RPC requests from stdin and writes responses to stdout. Internally delegates to gomcp.Server.