mcp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package mcp — bench.go exposes the registered tool handlers for in-process latency measurement. Production stdio serving still goes through Run; this entrypoint exists so cmd/ckg/bench-mcp can invoke each handler directly (no subprocess spawn, no JSON-RPC framing) and surface the graph layer's contribution to MCP tool latency separately from the stdio transport's.

The §11.3 retrieval boundary is preserved: mcphandlers.RegisterAll wraps the store before threading. AMBIGUOUS Hunk/Commit nodes never reach the bench callers.

Package mcp wires CKG's read-only SQLite store to the Model Context Protocol via stdio. The eight tool handlers themselves live in pkg/mcphandlers — this package now only carries the stdio entry point (Run) and the bench-mode handler exposure used by cmd/ckg/bench-mcp.

Index

Constants

This section is empty.

Variables

View Source
var BenchToolNames = []string{
	"find_symbol",
	"find_callers",
	"find_callees",
	"get_subgraph",
	"search_text",
	"get_context_for_task",
	"impact_of_change",
	"evidence_for_intent",
}

BenchToolNames is the canonical ordering of the eight tools, used by cmd/ckg/bench-mcp so probe output stays stable across runs.

Functions

func NewBenchHandlers

func NewBenchHandlers(store persist.StoreReader) (*server.MCPServer, map[string]server.ToolHandlerFunc)

NewBenchHandlers builds a fresh MCPServer with all eight tools registered through the safe wrapper, then returns the handler map keyed by tool name. The MCPServer is returned alongside so the caller can cleanly tear down (the current mcp-go API doesn't need explicit close, but holding the reference avoids GC pressure on long-running benches).

func Run

func Run(ctx context.Context, store persist.StoreReader) error

Run starts a stdio MCP server bound to store. Returns when stdin closes. mcphandlers.RegisterAll wraps store with the §11.3 H3 safety filter and registers every tool — no per-tool wiring here any more (the eight register* calls moved to pkg/mcphandlers).

Types

This section is empty.

Jump to

Keyboard shortcuts

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