mcp-context-engineering
v3.2.0
Published
The intelligent context optimization system for AI coding assistants. Built with Cole's PRP methodology, Context Portal knowledge graphs, and production-ready MongoDB architecture.
Maintainers
Readme
Universal Context Engineering MCP Server
The intelligent context optimization system for AI coding assistants
Transform your AI coding experience with systematic context engineering that gets smarter over time. Built with Cole's proven PRP methodology, Context Portal knowledge graphs, and production-ready MongoDB architecture.
🌟 Why Universal Context Engineering?
Traditional AI coding assistants work with static context. This MCP server creates dynamic, intelligent context that:
- 📈 Learns and improves from every interaction
- 🎯 Optimizes for your specific AI agent (Cursor, Windsurf, Claude Code, etc.)
- 🧠 Applies proven methodologies (Cole's PRP + Context Portal patterns)
- 🚀 Scales with MongoDB for production workloads
- 🔗 Builds knowledge graphs of successful patterns
⚡ Quick Start
Prerequisites
- Node.js 18.12+
- MongoDB (local or Atlas)
- AI coding assistant with MCP support
1. Install & Setup
git clone https://github.com/romiluz13/mcp-context-engineering.git
cd mcp-context-engineering
npm install
cp .env.example .env2. Configure Environment
Edit .env with your settings:
MONGODB_URI=mongodb://localhost:27017
MONGODB_DATABASE=universal_context_engineering
VOYAGE_API_KEY=your_voyage_ai_key
OPENAI_API_KEY=your_openai_key3. Build & Start
npm run build
npm start4. Add to Your AI Agent
For Claude Code/Desktop:
{
"mcpServers": {
"universal-context-engineering": {
"command": "node",
"args": ["dist/src/index.js"],
"cwd": "/path/to/mcp-context-engineering",
"env": {
"MONGODB_URI": "mongodb://localhost:27017",
"MONGODB_DATABASE": "universal_context_engineering",
"VOYAGE_API_KEY": "your_key",
"OPENAI_API_KEY": "your_key"
}
}
}
}For Cursor/Windsurf: Similar configuration in your MCP settings.
🎯 Core Features
📋 MCP Tools Available
| Tool | Purpose | What It Does |
|------|---------|--------------|
| generate_universal_prp | Generate Smart PRPs | Creates comprehensive implementation plans using Cole's methodology |
| get_universal_context | Retrieve Context | Gets optimized context for your specific AI agent and project |
| search_similar_patterns | Find Patterns | Semantic search for similar successful implementations |
| store_context_pattern | Save Patterns | Stores successful patterns for future learning |
| update_pattern_effectiveness | Learning Loop | Updates pattern effectiveness based on results |
| get_cross_agent_insights | Analytics | Cross-agent performance insights and recommendations |
🤖 Universal AI Agent Support
- Cursor: Concise, action-focused context
- Windsurf: Step-by-step with comprehensive error handling
- Claude Code: Full PRP methodology with detailed analysis
- Generic: Balanced approach for any MCP-compatible agent
🚀 Example Usage
Generate a Universal PRP
{
"tool": "generate_universal_prp",
"arguments": {
"feature_description": "Implement JWT authentication with role-based access control",
"project_context": {
"project_id": "my-web-app",
"tech_stack": ["react", "typescript", "express", "mongodb"],
"complexity_preference": "medium"
},
"agent_type": "claude_code",
"research_depth": "comprehensive"
}
}Get Project Context
{
"tool": "get_universal_context",
"arguments": {
"project_id": "my-web-app",
"agent_type": "cursor",
"query": "authentication patterns",
"min_effectiveness": 7
}
}Search Similar Patterns
{
"tool": "search_similar_patterns",
"arguments": {
"query": "JWT authentication implementation",
"filters": {
"tech_stacks": ["react", "express"],
"complexity": "medium"
},
"agent_type": "windsurf"
}
}🏗️ Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ AI Agent │ │ MCP Server │ │ MongoDB │
│ (Cursor, etc.) │◄──►│ Context Engine │◄──►│ Knowledge │
└─────────────────┘ └──────────────────┘ │ Base │
└─────────────────┘
┌──────────────────┐
│ Vector Search │
│ (Voyage AI) │
└──────────────────┘Core Components:
- MCP Server: TypeScript-based with comprehensive error handling
- Context Engine: Cole's PRP methodology + Context Portal patterns
- Knowledge Base: MongoDB with vector search capabilities
- Learning System: Effectiveness tracking and continuous improvement
- Universal Optimizer: Agent-specific context formatting
📊 What Makes It Special
🧠 Cole's PRP Methodology
Systematic approach: Research → Blueprint → Validation
- Comprehensive codebase analysis
- External research integration
- Step-by-step implementation plans
- Quality validation frameworks
🕸️ Context Portal Knowledge Graphs
- Relationship-aware context connections
- Decision tracking and history
- Pattern dependencies and conflicts
- Cross-project knowledge sharing
📈 Learning Intelligence
- Tracks what works for each AI agent
- Improves recommendations over time
- Cross-agent effectiveness insights
- Continuous pattern optimization
⚙️ Configuration
Environment Variables
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017
MONGODB_DATABASE=universal_context_engineering
# AI Services (Required)
VOYAGE_API_KEY=your_voyage_ai_key
OPENAI_API_KEY=your_openai_key
# Optional Configuration
NODE_ENV=development
LOG_LEVEL=info
DEBUG_MONGODB_OPERATIONS=false
VECTOR_DIMENSIONS=1024MongoDB Setup
Local MongoDB:
# Install MongoDB locally
brew install mongodb/brew/mongodb-community
brew services start mongodb/brew/mongodb-communityMongoDB Atlas:
- Create cluster at MongoDB Atlas
- Get connection string
- Update
MONGODB_URIin.env
🛠️ Development
Scripts
npm run dev # Development with hot reload
npm run build # TypeScript compilation
npm run start # Production server
npm run test # Run tests
npm run lint # Code linting
npm run format # Code formattingProject Structure
src/
├── config/ # Environment configuration
├── context/ # Context engineering logic
│ └── methodology/ # PRP generation & research
├── mcp/ # MCP server implementation
├── mongodb/ # Database models & operations
│ ├── models/ # Data schemas
│ └── operations/ # CRUD operations
└── index.ts # Server entry point🤝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Quick Contributing Steps:
- Fork the repository
- Create feature branch (
git checkout -b amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin amazing-feature) - Open Pull Request
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- Documentation: Check the
/docsfolder for detailed guides - Issues: GitHub Issues
- Discussions: GitHub Discussions
🏆 Acknowledgments
- Cole's PRP Methodology - Systematic context engineering approach
- Context Portal - Knowledge graph patterns and relationship management
- MongoDB MCP Community - Production-ready database integration patterns
- Model Context Protocol - Universal AI agent communication standard
🌟 Star History
🚀 Transform your AI coding experience with intelligent context engineering!
Built with ❤️ for the AI coding community
