A comprehensive Model Context Protocol (MCP) server that enhances AI capabilities by providing rich context from your workspace. This server is designed to make AI assistants smarter by giving them deep understanding of your codebase, patterns, and project structure.
- Complete Code Analysis: Analyzes entire workspace structure, technologies, and patterns
- Dependency Mapping: Tracks file dependencies and relationships
- Technology Detection: Automatically identifies frameworks, libraries, and tools
- Architecture Insights: Recognizes architectural patterns and design principles
analyze_workspace
: Comprehensive workspace analysis with customizable depthsearch_codebase
: Advanced code search with regex support and contextget_file_dependencies
: Detailed dependency analysis for any fileget_project_patterns
: Extract architectural patterns and conventionsget_context_summary
: Generate AI-optimized workspace summariessuggest_improvements
: Automated code quality and security recommendations
- Code Review Templates: Comprehensive code review checklists
- Architecture Analysis: System design evaluation prompts
- Security Audits: Security-focused analysis templates
- Performance Optimization: Performance analysis and improvement guides
- Refactoring Suggestions: Code quality improvement templates
- Direct access to all workspace files
- Intelligent file filtering and organization
- MIME type detection and proper content handling
- Efficient caching for better performance
- Onboarding: Help new team members understand codebase structure
- Code Reviews: Automated analysis and comprehensive review checklists
- Architecture Planning: Analyze current patterns and plan improvements
- Knowledge Transfer: Preserve and share architectural knowledge
- Context Enrichment: Provide comprehensive workspace context to AI assistants
- Pattern Recognition: Help AI understand your specific coding patterns
- Smart Suggestions: Get AI recommendations based on your actual codebase
- Automated Analysis: Regular codebase health checks and improvement suggestions
- Node.js 18+
- TypeScript
- VS Code or compatible MCP client
-
Clone or create the project:
git clone <your-repo> context-ai-mcp-server cd context-ai-mcp-server
-
Install dependencies:
npm install
-
Build the project:
npm run build
-
Configure your MCP client:
For VS Code: The
.vscode/mcp.json
file is already configured. Just open VS Code and the server will be available.For Claude Desktop: Add to your
claude_desktop_config.json
:{ "mcpServers": { "context-ai-mcp-server": { "command": "node", "args": [ "/ABSOLUTE/PATH/TO/context-ai-mcp-server/dist/index.js" ], "env": { "WORKSPACE_PATH": "/ABSOLUTE/PATH/TO/YOUR/PROJECT" } } } }
-
Analyze Your Workspace:
Use the analyze_workspace tool to get comprehensive insights about your project structure, technologies, and patterns.
-
Search Your Code:
Use search_codebase with queries like "function.*authenticate" to find authentication-related code across your project.
-
Get Context Summary:
Use get_context_summary to generate AI-optimized summaries of your workspace for enhanced AI interactions.
WORKSPACE_PATH
: Path to the workspace to analyze (defaults to current directory)
The server can be customized by modifying:
- Prompt Templates: Edit
src/prompt-templates.ts
to add custom prompts - Analysis Logic: Modify
src/context-manager.ts
for custom analysis patterns - File Indexing: Adjust
src/workspace-indexer.ts
for different file handling
├── src/
│ ├── index.ts # Main MCP server implementation
│ ├── workspace-indexer.ts # File system analysis and indexing
│ ├── context-manager.ts # Context extraction and management
│ └── prompt-templates.ts # Predefined prompt templates
├── dist/ # Compiled JavaScript output
├── .vscode/
│ └── mcp.json # VS Code MCP configuration
└── .github/
└── copilot-instructions.md # GitHub Copilot customization
npm run build
: Compile TypeScript to JavaScriptnpm run dev
: Watch mode for developmentnpm start
: Run the compiled server
- Add tool definition in
src/index.ts
setupToolHandlers()
- Implement tool logic in
src/context-manager.ts
- Add corresponding method in the main server class
- Update documentation
- Add prompt template in
src/prompt-templates.ts
- Implement prompt generation logic
- Test with MCP clients
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
Made with ❤️ to enhance AI capabilities through rich workspace context