MCP Gateway for unified tool aggregation and request routing across multiple MCP servers
Project description
chora-gateway
MCP Gateway for unified tool aggregation and request routing across multiple MCP servers.
Features
- Tool Aggregation: Discover and aggregate tools from multiple MCP servers
- Request Routing: Route MCP requests to appropriate backend servers
- Service Discovery: Integration with chora-manifest for automatic server discovery
- Unified Endpoint: Single MCP endpoint exposing all available tools
- Health Monitoring: Track health status of all registered MCP servers
- Multi-Interface Support: Native API, CLI, REST API, and MCP server modes
Installation
From PyPI (Recommended)
pip install chora-gateway
From Source (Development)
git clone https://github.com/liminalcommons/chora-gateway.git
cd chora-gateway
poetry install
Quick Start
1. Native API (Python Library)
from chora_gateway import Gateway
# Initialize gateway with manifest integration
gateway = Gateway(manifest_url="http://localhost:8081")
# List all available tools
tools = gateway.list_tools()
# Route a tool invocation
result = gateway.invoke_tool("manifest.list_servers", {})
2. CLI (Command-Line Interface)
# Start gateway server
chora-gateway serve --port 8080
# List all aggregated tools
chora-gateway list-tools
# Check gateway health
chora-gateway health
3. REST API (HTTP Server)
# Start HTTP server
chora-gateway serve --mode http --port 8080
# Query tools via HTTP
curl http://localhost:8080/tools
# Invoke tool via HTTP
curl -X POST http://localhost:8080/tools/invoke \
-H "Content-Type: application/json" \
-d '{"tool": "manifest.list_servers", "arguments": {}}'
4. MCP Server (AI Agent Integration)
# Start MCP stdio server (for Cline, Claude Desktop)
chora-gateway serve --mode mcp-stdio
# Or start MCP HTTP server
chora-gateway serve --mode mcp-http --port 8080
Architecture
┌─────────────────────────────────────────────┐
│ AI Client (Claude, Cline) │
└──────────────────┬──────────────────────────┘
│ MCP Protocol
┌─────────▼──────────┐
│ chora-gateway │
│ (Unified MCP) │
└────────┬───────────┘
│
┌───────────┼────────────┐
│ │ │
┌───▼───┐ ┌──▼───┐ ┌──▼─────┐
│Manifest│ │ n8n │ │ GitHub │
│Server │ │Server│ │ Server │
└────────┘ └──────┘ └────────┘
Configuration
The gateway can be configured via:
- Environment variables:
CHORA_GATEWAY_* - Configuration file:
~/.chora/gateway.yaml - CLI arguments:
--manifest-url,--port, etc.
Example configuration file:
# ~/.chora/gateway.yaml
manifest_url: http://localhost:8081
port: 8080
log_level: INFO
health_check_interval: 30
Documentation
Development
Setup
# Clone repository
git clone https://github.com/liminalcommons/chora-gateway.git
cd chora-gateway
# Install dependencies
poetry install
# Run tests
poetry run pytest
# Run with coverage
poetry run pytest --cov
Running Locally
# Start gateway server (requires manifest server running)
poetry run chora-gateway serve --port 8080
Contributing
See CONTRIBUTING.md for contribution guidelines.
License
MIT
Related Projects
- chora-manifest - MCP server registry and discovery
- chora-orchestration - Docker orchestration for MCP servers
- chora-base - Shared adoption patterns (SAPs)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chora_gateway-0.1.0.tar.gz
(10.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chora_gateway-0.1.0.tar.gz.
File metadata
- Download URL: chora_gateway-0.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.0 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
729ef922896a2b8115484503a9641fb36f88f3fe3b1e055b28652227598a3a13
|
|
| MD5 |
731481c2e9c39c2cfed38fee48285896
|
|
| BLAKE2b-256 |
42ae4bc284528bd95dca70a35a033fb6d01a7957aa89efd22589528298fb08fd
|
File details
Details for the file chora_gateway-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chora_gateway-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.0 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f4818f0d5a203681976a0c20b0fc037f633ff80b75ab754e276a617269760d9
|
|
| MD5 |
dd09d200e8c6e89c2adf8356c07e33df
|
|
| BLAKE2b-256 |
b4e510bb7d130ee8706ea78daeafc8af722166f5d728a0f83357e8fedc753850
|