changemaker-mcp-bridge
Production-ready Express server with Model Context Protocol (MCP) integration, webhook handlers for Google Chat and n8n, and comprehensive monitoring
GitHubスター
0
ユーザー評価
未評価
フォーク
0
イシュー
0
閲覧数
1
お気に入り
0
Changemaker MCP Bridge
Production-ready Express server with full Model Context Protocol (MCP) integration for the Changemaker platform.
Overview
This server provides a robust bridge between the Changemaker platform and various MCP servers, enabling:
- Multi-tenant Architecture: Organization-scoped access with user permissions
- MCP Integration: Support for Taskmaster-AI, Zen Suite, and Playwright MCP servers
- Enterprise Features: Rate limiting, caching, monitoring, and comprehensive error handling
- External Integrations: Supabase, Resend, Sentry, and RewardStack support
Key Features
Core Capabilities
- ✅ Production-ready Express server with TypeScript
- ✅ Full MCP client implementation with Claude Code CLI integration
- ✅ Multi-tenant context management with organization isolation
- ✅ Redis-based caching for performance optimization
- ✅ Comprehensive authentication and authorization
- ✅ Rate limiting per organization and user
- ✅ Structured logging and error tracking
- ✅ Health checks and monitoring endpoints
MCP Features
- Execute tools on multiple MCP servers
- Batch tool execution support
- Tool discovery and listing
- Server health monitoring
- Context-aware tool execution
- Result caching for improved performance
Security
- JWT-based authentication
- API key support
- Role-based access control (RBAC)
- Organization-level isolation
- Request validation and sanitization
Architecture
src/
├── api/
│ ├── server.ts # Express server setup
│ ├── controllers/ # Request handlers
│ ├── middleware/ # Auth, validation, error handling
│ └── routes/ # API route definitions
├── integrations/
│ └── mcp/
│ ├── mcp-client.ts # MCP client implementation
│ └── context/ # Context management
├── services/ # Business logic
├── types/ # TypeScript definitions
├── utils/ # Utilities (logger, errors)
└── config/ # Configuration
API Endpoints
MCP Operations
POST /api/v1/mcp/execute
- Execute a single MCP toolPOST /api/v1/mcp/batch
- Execute multiple MCP toolsGET /api/v1/mcp/servers/:server/tools
- List available toolsGET /api/v1/mcp/servers/:server/status
- Get server statusGET /api/v1/mcp/servers/status
- Get all servers statusGET /api/v1/mcp/health
- MCP integration health check
Challenge Management
POST /api/v1/challenges
- Create challengeGET /api/v1/challenges
- List challengesGET /api/v1/challenges/:id
- Get challenge detailsPATCH /api/v1/challenges/:id
- Update challengeDELETE /api/v1/challenges/:id
- Delete challengePOST /api/v1/challenges/:id/participate
- Join challengePOST /api/v1/challenges/:id/metrics
- Update metricsGET /api/v1/challenges/:id/stats
- Get statistics
Health & Monitoring
GET /health
- Basic health checkGET /api/v1/health/detailed
- Detailed system healthGET /api/v1/health/ready
- Kubernetes readiness probeGET /api/v1/health/live
- Kubernetes liveness probe
Getting Started
Prerequisites
- Node.js 18+
- Redis server
- PostgreSQL (for Supabase)
Installation
Clone the repository
Install dependencies:
npm install
Copy environment variables:
cp .env.example .env
Configure your environment variables in
.env
Start Redis:
redis-server
Run in development:
npm run dev
Building for Production
npm run build
npm start
Configuration
The server uses environment variables for configuration. See .env.example
for all available options.
Key configurations:
- Server: Port, host, environment
- Security: JWT secret, CORS origins
- Redis: Connection URL and TTL settings
- MCP Servers: API keys and configurations
- External Services: Supabase, Resend, Sentry credentials
Authentication
The server supports two authentication methods:
Bearer Token (JWT):
Authorization: Bearer <jwt-token>
API Key:
x-api-key: org_<orgId>_user_<userId>
Error Handling
The server implements comprehensive error handling with:
- Structured error responses
- Proper HTTP status codes
- Sentry integration for production monitoring
- Detailed logging for debugging
Error response format:
{
"error": {
"code": "ERROR_CODE",
"message": "Human readable message",
"details": {}
}
}
Development
Running Tests
npm test
npm run test:watch
npm run test:coverage
Linting
npm run lint
TypeScript Type Checking
npx tsc --noEmit
Deployment
The server is designed for containerized deployment:
- Build the Docker image
- Set environment variables
- Ensure Redis is accessible
- Deploy with health check monitoring
License
MIT
36
フォロワー
176
リポジトリ
4
Gist
1
貢献数