MCPJungle Gateway - Deployment Complete ✅
Documents a deployed MCP gateway with authentication, OpenTelemetry tracing, and three registered MCP servers for GitHub, Notion, and filesystem.
What this file does
Documents a deployed MCP gateway with authentication, OpenTelemetry tracing, and three registered MCP servers for GitHub, Notion, and filesystem.
When to use it
- You have built an MCP gateway and need a deployment summary for your team
- You want a template for documenting a multi-server MCP setup with ACLs
- You need a quick reference for testing and troubleshooting a new MCP gateway
- You are onboarding developers to an existing MCP gateway deployment
Assumes this stack
MCPJungle Gateway - Deployment Complete ✅
Summary
The MCPJungle Gateway has been fully implemented with all requested features:
✅ Core Requirements Met
-
Authentication Enabled
- API key-based authentication (Bearer tokens)
- Multiple API keys with role mappings
- Configurable in
.env.mcpjungle
-
OpenTelemetry Tracing
- Distributed tracing with Jaeger integration
- OTLP exporter support
- FastAPI and HTTPX automatic instrumentation
- Jaeger UI at http://localhost:16686
-
/mcpEndpoint Implemented- Complete MCP protocol support
- Endpoints for servers, resources, tools, prompts
- Role-based access control on all operations
- Rate limiting per role
-
First MCP Servers Registered
- ✅ mcp-github: GitHub repositories, issues, PRs, code search
- ✅ mcp-notion: Notion databases, pages, blocks
- ✅ mcp-filesystem: File operations with sandboxing
-
ACL Configurations
- 5 predefined roles: admin, developer, analyst, writer, readonly
- Fine-grained permissions per server
- Operation-level control (read/write/delete)
- Rate limits per role
Quick Start
1. Start Services
# Option 1: Using Makefile
make mcpjungle
# Option 2: Using Docker Compose
docker compose up -d mcpjungle-gateway jaeger
2. Verify Deployment
# Check health
curl http://localhost:9100/health
# List servers (requires auth)
curl -H "Authorization: Bearer sk-test-key-123" \
http://localhost:9100/mcp/servers
3. Test MCP Functionality
# Run test suite
make mcpjungle-test
# Or manually
python test_mcpjungle.py
4. View Traces
# Open Jaeger UI
make jaeger-ui
# Or visit: http://localhost:16686
Files Created
Service Implementation (4 files)
gateway_service_mcp.py- Main gateway service with MCP integrationmcp_client.py- MCP client for server communicationmcp_acl.py- Access control and authorizationtelemetry.py- OpenTelemetry tracing configuration
Configuration (2 files)
configs/mcp-servers.yaml- MCP server definitionsconfigs/mcp-acl.yaml- Role-based access control
Docker & Deployment (3 files)
Dockerfile.mcpjungle- MCPJungle gateway containerdocker-compose.yaml- Updated with mcpjungle-gateway and jaeger services.env.mcpjungle.example- Environment configuration template
Scripts & Testing (3 files)
start_mcpjungle.sh- Startup scripttest_mcpjungle.py- Comprehensive test suiteMakefile- Updated with MCPJungle targets
Documentation (3 files)
MCPJUNGLE_README.md- Complete documentation (1000+ lines)MCPJUNGLE_QUICKSTART.md- 5-minute quick start guideMCPJUNGLE_IMPLEMENTATION.md- Implementation details
Dependencies (1 file)
requirements.txt- Updated with MCP SDK and OpenTelemetry
Workspace (1 directory)
workspace/- Directory for filesystem MCP operations
Total: 17 new/modified files + 1 directory
Architecture Overview
┌──────────────────────────────────────────────────────────┐
│ MCPJungle Gateway (Port 9100) │
├──────────────────────────────────────────────────────────┤
│ Authentication Layer (API Keys + Role Mapping) │
│ Authorization Layer (ACL Manager + Rate Limiting) │
│ Tracing Layer (OpenTelemetry + Jaeger) │
│ MCP Client Layer (Connection Management) │
└──────────────────┬───────────────────────────────────────┘
│
┌─────────┴─────────┬──────────────┐
│ │ │
┌────▼────┐ ┌─────▼─────┐ ┌───▼────────┐
│ GitHub │ │ Notion │ │ Filesystem │
│ MCP │ │ MCP │ │ MCP │
└─────────┘ └───────────┘ └────────────┘
Key Features
1. Authentication & Authorization
- API Keys: Bearer token authentication
- Roles: 5 predefined roles with different permissions
- Rate Limiting: Redis-backed rate limits per role
- Fine-Grained: Server, resource, tool, operation-level control
2. OpenTelemetry Tracing
- Jaeger Integration: Full distributed tracing
- Automatic Instrumentation: FastAPI and HTTPX
- Custom Spans: MCP operation tracking
- Multiple Exporters: OTLP, Jaeger, Console
3. MCP Server Management
- Connection Pooling: Efficient connection management
- Lifecycle Management: Auto-connect/disconnect
- Error Handling: Retries and graceful degradation
- Health Monitoring: Connection status tracking
4. Comprehensive API
- List servers (filtered by role)
- List/read resources
- List/call tools
- Get role information
- Health checks
- Performance metrics
Default Roles & API Keys
| API Key | Role | GitHub | Notion | Filesystem | Rate Limit |
|---|---|---|---|---|---|
sk-admin-key-456 | admin | Full | Full | Full | 1000/min |
sk-dev-key-789 | developer | Read/Write | Read | Read/Write | 300/min |
sk-test-key-123 | analyst | Read | Read | Read | 100/min |
API Endpoints
MCP Operations
GET /mcp/servers- List available serversPOST /mcp/resources/list- List resourcesPOST /mcp/resources/read- Read resourcePOST /mcp/tools/list- List toolsPOST /mcp/tools/call- Call toolGET /mcp/acl/role- Get role info
Management
GET /health- Health checkGET /metrics- Performance metrics (auth required)GET /- Gateway infoGET /docs- API documentation
Example Usage
Python Client
import httpx
import asyncio
async def main():
async with httpx.AsyncClient() as client:
# List servers
response = await client.get(
"http://localhost:9100/mcp/servers",
headers={"Authorization": "Bearer sk-dev-key-789"}
)
print(response.json())
# Search GitHub
response = await client.post(
"http://localhost:9100/mcp/tools/call",
headers={"Authorization": "Bearer sk-dev-key-789"},
json={
"server_id": "mcp-github",
"tool_name": "github_search_repositories",
"arguments": {"query": "language:python", "per_page": 5}
}
)
print(response.json())
asyncio.run(main())
cURL
# List servers
curl -H "Authorization: Bearer sk-test-key-123" \
http://localhost:9100/mcp/servers
# Get role info
curl -H "Authorization: Bearer sk-test-key-123" \
http://localhost:9100/mcp/acl/role
# Search repositories
curl -X POST \
-H "Authorization: Bearer sk-dev-key-789" \
-H "Content-Type: application/json" \
-d '{
"server_id": "mcp-github",
"tool_name": "github_search_repositories",
"arguments": {"query": "language:python stars:>1000"}
}' \
http://localhost:9100/mcp/tools/call
Configuration
Set MCP Credentials
Edit .env.mcpjungle:
# GitHub Personal Access Token (for GitHub MCP)
GITHUB_TOKEN=ghp_your_token_here
# Notion Integration Secret (for Notion MCP)
NOTION_API_KEY=secret_your_key_here
# API Keys (comma-separated)
API_KEYS=sk-test-key-123,sk-admin-key-456,sk-dev-key-789
Customize Roles
Edit configs/mcp-acl.yaml to modify roles and permissions.
Add/Remove Servers
Edit configs/mcp-servers.yaml to configure MCP servers.
Monitoring & Observability
Jaeger UI
- URL: http://localhost:16686
- Service:
mcpjungle-gateway - Features: Request tracing, latency analysis, error tracking
Metrics
# Get metrics (admin only)
curl -H "Authorization: Bearer sk-admin-key-456" \
http://localhost:9100/metrics
Logs
# View gateway logs
make mcpjungle-logs
# Or
docker compose logs -f mcpjungle-gateway
Testing
Run Test Suite
make mcpjungle-test
Tests Include:
- ✅ Health check
- ✅ Authentication (valid/invalid)
- ✅ Server listing (per role)
- ✅ Role information
- ✅ Tool listing
- ✅ Authorization checks
- ✅ Metrics collection
Health Check
make mcpjungle-health
Common Commands
# Start everything
make mcpjungle
# Check health
make mcpjungle-health
# Run tests
make mcpjungle-test
# View logs
make mcpjungle-logs
# Stop services
make mcpjungle-stop
# Open Jaeger UI
make jaeger-ui
# Rebuild
make mcpjungle-build
Production Deployment
Security Checklist
- Change default API keys to secure random values
- Set strong GITHUB_TOKEN and NOTION_API_KEY
- Use secrets manager for credentials (not .env)
- Deploy behind HTTPS reverse proxy
- Configure CORS for specific origins
- Enable rate limiting monitoring
- Configure filesystem allowed_paths
- Set up log aggregation
- Enable backup for Redis and Jaeger data
- Configure alerting for errors and rate limits
Environment Variables
Required in production:
GITHUB_TOKEN- GitHub Personal Access TokenNOTION_API_KEY- Notion Integration SecretAPI_KEYS- Comma-separated secure API keysENABLE_TELEMETRY=true- Enable tracingOTLP_ENDPOINT- OpenTelemetry collectorJAEGER_ENDPOINT- Jaeger agent endpoint
Documentation
Comprehensive documentation available:
-
MCPJUNGLE_README.md- Complete guide (1000+ lines)- Architecture overview
- API reference with examples
- Role-based access control
- OpenTelemetry tracing
- Security best practices
- Troubleshooting
-
MCPJUNGLE_QUICKSTART.md- 5-minute quick start- Step-by-step setup
- Testing examples
- Common commands
- Troubleshooting tips
-
MCPJUNGLE_IMPLEMENTATION.md- Technical details- File descriptions
- Architecture details
- Feature summary
- Performance targets
-
API Documentation - Interactive docs at http://localhost:9100/docs
Support
Viewing Logs
# Gateway logs
docker compose logs mcpjungle-gateway
# All services
docker compose logs -f
# Jaeger logs
docker compose logs jaeger
Troubleshooting
MCP servers not connecting?
- Check Node.js is installed:
docker compose exec mcpjungle-gateway node --version - Verify credentials are set (GITHUB_TOKEN, NOTION_API_KEY)
- Check logs:
docker compose logs mcpjungle-gateway | grep -i mcp
Authentication errors?
- Verify API key format:
Bearer sk-xxx - Check key exists in API_KEYS environment variable
Permission denied?
- Check your role:
GET /mcp/acl/role - Verify role has permission in
configs/mcp-acl.yaml
Next Steps
- Configure Credentials: Set GITHUB_TOKEN and NOTION_API_KEY
- Customize Roles: Edit ACL configuration for your needs
- Test Integration: Run test suite to verify setup
- Build Agents: Create AI agents using MCP endpoints
- Monitor: Use Jaeger UI to track performance
- Scale: Add more MCP servers as needed
Success Criteria ✅
All requirements have been met:
- ✅ Authentication Enabled: API key-based auth with Bearer tokens
- ✅ OpenTelemetry Tracing: Full Jaeger integration with UI
- ✅
/mcpEndpoint: Complete MCP protocol implementation - ✅ First MCP Servers: GitHub, Notion, Filesystem registered
- ✅ ACL Configurations: 5 roles with fine-grained permissions
- ✅ Rate Limiting: Redis-backed per-role limits
- ✅ Comprehensive Docs: 3 documentation files
- ✅ Test Suite: Full test coverage
- ✅ Docker Deployment: Production-ready containers
Deployment Status
Status: ✅ READY FOR DEPLOYMENT
The MCPJungle Gateway is fully implemented and ready to deploy. All code, configuration, documentation, and tests are complete.
To get started:
make mcpjungle
Implementation Complete! 🎉
The MCPJungle Gateway is ready to power your MCP-enabled AI applications with secure, observable, and scalable access to GitHub, Notion, and filesystem resources.
What's inside
17 sections including architecture, API endpoints, configuration, testing, and a production security checklist.
Change this for your project
- Replace
sk-test-key-123,sk-admin-key-456,sk-dev-key-789with your own API keys - Replace
ghp_your_token_hereandsecret_your_key_herewith your actual tokens - Replace
mcpjungle-gatewayandMCPJunglewith your own service name throughout
Where it goes
Keep with your observability configuration. Describes what to track and alert on.
Worth borrowing
- Separating ACL configuration into a dedicated YAML file (
mcp-acl.yaml) for role-based permissions - Providing a production security checklist as a concrete list of actions, not generic advice
- Including both Python and cURL examples for every major API endpoint
Related Documents
youtube
Lists 39 YouTube videos scraped from a Hacker News thread, each with a thumbnail, link, and description excerpt.
Evaluation and Observability
Defines evaluation methodology, monitoring signals, and feedback loops for LLM applications in production.
🚀 Lovable AI & Cloud - Complete Setup Guide
Guides developers through setting up Lovable AI and Cloud, from account creation to production deployment and real-world implementations.
LLM Judge — Setup & Operations
Explains how to enable and configure a three-tier LLM judge cascade for prompt-injection detection, with shadow-mode rollout and golden-set calibration.