npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

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.

Readme

Universal Context Engineering MCP Server

TypeScript MongoDB Node.js MCP

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 .env

2. 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_key

3. Build & Start

npm run build
npm start

4. 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: ResearchBlueprintValidation

  • 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=1024

MongoDB Setup

Local MongoDB:

# 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

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 formatting

Project 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:

  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


🏆 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

Star History Chart


🚀 Transform your AI coding experience with intelligent context engineering!

Built with ❤️ for the AI coding community