- Home
- MCP servers
- Codebase Context
Codebase Context
- typescript
18
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"patricksys-codebase-context": {
"command": "npx",
"args": [
"codebase-context",
"/path/to/your/project"
]
}
}
}You can give your AI coding assistants real-time visibility into your codebase so they understand which libraries you actually use, how patterns are used, and where to find practical examples. This MCP server surfaces internal libraries, patterns, and style conventions from your project and presents them to your agents to improve accuracy and relevance when generating or reviewing code.
How to use
To use this MCP server with your client, configure it as an MCP endpoint in your client settings. The server provides insights like which internal libraries are in use, how often they appear, pattern frequencies, and golden-file examples that show real implementations.
How to install
Prerequisites: you need Node.js and npm installed on your machine.
Step 1: Install the MCP client integration in your editor or environment (example: Claude Desktop, VS Code, Cursor) and add the MCP server configuration to your client.
Step 2: Add the MCP server configuration snippet to your client settings.
Step 3: Start using the MCP server to fetch team patterns, canonical examples, and usage insights during code generation or review.
Configuration
This MCP focuses on providing real-time visibility into your codebase to AI assistants. It supports local indexing and pattern extraction so agents can prefer team patterns and canonical examples during generation.
Quick Start snippet to configure the MCP server in your client (uses npx to run the package and points to your project path):
"mcpServers": {
"codebase_context": {
"command": "npx",
"args": ["codebase-context", "/path/to/your/project"]
}
}
Performance and usage notes
The server runs locally on your machine. The initial indexing may take several minutes depending on your project size, but subsequent queries are fast due to caching. Updates are performed by refreshing the index.
Security and data handling
All processing happens locally on your machine, and environment variables or secrets should be kept secure in your local environment. The server does not upload your code to external services unless explicitly configured to do so by you.
Troubleshooting
If indexing takes unusually long or queries are slow, ensure your machine has sufficient CPU/memory headroom and that the codebase path provided to the MCP server is correct. If you see missing libraries or patterns, re-run the refresh index operation to re-index the repository.
Notes
You can extend usage with team-specific patterns and canonical examples to help AI agents prefer your internal conventions when generating or reviewing code.
Available tools
search_codebase
Semantic and keyword-based search to locate code patterns, libraries, and usage examples across the project.
get_component_usage
Discover where a library or component is used to show canonical usage locations.
get_team_patterns
Provide pattern frequencies and real-world examples from the codebase.
get_codebase_metadata
Offer an overview of project structure and key components.
get_style_guide
Query style rules and conventions used by the team.
detect_circular_dependencies
Identify import cycles and potential dependency issues.
refresh_index
Re-index the codebase to update embeddings and patterns.