premkalyan/enhanced-context-mcp
If you are the rightful owner of enhanced-context-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Enhanced Context MCP Server v2.0.0 is a serverless solution for intelligent context management, designed for deployment on Vercel.
Enhanced Context MCP Server v2.0.0
Serverless Enhanced Context MCP Server with Project Registry Integration
Overview
The Enhanced Context MCP Server provides intelligent context loading for AI agents, automatically selecting appropriate templates, contexts, and agent profiles based on query type. This is a complete TypeScript rewrite of the original server, designed for serverless deployment on Vercel.
Features
- 🎯 Automatic Agent Selection - Intelligently selects the right VISHKAR agent based on query type
- 📝 Template Loading - Loads appropriate templates from VISHKAR repository
- 🔧 Project-Specific Rules - Supports project-specific configuration and rules
- 💾 Vercel Blob Storage - Scalable file storage for contexts and templates
- ⚡ Vercel KV Caching - Fast response times with Redis-backed caching
- 🔒 Secure Authentication - Integration with Project Registry for credential management
- 🚀 Serverless Architecture - Fully serverless deployment on Vercel
Architecture
Clean Architecture Layers
app/api/ # Presentation Layer (API Routes)
lib/
├── services/ # Application Layer (Business Logic)
├── domain/ # Domain Layer (Entities)
├── infrastructure/ # Infrastructure Layer (Storage, Auth, Monitoring)
├── utils/ # Utilities (Validation, Security)
└── config/ # Configuration Management
Storage Abstraction
The server uses a storage adapter pattern that switches between:
- Development: File system storage (
~/.wama) - Production: Vercel Blob storage with KV caching
Available Tools
1. load_enhanced_context
Load global WAMA contexts, templates, and project-specific rules based on query type.
Query Types:
story- User story and epic creationtesting- Test planning and strategysecurity- Security reviews and auditsarchitecture- Architecture design and documentationpr-review- Pull request reviewsbrowser-testing- Browser automation testingproject-planning- Project planning and managementstory-breakdown- Breaking down epics into storiesdocumentation- Technical documentationflow-diagrams- Flow and sequence diagramsinfrastructure- Infrastructure as code and cloud architecture
2. list_vishkar_agents
List all available VISHKAR agent profiles.
3. load_vishkar_agent
Load complete VISHKAR agent profile by ID.
4. validate_vishkar_agent_profile
Validate VISHKAR agent profile format and completeness.
5. refresh_agent_cache
Clear cached agent profiles and reload from storage.
6. update_agent
Update existing agent configurations with learning improvements.
API Endpoints
GET /api/health
Health check endpoint.
POST /api/mcp
Main MCP endpoint for tool calls.
Request:
{
"tool": "load_enhanced_context",
"arguments": {
"query_type": "story",
"project_path": "/optional/path/to/project"
}
}
Headers:
X-API-Key: pk_your_api_key
Content-Type: application/json
GET /api/mcp
List available tools.
Development
Prerequisites
- Node.js 20+
- npm
- Vercel account (for deployment)
Local Setup
# Install dependencies
npm install
# Copy environment variables
cp .env.example .env.local
# Run development server
npm run dev
The server will be available at http://localhost:3000
Local Testing
For local development, the server uses the file system storage adapter which reads from ~/.wama:
~/.wama/
├── contexts/ # Context files (.mdc)
├── templates/ # Template files (.md)
└── agents/ # Agent profile files (.md)
Building
npm run build
Linting
npm run lint
Deployment
Vercel Setup
- Install Vercel CLI:
npm i -g vercel
- Login to Vercel:
vercel login
- Deploy:
vercel --prod
Environment Variables
Configure in Vercel Dashboard:
PROJECT_REGISTRY_URL- URL of the Project RegistryBLOB_READ_WRITE_TOKEN- Automatically provided by Vercel BlobKV_REST_API_URL- Automatically provided by Vercel KVKV_REST_API_TOKEN- Automatically provided by Vercel KV
Vercel Blob Setup
- Go to Vercel Dashboard → Your Project → Storage
- Create a new Blob Store
- Environment variables are automatically injected
Vercel KV Setup
- Go to Vercel Dashboard → Your Project → Storage
- Create a new KV Store
- Environment variables are automatically injected
Integration with Project Registry
This server integrates with the Project Registry for centralized credential management:
- Register your project in the Project Registry
- Store any necessary credentials (encrypted with AES-256-GCM)
- Use the provided API key in the
X-API-Keyheader - The server validates credentials via the Project Registry
Security
Authentication
- API key authentication via
X-API-Keyheader - Integration with Project Registry for validation
- Timing-safe comparison for token validation
Path Traversal Protection
- All file paths are validated before access
- No access to files outside allowed directories
- Normalized path resolution
Storage Security
- Vercel Blob: Public read access, authenticated write
- Vercel KV: Encrypted at rest
- No sensitive data in client-side code
Performance
- Caching: Agent profiles cached in Vercel KV (1 hour TTL)
- Storage: Vercel Blob with CDN edge caching
- Cold Start: < 500ms typical response time
- Concurrent: Handles 1000+ concurrent requests
Migration from v1.0
This is a complete rewrite with:
- TypeScript throughout
- Clean architecture
- Serverless-first design
- Vercel Blob/KV storage
- Improved error handling
- Better testability
License
MIT
Support
For issues and feature requests, please use the GitHub issue tracker.