Documentation
¶
Overview ¶
Package mcp serves the seamark index over the Model Context Protocol's stdio transport: newline-delimited JSON-RPC 2.0, the same hand-rolled approach the LSP server took (RFC-001 §6.2). Five tools, not forty — tool definitions are paid in tokens on every agent turn.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server answers MCP requests from the index at root. Every tool call self-repairs freshness first (the indexer's fast path makes that free when nothing changed), so answers never come from a stale graph.
func New ¶
New builds a server for the workspace at root; logf receives operational notes (stderr in the CLI — stdout is protocol-only).
func (*Server) Serve ¶
Serve reads newline-delimited JSON-RPC messages until r closes. It never returns on a bad message — a protocol server that dies on one malformed line takes the whole agent session with it. That includes an over-length frame: it is rejected in-band and serving continues, rather than tearing the connection down (bufio.Scanner's fatal ErrTooLong is exactly the failure mode we must not have here).