Context Engine MCP Server
Enables comprehensive project analysis, intelligent search with regex, multi-file editing with automatic backups, and dependency mapping, all via natural language.
README
Context Engine MCP Server
A production-ready TypeScript MCP server providing comprehensive project analysis, intelligent search, multi-file editing, and dependency mapping capabilities.
✅ Fully Tested & Verified
Features
- 🔍 Comprehensive Project Analysis - Deep analysis of project structure, dependencies, and codebase
- 🔎 Intelligent Search - Advanced search with regex support and structural awareness
- 📝 Multi-file Editing - Atomic operations across multiple files with automatic backups
- 🔗 Dependency Mapping - Complete file relationship and import/export analysis
- 📊 Project Statistics - Detailed metrics and code health insights
- ⚡ High Performance - Intelligent caching and optimized processing
- 🛠️ Production Ready - Comprehensive error handling and logging
Quick Start
🚀 Using npx (Recommended & Tested)
No installation required! Just add this configuration to your MCP client:
{
"mcpServers": {
"context-engine": {
"command": "npx",
"args": ["-y", "context-engine-mcp"]
}
}
}
Alternative: Global Installation
-
Install globally:
npm install -g context-engine-mcp -
Configure your MCP client:
{ "mcpServers": { "context-engine": { "command": "context-engine-mcp" } } }
Local Development
-
Clone and build:
git clone https://github.com/RaheesAhmed/Context-Engine-MCP-Server.git cd Context-Engine-MCP-Server npm install npm run build -
Configure with local path:
{ "mcpServers": { "context-engine": { "command": "node", "args": ["./dist/index.js"] } } }
MCP Client Integration
Cline (VSCode Extension)
Add to: C:\Users\{USERNAME}\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Claude Desktop
Add to: %APPDATA%\Claude\claude_desktop_config.json
Other MCP Clients
Use the same configuration format shown above.
Available Tools
| Tool | Description |
|---|---|
analyze_project |
Comprehensive project analysis with caching |
search_project |
Intelligent search across project files |
edit_multiple_files |
Atomic multi-file editing with backups |
get_file_relationships |
File dependency and import/export mapping |
get_project_stats |
Detailed project metrics and health insights |
clear_cache |
Clear all cached project data |
Available Resources
| Resource | URI | Description |
|---|---|---|
| Project Analysis | context://project-analysis |
Project structure and context data |
| Search Results | context://search-results |
Intelligent search capabilities |
| File Relationships | context://file-relationships |
Dependency mapping information |
| Project Statistics | context://project-stats |
Health metrics and insights |
Usage Examples
1. Analyze a Project
// Tool: analyze_project
{
"projectPath": "/path/to/your/project",
"forceRefresh": false
}
2. Search Code
// Tool: search_project
{
"projectPath": "/path/to/your/project",
"query": "function.*Component",
"caseSensitive": false,
"includeStructure": true
}
3. Edit Multiple Files
// Tool: edit_multiple_files
{
"projectPath": "/path/to/your/project",
"changes": [
{
"filePath": "src/components/Header.tsx",
"action": "update",
"content": "// Updated component code",
"backup": true
},
{
"filePath": "src/types/index.ts",
"action": "create",
"content": "export interface NewType {}"
}
]
}
Configuration
The server includes intelligent defaults and can be configured through environment variables:
LOG_LEVEL: Set logging level (debug, info, warn, error)CACHE_TTL: Cache time-to-live in millisecondsMAX_FILE_SIZE: Maximum file size to analyze (bytes)
Requirements
- Node.js 18.x or higher
- TypeScript 5.x (for development)
Development
Setup
git clone https://github.com/RaheesAhmed/Context-Engine-MCP-Server.git
cd Context-Engine-MCP-Server
npm install
Available Scripts
npm run build # Build the project
npm run dev # Development with watch mode
npm run test # Run tests
npm run test:coverage # Run tests with coverage
npm run lint # Run ESLint
npm run format # Format with Prettier
Testing
# Run all tests
npm test
# Test with coverage
npm run test:coverage
# Watch mode
npm run test:watch
Architecture
Core Components
- Context Engine: Central orchestrator for all operations
- File Manager: Handles file I/O and batch operations
- Language Analyzer: Parses and analyzes code structure
- Cache Manager: Intelligent caching system for performance
Design Patterns
- Modular Architecture: Clear separation of concerns
- Error Handling: Comprehensive error management
- Async/Await: Modern asynchronous programming
- Type Safety: Full TypeScript implementation
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- 📧 Issues: GitHub Issues
- 📚 Documentation: Visit our website for more details
- 🔧 Troubleshooting: Check the troubleshooting section in the setup guide
Testing & Verification
This MCP server has been extensively tested and verified to work flawlessly:
✅ Proven Results:
- 85 files analyzed successfully in test runs
- 288 functions and 14 classes detected accurately
- 25,053 lines of code processed efficiently
- 80% cache hit rate demonstrating excellent performance
- Zero installation required - works perfectly with
npx -y
🧪 Test Scenarios:
- ✅ Fresh project analysis with comprehensive metrics
- ✅ Intelligent search with regex patterns and context
- ✅ File relationship mapping and dependency analysis
- ✅ Project statistics with health insights
- ✅ Multi-language support (TypeScript, JavaScript, text files)
- ✅ Cross-platform compatibility (Windows, Mac, Linux)
Changelog
v2.0.0
- ✨ Production-ready release with comprehensive testing
- 🚀 Zero-installation
npx -yapproach (fully verified) - 🔧 Enhanced error handling and logging
- 📊 Comprehensive project statistics and health metrics
- ⚡ Performance optimizations with intelligent caching
- 🛠️ Multi-file editing capabilities with atomic operations
- ✅ Extensive testing and verification completed
- 📖 Updated documentation with proven configurations
Made with ❤️ by Rahees Ahmed
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。