Codex MCP Server
A Model Context Protocol server for local repository indexing and code understanding, enabling semantic search, AST analysis, dependency tracking, and symbol resolution.
README
Codex MCP Server
A Model Context Protocol (MCP) server for local repository indexing and code understanding.
Features
- š Semantic Code Search: Vector-based search across your entire codebase
- šļø AST Analysis: Deep code structure understanding using Tree-sitter
- š Real-time Indexing: File system monitoring for incremental updates
- š Dependency Tracking: Import/export relationship mapping
- šÆ Symbol Resolution: Find definitions, references, and usages
- š VS Code Integration: Seamless integration with coding agents
Architecture
āāāā MCP Server āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā āāā Tools (search_code, find_symbol, etc.) ā
ā āāā Database Layer (SQLite + Vector Storage) ā
ā āāā Indexing Engine (AST + Embeddings) ā
ā āāā File System Monitor (Real-time updates) ā
ā āāā Language Parsers (TypeScript, Python, etc.) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š Design Documents: Before making architectural changes, please review the design documentation in the design/ folder:
- System Architecture - Complete system design and component interactions
- API Contracts - MCP tool specifications and database schema
Installation
npm install
npm run build
Development
npm run dev
Usage
Configure in your MCP client (e.g., VS Code):
{
"mcpServers": {
"codex": {
"command": "node",
"args": ["path/to/codex-mcp-server/dist/index.js"],
"env": {
"REPO_PATH": "/path/to/your/repository"
}
}
}
}
Available Tools
search_code- Semantic search across the codebasefind_symbol- Find function/class definitionsget_references- Find all symbol usagesanalyze_dependencies- Show import/dependency graphsget_context- Get relevant context for code understandingindex_repository- Manually trigger repository indexing
Configuration
Set environment variables:
REPO_PATH- Path to the repository to indexOPENAI_API_KEY- For embedding generation (optional, can use local embeddings)DB_PATH- Database storage path (default: ./data)
š¤ GitHub Copilot Integration
This project is designed to work seamlessly with GitHub Copilot coding agents. For detailed implementation instructions using GitHub Copilot, see GITHUB_COPILOT_GUIDE.md.
Quick Start with GitHub Copilot
- Use the hashtag trigger: Add
#github-pull-request_copilot-coding-agentto your requests - Provide clear context: "Implement the DatabaseManager class with SQLite integration for code indexing"
- Reference the architecture: Point to the existing interfaces and types for consistent implementation
- Test incrementally: Build and test each component as you implement it
Example Copilot Prompts
Implement the LanguageParser class that can parse JavaScript and TypeScript files
to extract function definitions, class declarations, and import statements.
#github-pull-request_copilot-coding-agent
Create comprehensive unit tests for the SearchEngine class, focusing on semantic
search functionality and vector similarity calculations.
#github-pull-request_copilot-coding-agent
For complete implementation guidance, phase-by-phase instructions, and best practices for using GitHub Copilot with this codebase, see the GitHub Copilot Guide.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.