The intelligent context optimization system for AI coding assistants. Built with Cole's PRP methodology, Context Portal knowledge graphs, and production-ready MongoDB architecture.
npm install mcp-context-engineering



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.
---
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
---
bash
git clone https://github.com/romiluz13/mcp-context-engineering.git
cd mcp-context-engineering
npm install
cp .env.example .env
`$3
Edit .env with your settings:
`env
MONGODB_URI=mongodb://localhost:27017
MONGODB_DATABASE=universal_context_engineering
VOYAGE_API_KEY=your_voyage_ai_key
OPENAI_API_KEY=your_openai_key
`$3
`bash
npm run build
npm start
`$3
For Claude Code/Desktop:
`json
{
"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
$3
| 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 |$3
- 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
$3
`javascript
{
"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"
}
}
`$3
`javascript
{
"tool": "get_universal_context",
"arguments": {
"project_id": "my-web-app",
"agent_type": "cursor",
"query": "authentication patterns",
"min_effectiveness": 7
}
}
`$3
`javascript
{
"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
$3
Systematic approach: Research β Blueprint β Validation
- Comprehensive codebase analysis
- External research integration
- Step-by-step implementation plans
- Quality validation frameworks$3
- Relationship-aware context connections
- Decision tracking and history
- Pattern dependencies and conflicts
- Cross-project knowledge sharing$3
- Tracks what works for each AI agent
- Improves recommendations over time
- Cross-agent effectiveness insights
- Continuous pattern optimization---
βοΈ Configuration
$3
`env
MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017
MONGODB_DATABASE=universal_context_engineeringAI Services (Required)
VOYAGE_API_KEY=your_voyage_ai_key
OPENAI_API_KEY=your_openai_keyOptional Configuration
NODE_ENV=development
LOG_LEVEL=info
DEBUG_MONGODB_OPERATIONS=false
VECTOR_DIMENSIONS=1024
`$3
Local MongoDB:
`bash
Install MongoDB locally
brew install mongodb/brew/mongodb-community
brew services start mongodb/brew/mongodb-community
`MongoDB Atlas:
- Create cluster at MongoDB Atlas
- Get connection string
- Update
MONGODB_URI in .env---
π οΈ Development
$3
`bash
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 formatting
`$3
`
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.
$3
1. Fork the repository
2. Create feature branch (git checkout -b amazing-feature)
3. Commit changes (git commit -m 'Add amazing feature')
4. Push to branch (git push origin amazing-feature)
5. Open Pull Request---
π License
This project is licensed under the MIT License - see the LICENSE file for details.
---
π Support
- Documentation: Check the
/docs` folder for detailed guides---
- 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
---

---
π Transform your AI coding experience with intelligent context engineering!
Built with β€οΈ for the AI coding community