Documentation
¶
Overview ¶
Package mcp hosts the Seamless MCP tool surface over streamable HTTP with a single static bearer key. It adds what v1 lacked: a per-connection session binding, so an agent calls session_start once and later memory/recall/notes calls inherit the session's project scope without repeating it. Every stored identity is a ULID; names and slugs are only ergonomic handles.
Index ¶
Constants ¶
const ( // ServerName is the server name advertised in the MCP initialize handshake. // Exported for docsgen, which mirrors the handshake identity into the // published server card's serverInfo (docs/.well-known/mcp/server-card.json). ServerName = "Seamless" // ToolCount is the number of MCP tools registered. doctor asserts the actual // registered count (Server.NumTools) equals it. P2 minimal loop = 15; P3 adds // tasks (4) + trials (3) = 22; P4 adds gardener (2) + capture_url + // usage_summary = 26; plans-as-composition adds tasks_claim + tasks_release = 28; // gardener_request = 29; gardener_split = 30; favorite_set = 31; // memory_edit + notes_edit = 33. ToolCount = 33 )
Variables ¶
This section is empty.
Functions ¶
func Catalog ¶
Catalog returns every registered tool's definition, in registration order.
It exists so documentation tooling (cmd/docsgen) can render the tool surface without constructing a Server: the constructors are plain data -- name, description, and input schema -- and need no DB, config, or listening port. The definitions here are the same values registerTools hands to addTool, so the docs describe exactly what the server serves.
The order below MUST mirror registerTools. catalog_test enforces both halves of that contract (length against ToolCount, names against a live server's registration order), so a tool added to one and not the other fails the build rather than silently vanishing from the docs.
Types ¶
type Config ¶
type Config struct {
DB *sql.DB
Files *files.Manager
Retrieve *retrieve.Service
Events *events.Recorder
Gardener *gardener.Service // may be nil (gardener_apply is then unavailable)
Embedder llm.Embedder // may be nil (memory_write dedup hint is then skipped)
APIKey string
Version string // build version advertised in the MCP handshake; defaults to serverVersion
// ToolEventMaxChars caps each captured field (tool.call args value/result,
// session findings) of a logged Interactions event at this many runes. 0 =
// unlimited (the default): content is logged in full.
ToolEventMaxChars int
// CaptureAllowedPorts are the destination ports capture_url may dial
// (config.Capture.AllowedPorts). Empty means the capture package's 80/443
// default, never "any port".
CaptureAllowedPorts []int
// Features is the file/env optional-features config (config.Config.Features).
// It is only the BASE: the stored override row layers over it per request in
// effectiveFeatures, so a console toggle needs no restart. The zero value is
// every optional feature off, which is also config.Defaults().
Features config.Features
Logger *slog.Logger
}
Config wires the MCP server's dependencies.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server hosts the MCP tools and their per-connection session bindings.
func (*Server) Handler ¶
Handler returns the streamable-HTTP handler for /api/mcp. Authentication is enforced outside mcp-go so every protocol method -- initialize, discovery, SSE, termination, and tool calls -- is rejected before the dependency reads a body or creates a session. Authorized POST bodies are capped before mcp-go buffers them. The tool middleware remains as defense in depth for any future non-HTTP transport or direct in-process dispatch.
Source Files
¶
- annotations.go
- argspec.go
- catalog.go
- edits.go
- features.go
- isolation.go
- middleware.go
- mishaps.go
- momentum.go
- precondition.go
- result.go
- server.go
- tools_capture.go
- tools_favorites.go
- tools_gardener.go
- tools_memory.go
- tools_memory_edit.go
- tools_notes.go
- tools_notes_edit.go
- tools_projects.go
- tools_recall.go
- tools_sessions.go
- tools_tasks.go
- tools_trials.go
- tools_usage.go