fastcontext-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@fastcontext-mcpfind all places that call the payment API"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
fastcontext-mcp
An MCP server that wraps FastContext-1.0 as a repo-exploration subagent for Claude Code.
Instead of letting Sonnet spend half its context budget grepping around a codebase, you offload that work to a dedicated 4B model trained specifically to explore repos. FastContext issues parallel READ/GLOB/GREP calls, then returns compact file paths + line ranges as grounded citations. Claude Code gets clean context; FastContext does the legwork.
Claude Code (Sonnet) ──explore_repo──▶ fastcontext-mcp ──READ/GLOB/GREP──▶ your repo
▲ │
└──── file:line citations ──────────────┘Based on Microsoft's FastContext paper: integrating FastContext improves coding agent accuracy by up to 5.5% while reducing main-agent token consumption by up to 60%.
Requirements
Python 3.10+
A running FastContext inference server (SGLang or vLLM, OpenAI-compatible)
Claude Code
Related MCP server: CollabMCP
Setup
1. Serve FastContext locally
You need a GPU with ~6GB VRAM for the 4B model. The 4B-RL variant slightly outperforms 4B-SFT on most benchmarks and is recommended for deployment.
pip install sglang[all]
# SFT variant (default)
./scripts/serve.sh microsoft/FastContext-1.0-4B-SFT
# RL variant (recommended)
./scripts/serve.sh microsoft/FastContext-1.0-4B-RLOr with vLLM:
pip install vllm
vllm serve microsoft/FastContext-1.0-4B-SFT --tool-call-parser hermesThe server will be available at http://localhost:30000.
2. Install this MCP server
git clone https://github.com/YOUR_USERNAME/fastcontext-mcp
cd fastcontext-mcp
pip install -e .3. Register with Claude Code
Add to your ~/.claude/claude_desktop_config.json (or project-level .mcp.json):
{
"mcpServers": {
"fastcontext": {
"command": "fastcontext-mcp",
"env": {
"FASTCONTEXT_BASE_URL": "http://localhost:30000/v1",
"FASTCONTEXT_MODEL": "FastContext-1.0-4B-SFT"
}
}
}
}Restart Claude Code. You should see explore_repo in the available tools.
Usage
Once registered, Claude Code can call explore_repo automatically, or you can invoke it explicitly:
explore_repo("where is the rate limiting middleware defined")
explore_repo("find all places that call the payment API", repo_root="/path/to/repo")FastContext will issue several parallel read/search calls internally and return something like:
<final_answer>
- src/middleware/ratelimit.py: lines 12-47
- src/middleware/__init__.py: line 8
- tests/test_ratelimit.py: lines 1-30
</final_answer>Claude Code then uses those citations as focused context rather than reading the whole codebase.
Configuration
Env var | Default | Description |
|
| SGLang/vLLM server URL |
|
| Model name as registered in the server |
|
| Max exploration turns before giving up |
|
| Max lines returned per READ call |
No GPU? Remote inference
If you don't have a local GPU, you can serve FastContext on a remote machine and point FASTCONTEXT_BASE_URL at it. The MCP server itself is CPU-only and just proxies requests.
Why not just use Claude Code directly?
You can. But FastContext is trained specifically for the locate-relevant-code task, and it's 4B parameters — it's faster and cheaper per exploration call than routing everything through Sonnet. On large codebases the token savings are significant (the paper reports up to 60% reduction in main-agent tokens).
License
MIT. FastContext model weights are also MIT licensed by Microsoft.
This server cannot be deployed
Maintenance
Related MCP Connectors
Research-backed lint + generation for agent context files (CLAUDE.md, AGENTS.md) + prompt enhancer.
Project memory, semantic code search, and grounded agent context.
Securely search and manage workspace context files for AI agents and teams.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to fetch and pack the most relevant files from any GitHub repository for a given query, within token limits. Works with Claude Desktop, Cursor, Windsurf, and VS Code Copilot.MIT
- AlicenseAqualityDmaintenanceProvides shared real-time context for Claude Code agents, including scope awareness, prior decisions, and anti-overlap, using only files in the repo.5MIT
- AlicenseAqualityDmaintenanceAn MCP server that wraps Microsoft's FastContext as a read-only repository exploration subagent, enabling coding agents to delegate broad code searches and receive compact file:line citations.11MIT
- AlicenseAqualityAmaintenanceProvides coding agents with repository-aware tools to understand code structure, find existing patterns, and review plans, architecture, and diffs, enabling a consistent engineering workflow across Cursor, Codex, and Claude Code.7MIT