Token Context MCP
On-demand, local code-context server giving coding agents AST-level symbol retrieval
- Pricing
- Open source
- Platforms
- CLI, self-hosted
- Runs
- Locally
- Version
- 0.3.6
- Listing updated
- today
Similar MCP servers
About Token Context MCP
Token Context MCP is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.
Token Context MCP takes a pull approach to code context. Instead of packing a repository into one static snapshot, the agent asks for a repo map, a symbol, a call graph slice or a file skeleton, and each answer comes back inside a token budget with file, line and SHA-256 evidence. Output is capped at syntax boundaries so a function is not cut in half.
It indexes Python, JavaScript and TypeScript, Go, Rust, Java, C and C++, and C# with Tree-sitter into a SQLite graph, using modification time plus hashes to detect changes. A middleware pipeline resolves agent identity, applies per-agent policies and rate limits, and enforces the result cap. An optional evidence ledger stores verified query-to-answer citations outside the repository and re-checks them on each read.
The default tool list is deliberately small: ten read-only tools, with extension and admin tools hidden until requested. The README reports its own benchmarks against a static packing tool, which are the author's measurements. It also ships an optional desktop GUI controller.
Install
Run in a terminal
claude mcp add token-context-mcp -- uvx token-context-mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"token-context-mcp": {
"command": "uvx",
"args": [
"token-context-mcp"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"token-context-mcp": {
"command": "uvx",
"args": [
"token-context-mcp"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"token-context-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"token-context-mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"token-context-mcp": {
"command": "uvx",
"args": [
"token-context-mcp"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"token-context-mcp": {
"command": "uvx",
"args": [
"token-context-mcp"
]
}
}
}Using several servers? Build one config file with the MCP config generator.
Tools this server provides (9)
Taken from the project documentation; the running server may differ.
- list_repositories
- Lists registered repo ids without leaking filesystem paths.
- get_index_status
- Returns snapshot metadata, indexed file count, commit SHA and freshness.
- get_repo_map
- PageRank-based symbol hierarchy within a token budget.
- find_symbols
- Pattern-based symbol matching with wildcards and file coordinates.
- search_source
- FTS5 code search returning matched lines and enclosing symbol spans.
- get_file_skeleton
- File outline with imports and signatures with bodies elided.
- get_symbol_context
- Full function or class body, docstrings and callers and callees.
- get_impact_slice
- Traverses downstream call graph dependencies before making changes.
- get_module_dependents
- Tree-sitter import dependency graph between modules.
What it does
- Token-budgeted retrieval
- Each tool returns results within a configurable token cap.
- Tree-sitter indexing
- Parses eight language families into a persistent SQLite symbol graph.
- Impact slices
- Traverses downstream call dependencies before a change is made.
- Evidence ledger
- Stores citation cards with line and hash and re-verifies them against disk.
- Small default tool list
- Exposes ten read-only tools to limit prompt overhead.
- Per-agent governance
- Applies access policies, rate limits and an emergency halt.
Good for
- Give a coding agent exact function bodies instead of a whole-repo dump
- Check what a change might break before editing
- Orient an agent in an unfamiliar codebase with a compact repo map
- Find symbols by wildcard pattern across a project
Pricing
Open source
Token Context MCP FAQ
How do I run it?
Use uvx token-context-mcp quickstart . or pip install token-context-mcp, then register and index a repo.
Which agents are documented?
Claude Code, Cursor, Claude Desktop and Google Antigravity or Gemini CLI.
Does it send code anywhere?
It communicates over local stdio and keeps its index and ledger on your machine.
Which languages are supported?
Python, JavaScript and TypeScript, Go, Rust, Java, C and C++, and C#.
Is Token Context MCP free?
Yes. Token Context MCP is open source, so you can use and self-host it for free.
How do I add Token Context MCP to Claude Code?
Run this command in your terminal: claude mcp add token-context-mcp -- uvx token-context-mcp
What are the best alternatives to Token Context MCP?
The closest alternatives to Token Context MCP are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.


