{"id":37578129,"url":"https://github.com/plwp/mcprelay","last_synced_at":"2026-01-16T09:36:04.649Z","repository":{"id":299058150,"uuid":"1001873202","full_name":"plwp/mcprelay","owner":"plwp","description":"Enterprise-grade MCP gateway for secure, scalable Model Context Protocol deployments","archived":false,"fork":false,"pushed_at":"2025-06-14T11:24:22.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-14T12:29:27.065Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plwp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-14T08:04:00.000Z","updated_at":"2025-06-14T11:24:25.000Z","dependencies_parsed_at":"2025-06-14T12:30:46.957Z","dependency_job_id":"6c466c2f-334e-413b-9033-b181915c70c0","html_url":"https://github.com/plwp/mcprelay","commit_stats":null,"previous_names":["plwp/mcprelay"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/plwp/mcprelay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plwp%2Fmcprelay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plwp%2Fmcprelay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plwp%2Fmcprelay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plwp%2Fmcprelay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plwp","download_url":"https://codeload.github.com/plwp/mcprelay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plwp%2Fmcprelay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T09:36:04.532Z","updated_at":"2026-01-16T09:36:04.633Z","avatar_url":"https://github.com/plwp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MCPRelay\n\nEnterprise-grade gateway for Model Context Protocol (MCP) servers. Secure, scalable, and production-ready.\n\n## Overview\n\nMCPRelay is an open-source API gateway designed specifically for MCP (Model Context Protocol) servers. It provides enterprise-grade security, authentication, rate limiting, and monitoring capabilities for production MCP deployments.\n\n## Features\n\n- **Security First**: MCP-aware request validation and response sanitization\n- **Authentication**: API key and JWT-based authentication with role-based access control\n- **Rate Limiting**: Token bucket rate limiting with per-user tiers\n- **Load Balancing**: Intelligent load balancing with health checks and failover\n- **Monitoring**: Prometheus metrics, structured logging, and real-time dashboard\n- **Easy Deployment**: Docker-based deployment with YAML configuration\n- **Web Interface**: Modern admin dashboard for configuration and monitoring\n\n## Quick Start\n\n### Using the Quick Start Script\n\n```bash\ngit clone https://github.com/plwp/mcprelay.git\ncd mcprelay\n./quickstart.sh\n```\n\n### Manual Installation\n\n```bash\n# Install dependencies\npip install -e .\n\n# Create configuration\ncp config.example.yaml config.yaml\n# Edit config.yaml to add your MCP servers\n\n# Start the gateway\nmcprelay serve\n```\n\n### Docker Deployment\n\n```bash\n# Using Docker Compose (recommended)\ndocker-compose up -d\n\n# Or run directly\ndocker run -p 8080:8080 -v ./config.yaml:/app/config.yaml mcprelay/mcprelay\n```\n\n## Configuration\n\nMCPRelay uses YAML configuration. Here's a minimal example:\n\n```yaml\n# Basic server settings\nhost: \"0.0.0.0\"\nport: 8080\n\n# MCP servers to proxy to\nservers:\n  - name: \"hue-server\"\n    url: \"http://localhost:3000\"\n    weight: 1\n    timeout: 30\n\n# Authentication\nauth:\n  enabled: true\n  method: \"api_key\"\n  api_keys:\n    admin: \"your-admin-key\"\n\n# Rate limiting\nrate_limit:\n  enabled: true\n  default_requests_per_minute: 60\n  burst_size: 10\n\n# Security\nmcp_safeguards_enabled: true\n```\n\n## Architecture\n\n```\nAI Client → MCPRelay Gateway → MCP Server(s)\n              ↓\n        [Auth, Rate Limit, Load Balance, Monitor]\n```\n\nMCPRelay sits between your AI clients and MCP servers, providing:\n\n- **Request Authentication**: Validates API keys or JWT tokens\n- **Rate Limiting**: Prevents abuse with configurable limits\n- **Load Balancing**: Distributes requests across healthy backend servers\n- **Request Validation**: MCP-aware filtering of dangerous operations\n- **Response Sanitization**: Strips sensitive data from responses\n- **Monitoring**: Comprehensive metrics and logging\n\n## API Endpoints\n\n- `GET /health` - Health check endpoint\n- `GET /metrics` - Prometheus metrics\n- `POST /mcp/{path}` - Main proxy endpoint for MCP requests\n- `GET /admin/` - Web administration interface\n\n## Web Dashboard\n\nMCPRelay includes a modern web interface for administration:\n\n- **Dashboard**: Real-time statistics and recent activity\n- **Server Management**: Add, remove, and monitor backend servers\n- **Configuration**: Edit settings through the web UI\n- **Logs**: View and filter system logs\n- **Metrics**: Performance analytics and visualizations\n\nAccess the dashboard at `http://localhost:8080/admin/` (requires admin authentication).\n\n## CLI Usage\n\n```bash\n# Start the server\nmcprelay serve\n\n# Validate configuration\nmcprelay validate\n\n# Check backend health\nmcprelay health\n\n# Show version\nmcprelay version\n```\n\n## Security\n\nMCPRelay provides multiple layers of security:\n\n### MCP Safeguards\n- Validates JSON-RPC requests for proper MCP format\n- Blocks dangerous operations (file system access, code execution)\n- Sanitizes responses to prevent data leakage\n\n### Authentication\n- API key authentication with configurable keys\n- JWT token validation with proper claims checking\n- Role-based access control (admin vs user permissions)\n\n### Rate Limiting\n- Token bucket algorithm with configurable rates\n- Per-user rate limits\n- Burst capacity for handling traffic spikes\n\n## Monitoring\n\n### Metrics\nMCPRelay exports Prometheus metrics including:\n- Request count and rate\n- Response times and percentiles\n- Backend server health status\n- Error rates and types\n\n### Logging\nStructured JSON logging with configurable levels:\n- Request/response logging\n- Security event logging\n- Performance metrics\n- Error tracking\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- **Issues**: [GitHub Issues](https://github.com/plwp/mcprelay/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/plwp/mcprelay/discussions)\n- **Documentation**: [mcprelay.org](https://mcprelay.org)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplwp%2Fmcprelay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplwp%2Fmcprelay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplwp%2Fmcprelay/lists"}