DeepContext
Adds symbol-aware semantic search to coding agents like Codex CLI and Claude Code, enabling precise codebase context via natural language queries.
README
<p align="center"> <img alt="DeepContext Logo" src="https://github.com/user-attachments/assets/6dd1b4a4-5ce3-41cb-acc0-b3eed32d5f8e" width="500" height="296"> </p>
<h1 align="center">Smarter Context for Large Codebases</h1>
<p align="center"> <a href="https://github.com/Wildcard-Official/deepcontext-mcp/stargazers"> <img src="https://img.shields.io/github/stars/Wildcard-Official/deepcontext-mcp?style=social" alt="GitHub stars"> </a> <a href="https://www.npmjs.com/package/@wildcard-ai/deepcontext"> <img src="https://img.shields.io/npm/v/@wildcard-ai/deepcontext" alt="NPM Version"> </a> <a href="https://join.slack.com/t/wildcard-community/shared_invite/zt-3dslre0yd-H8M_Ftsf8AJoB6nP~wVIpg"> <img src="https://img.shields.io/badge/Slack-join-blueviolet?logo=slack" alt="Slack Community"> </a> <a href="https://x.com/wildcard_ai"> <img src="https://img.shields.io/twitter/follow/wildcard_ai?style=social" alt="Twitter Follow"> </a> </p>
DeepContext is an MCP server that adds symbol-aware semantic search to Codex CLI, Claude Code, and other agents, giving them more precise context of even the largest codebases. Currently supports Typescript and Python.
Quickstart
- Visit the Wildcard DeepContext page
- Click "Generate API Key"
- Copy your API key
- Paste installation command for your MCP client
- Type
index this codebaseto index the current directory
Claude Code:
claude mcp add deepcontext \
-e WILDCARD_API_KEY=your-wildcard-api-key \
-- npx @wildcard-ai/deepcontext@latest
Codex:
# Add to ~/.codex/config.toml
[mcp_servers.deepcontext]
command = "npx"
args = ["-y", "@wildcard-ai/deepcontext@latest"]
env = { "WILDCARD_API_KEY" = "your-wildcard-api-key" }
Demo
https://github.com/user-attachments/assets/9a2d418f-497b-42b9-bbb2-f875ef0007b4
Why DeepContext MCP?
Most coding agents use grep based search that match exact text, these searches miss semantically related code and fill context windows with irrelevant results. Large codebases amplify this problem, where text search returns hundreds of matches that quickly overwhelm conversation capacity. This leads to slow completions, more hallucinations, and lower success rates.
DeepContext provides agents with intelligent search that preserves context windows by finding only relevant code chunks.
-
Semantic accuracy: Matches code by meaning and relationships rather than text patterns, finding related functions across files that keyword search misses.
-
Reduced token usage: Returns precise code chunks instead of every file containing your search terms, preserving conversation context windows and reducing costs.
-
Search speed: Searches code immediately through pre-indexed data for instant file discovery.
MCP Tools
index_codebase
Creates a searchable index of your codebase for semantic search.
search_codebase
Finds relevant code using natural language or keyword queries.
get_indexing_status
Shows indexing status and file counts for your codebases.
clear_index
Removes all indexed data for a codebase.
Architecture
MCP Integration Flow
- Coding Agent communicates with DeepContext through the Model Context Protocol
- MCP server receives requests, validates parameters, and routes to appropriate core components
- For long-running operations like indexing, spawns detached background processes to prevent timeouts
- Background workers handle large codebases without blocking MCP channel // Reword
AST-Based Parsing
- Tree-sitter parsers analyze source code to build Abstract Syntax Trees
- Python, TypeScript, and JavaScript language grammars for accurate parsing
- Semantic node identification for functions, classes, interfaces, and modules
- Symbol extraction identifies functions, classes, interfaces, types, variables, and constants
- Scope analysis determines local vs exported vs global visibility
- Parameter and return type extraction for function signatures
- Import/export analysis maps module dependencies and cross-file relationships
- Creates chunks at semantic boundaries rather than arbitrary line or token splits
- Large file handling through range-based parsing with overlapping windows
Hybrid Search with Reranking
- Search operates in three stages
- Hybrid search combines vector similarity and BM25 full-text search
- Jina reranker-v2 for final relevance optimization
- Vector similarity finds semantically related code using embeddings
- Jina text embeddings generate 1024-dimension vectors for code chunks
- BM25 performs traditional keyword matching for exact terms
- Full-text indexing enables precise identifier and comment matching
- Results fused using configurable weights, then reordered by Jina reranker
Incremental Indexing
- Uses file modification times and content hashes to track changes
- SHA-256 hashing detects content modifications at byte level
- Only reprocesses files with different hashes during reindexing
- Avoids unnecessary parsing and embedding generation for unchanged files
Content Filtering
- Scores files based on extension patterns, path components, and content analysis
- Language detection and file type classification for processing decisions
- Excludes test files, generated code, minified files, and build outputs during indexing
- Pattern matching against common test frameworks and build tool outputs
- Filters documentation and configuration files to focus on source code
Self Hosting
Self-hosting requires code modifications to integrate directly with vector storage and embedding providers, as the current implementation uses the Wildcard API backend.
Prerequisites
- Node.js 20+ for ES module support and performance optimizations
- Turbopuffer API key for vector storage and hybrid search operations
- Jina AI API key for text embeddings and reranking services
Setup
git clone https://github.com/Wildcard-Official/deepcontext-mcp.git
cd deepcontext
npm install
npm run build
Integration
claude mcp add deepcontext-local \
-e TURBOPUFFER_API_KEY=your-turbopuffer-key \
-e JINA_API_KEY=your-jina-key \
-- node /path/to/deepcontext/dist/standalone-mcp-integration.js
Contributing
Thanks for your interest! We’re currently not accepting external contributions as we’re an early-stage startup focused on rapid iteration. We may open things up in the future — feel free to ⭐ the repo to stay in the loop.
License
Licensed under the Apache License.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。