loading…
Search for a command to run...
loading…
Enables efficient code navigation and retrieval through natural language search, BM25 ranking, and fuzzy matching across multiple programming languages. It dras
Enables efficient code navigation and retrieval through natural language search, BM25 ranking, and fuzzy matching across multiple programming languages. It drastically reduces token usage by allowing Claude to query specific code symbols and logic instead of reading entire files.
The smartest code search for Claude. Reduces token usage by 70-90% with BM25 ranking, fuzzy matching, and natural language queries.
An MCP (Model Context Protocol) server that gives Claude superhuman code navigation. Instead of reading entire files (thousands of tokens), Claude queries for exactly what it needs (tens of tokens).
The difference:
- Claude reads 3 files → 5,400 tokens → 5 seconds
+ Claude queries "auth middleware" → 230 tokens → 85ms
95% token savings + 10x faster = drastically lower API costs.
npm install -g claude-mcp-context
Automatic Setup (Claude Code CLI):
The package automatically detects and configures Claude Code. After installation, run:
mcp-context-setup
This will:
Manual Configuration (Claude Desktop or troubleshooting):
If automatic setup doesn't work or you're using Claude Desktop, add to your config file:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"context-manager": {
"command": "claude-mcp-context"
}
}
}
Claude Code (~/.claude/mcp.json):
{
"mcpServers": {
"context-manager": {
"command": "claude-mcp-context"
}
}
}
Verify Installation:
claude mcp list # Should show "context-manager"
Restart Claude and try:
"Index this repository"
"Find the authentication middleware"
"Show me all payment-related functions"
"What does the UserService class do?"
That's it! Claude will now use intelligent search instead of reading entire files.
You: "Index this repository"
MCP Context Manager parses all code and builds a searchable index (~1 second per 1000 files).
You: "Find authentication middleware"
Returns:
📍 authMiddleware (function) - Score: 892.3
src/middleware/auth.ts:15
📍 AuthService (class) - Score: 654.2
src/services/AuthService.ts:8
Instead of 5,400 tokens to read 3 files, you get exactly what you need in 230 tokens.
"payment validation" → finds validatePayment(), PaymentValidator, checkPayment()
"user auth service" → finds UserAuthService, authenticateUser(), etc.
"athenticate" → suggests authenticate
"usrService" → suggests userService
"auth" → searches: auth, authenticate, authentication, authorization
"db" → searches: db, database, data
"config" → searches: config, configuration, configure, settings
Searches inside function implementations, not just names:
"jwt token" → finds code that uses JWT, even if function isn't named jwt*
| Tool | What It Does |
|---|---|
get_relevant_context |
Natural language search with BM25 ranking |
find_symbol |
Locate specific function/class with fuzzy suggestions |
get_function |
Get complete function code |
get_class |
Get class definition (optionally filter methods) |
search_code |
Regex pattern search with relevance ranking |
find_similar |
Discover structurally similar code |
get_file_summary |
File overview without full content |
get_repository_structure |
Directory tree view |
get_dependencies |
Trace imports and dependencies |
index_repository |
Build/refresh code index |
Claude automatically chooses the best tool based on your query.
You: "Find all authentication-related code"
Claude uses: get_relevant_context("authentication")
Returns:
- authMiddleware() in middleware/auth.ts
- authenticate() in auth/handler.ts
- AuthService class in services/auth.ts
- validateToken() in utils/jwt.ts
Tokens: 340 (vs 4,200 reading all files) = 92% savings
You: "Show me the payment processing flow"
Claude uses: get_relevant_context("payment processing")
Returns:
- processPayment() function
- PaymentService class
- Related validation and error handling
Then: find_similar("processPayment")
Returns:
- processRefund() (87% similar)
- handlePayment() (72% similar)
Total tokens: 450 (vs 6,000+) = 93% savings
You: "What are the main modules?"
Claude uses: get_repository_structure()
You: "Summarize the auth module"
Claude uses: get_file_summary("src/auth/handler.ts")
Returns structure without reading 200+ lines of code.
Tokens: 180 (vs 2,800) = 94% savings
| Metric | Performance |
|---|---|
| Search Speed | <100ms average |
| Indexing Speed | ~1s per 1000 files |
| Accuracy | 95%+ on typical queries |
| Token Savings | 70-90% average |
| Memory Usage | 1-5MB index |
Real Example: 3,500 file TypeScript monorepo
The server automatically:
.gitignore patternsnode_modules, dist, buildNo configuration needed!
MCP server not showing up?
mcp-context-setup to re-registerclaude mcp listNo symbols found after indexing?
.gitignoreclear_cache then re-indexSlow indexing?
git clone https://github.com/transparentlyok/mcp-context-manager
cd mcp-context-manager
npm install
npm run build
# Development mode
npm run dev
# Watch mode
npm run watch
Contributions welcome! Ideas:
See issues for planned features.
Search Engine:
Parsing:
Caching:
.mcp-cache/MIT License - see LICENSE file.
Built with ❤️ for the AI development community
⭐ Star on GitHub if this saves you tokens!
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-context-manager": {
"command": "npx",
"args": []
}
}
}