MCP (Model Context Protocol) server for managing API endpoints and code context for AI coding assistants.
When using AI coding assistants like Claude Code, you often need to reference API endpoints while writing code. This requires:
- Repeatedly searching through codebases
- High token consumption from context switching
- Risk of using outdated API information
- Manual tracking of endpoint specifications
code-context automatically scans and stores your API endpoints in a vector database, enabling:
- ✅ Instant lookup by endpoint name or route
- ✅ Semantic search by describing what the endpoint does
- ✅ Complete specifications (headers, parameters, responses)
- ✅ Always up-to-date with your codebase
- 🔍 Automatic scanning of Python FastAPI/Flask projects
- 💾 Vector storage with Qdrant (embedded mode)
- 🔧 MCP integration with Claude Code/Desktop
- 📝 CRUD operations for endpoint management
- 🚀 Zero-config setup with
pipx install - 🎯 Extensible architecture for more languages
# Step 1: Install code-context
pipx install code-context
# Step 2: Initialize configuration (run once)
code-context init
# Step 3: Install MCP client integration
code-context install-mcpThe install-mcp wizard will guide you through:
- Selecting your AI coding assistant platform
- Automatically configuring the MCP integration
- Testing the connection
# Clone repository
git clone https://github.com/jieyefriic/code-context
cd code-context
# Install in development mode
pip install -e .
# Initialize configuration
code-context init
# Install MCP client
code-context install-mcpcode-context works with 12+ AI coding assistants through the Model Context Protocol (MCP):
Supported Platforms: Claude Code • Cursor • Antigravity • Windsurf • Warp • Cline • VS Code Copilot • Copilot CLI • Amp • Gemini CLI • Codex • Factory CLI
code-context install-mcpThis interactive wizard will automatically configure your AI assistant.
For detailed platform-specific instructions, see INSTALLATION.md
Quick Links:
- Claude Code Setup
- Cursor Setup
- Antigravity Setup
- Windsurf Setup
- Warp Terminal Setup
- All Platforms & Troubleshooting
code-context initThis wizard will:
- Guide you through selecting LLM provider (OpenAI, Gemini, DeepSeek, etc.)
- Configure API keys securely
- Set up embedding configuration
- Create data directory at
~/.code-context/ - Initialize embedded Qdrant database
Important: This step must be completed before using the MCP server.
In Claude Code, ask:
Scan my project directory for API endpoints
Or manually:
# In Python REPL
from code_context import tools
tools.scan_codebase("/path/to/your/project", language="python")In Claude Code, you can now ask:
What's the user login endpoint specification?
Show me all endpoints related to authentication
What parameters does the /api/users/:id endpoint accept?
The following tools are available to Claude Code:
Search for endpoints by name or route
{
"name": "get_user", // Optional: exact name match
"route": "/api/users" // Optional: exact route match
}Manually add an endpoint
{
"name": "create_user",
"route": "/api/users",
"method": "POST",
"file_path": "/path/to/api.py",
"description": "Create a new user",
"parameters": {...},
"response_format": {...}
}Scan a directory for endpoints
{
"directory": "/path/to/project",
"language": "python"
}Update an existing endpoint
{
"endpoint_id": "uuid-here",
"updates": {
"description": "Updated description"
}
}Delete an endpoint
{
"endpoint_id": "uuid-here"
}List all stored endpoints
{
"limit": 100
}- ✅ Python: FastAPI, Flask
- 🔜 Node.js: Express, NestJS
- 🔜 Go: Gin, Echo, Chi
- 🔜 Rust: Axum, Actix
code-context/
├── src/code_context/
│ ├── server.py # MCP server core
│ ├── config.py # Configuration management
│ ├── tools/ # MCP tool implementations
│ ├── scanner/ # Code scanners (extensible)
│ │ ├── python.py # Python scanner
│ │ └── [future: go.py, rust.py, etc.]
│ └── database/ # Qdrant client wrapper
└── tests/
# Custom data directory
export CODE_CONTEXT_DATA_DIR=~/.my-code-context
# Use remote Qdrant
export CODE_CONTEXT_QDRANT_URL=http://localhost:6333
export CODE_CONTEXT_QDRANT_API_KEY=your-key
# Collection settings
export CODE_CONTEXT_COLLECTION_NAME=my_endpoints
export CODE_CONTEXT_VECTOR_SIZE=1536code-context info# Clone and install with dev dependencies
git clone https://github.com/jieyefriic/code-context
cd code-context
pip install -e ".[dev]"pytest tests/black src/
ruff check src/Create src/code_context/scanner/golang.py:
from . import BaseScanner
from ..database import Endpoint
class GoScanner(BaseScanner):
def can_handle(self, file_path):
return file_path.suffix == ".go"
def scan_file(self, file_path):
# Implement Go-specific scanning
endpoints = []
# ... parse Go code ...
return endpointsRegister in scanner/python.py:
def get_scanner(language: str):
scanners = {
"python": PythonScanner,
"go": GoScanner, # Add here
}
# ...- Basic MCP server
- Python FastAPI/Flask scanner
- Embedded Qdrant storage
- LLM integration for semantic search
- Support for more languages (Go, Rust, Node.js)
- Web UI for endpoint management
- VS Code extension
- Automatic re-scanning on file changes
- Cloud-hosted version for teams
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details
A: Yes! It works with both Claude Code and Claude Desktop.
A: Yes, set CODE_CONTEXT_QDRANT_URL environment variable.
A: Re-run scan_codebase on the directory. Future versions will support auto-refresh.
A: Not yet, but Go/Rust/Node.js support is planned. You can manually add endpoints with add_endpoint.
A: No. Everything runs locally unless you configure a remote Qdrant server. LLM integration (optional) will use your API keys.
- 📖 Documentation
- 🐛 Issues
- 💬 Discussions
Made with ❤️ for the AI coding community