mcpserver

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func New(db *sql.DB, cwd string, embedClient embed.Embedder) (*mcp.Server, error)

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.

func NewWithOptions added in v0.2.0

func NewWithOptions(db *sql.DB, cwd string, embedClient embed.Embedder, opts Options) (*mcp.Server, error)

NewWithOptions is New plus Options; see Options for what each one enables.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL