token-context-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TOKEN_CONTEXT_CONFIG | No | Optional path to an explicit shared/portable TOML configuration file for the repository registry. By default, the registry is stored globally for the current user at %APPDATA%\token-context-mcp\repos.toml. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Use repo_id from list_repositories; never pass a filesystem path. budget_tokens or max_tokens range: 32 through 8192; graph depth: 0 through 3. get_repo_map returns compact [id, path:line, kind/name]; use id for follow-up context/impact calls. Budget profiles: locate, orient, impact, read. Evidence Ledger (default enabled): inspect prior_evidence returned by get_repo_map, find_symbols, or search_source BEFORE running broad searches; follow valid anchors directly via inspect_symbol/get_symbol_context, and re-verify from recheck_from when VERIFY_FAILED is reported. When trajectory_record is available, record verified answers, multi-hop steps, and rejected decoys after completing a query so follow-up turns reuse verified paths. Respect freshness, ambiguity and truncation warnings. Lexical edges are not complete semantic analysis.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_repositoriesA | List registered repo_ids and budget_profiles (empty list if none; roots hidden). Call first before any repo tool; call get_index_status next to verify snapshot freshness. |
| get_repo_mapA | Ranked symbol map within budget (format='compact' tuples, 'grouped' by file, or 'full' objects; omitted_count tracks cuts). query biases graph rank; use find_symbols for exact names. |
| find_symbolsA | Match declaration names by exact or wildcard (*, ?) pattern (exact first; no bodies/edges; truncated=true if capped). Use search_source for code text or inspect_symbol for body+edges. |
| get_module_dependentsA | File/module lexical import graph (imports & imported_by) for one path or module; flags dynamic imports. Fails if unindexed. For symbol call edges, use get_impact_slice instead. |
| search_sourceA | Full-text FTS5 body search returning line snippets (omitted_count on budget cap). For symbol name patterns use find_symbols; for multi-hop call graphs use get_impact_slice. |
| get_file_skeletonA | Extract ordered imports and public/private declaration headers for one indexed file with bodies elided (content=null if stale; omits tail over budget). Use get_symbol_context for bodies. |
| get_symbol_contextA | Fetch bounded body and 0-3 hop edges for a known symbol_id (use body_offset_line to page long bodies; omits body if over max_tokens). If symbol_id is unknown, call inspect_symbol. |
| get_impact_sliceA | Traverse 0-3 hop AST caller/callee edges from a known symbol_id; candidate slice only (truncated=true if capped by max_nodes/max_tokens). For imports use get_module_dependents. |
| get_index_statusA | Check snapshot freshness ('fresh', 'stale', 'pending', 'unknown'), counts, and pending_paths after list_repositories. Run before trusting get_repo_map or graph edges; treat stale spans cautiously. |
| inspect_symbolA | 1-turn lookup by exact/wildcard name when symbol_id is unknown (use find_symbols for bulk lists, get_symbol_context by ID); returns status='not_found', 'ambiguous', or view='full' packet. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 10 tools
Each tool has a documented niche and the descriptions actively redirect the agent (e.g. get_module_dependents says use get_impact_slice for symbol edges, find_symbols says use search_source for code text), which resolves most overlap. The residual ambiguity is between name-based lookups (find_symbols vs inspect_symbol) and between get_symbol_context vs get_impact_slice, where the boundary is 'bulk vs single' and 'body+edges vs edges only' — learnable but easy to misselect on a first pass.
All ten tools follow a strict snake_case verb_noun pattern (list_repositories, get_repo_map, find_symbols, inspect_symbol, search_source). The verb choice is also semantically meaningful — get for retrieval, find for pattern matching, search for full-text, inspect for a one-shot packet — rather than arbitrary variation.
Ten tools is squarely in the well-scoped range for a code-context/indexing server. Each tool covers a distinct retrieval granularity (repo, file, module graph, symbol, source text) and none feels like filler.
The read-only surface is broad: repo discovery, freshness checking, ranked maps, name matching, file skeletons, symbol bodies, call edges, import graphs, and full-text search — a full navigation lifecycle for the stated purpose. Gaps are minor (no cross-repo search, no way to retrieve a whole file body, budget profiles are only listable, not configurable), but agents can work around them by composing tools.