Documentation
¶
Overview ¶
Package mcpserver exposes ctx's retrieval and note-taking tools over MCP, so an agent can pull its own (or another agent's) past context mid-session instead of re-deriving it. Every tool response is a summary or a capped page — progressive disclosure — never a full unbounded transcript dump, so a single tool call can't swallow an agent's whole context window.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New builds the ctx MCP server and registers every tool. cwd is the directory the `ctx mcp` process was launched from. embedClient backs search_context's semantic half — callers construct it explicitly (rather than New picking a default internally) so tests can inject a fake instead of depending on whatever Ollama happens to be reachable at embed.DefaultBaseURL on the machine running them.
Types ¶
type Options ¶ added in v0.2.0
type Options struct {
// Roots are the agents' log directories. When set, the server catches
// up on them in the background at startup, reports index freshness in
// search_context and recent_sessions, and catches up again whenever a
// search finds unread logs.
Roots []ingest.Root
// LockPath is the file that keeps concurrent ctx processes from
// catching up at the same time; see ingest.CatchUp. Required with Roots.
LockPath string
}
Options configures the parts of the server that reach outside the database. The zero value is a server that only ever reads what is already indexed, which is what tests want.