|
1 |
| -# Features |
| 1 | +# ✨ Features Overview |
2 | 2 |
|
3 |
| -MCP Gateway offers a robust feature set for integrating and managing tools, servers, prompts, and resources under the Model Context Protocol. |
| 3 | +MCP Gateway is a **gateway + registry + proxy** purpose-built for the **Model Context Protocol (MCP)**. It unifies REST, MCP, and stdio worlds while |
| 4 | +adding auth, caching, federation, and an HTMX-powered Admin UI. |
4 | 5 |
|
5 |
| ---- |
6 | 6 |
|
7 |
| -## 🧠 Core Capabilities |
| 7 | +--- |
8 | 8 |
|
9 |
| -- **Full MCP 2025-03-26 Protocol Support** |
10 |
| - Implements all required methods: `initialize`, `ping`, `notify`, `complete`, `createMessage`, and fallback JSON-RPC. |
| 9 | +## 🌐 Multi-Transport Core |
11 | 10 |
|
12 |
| -- **Multi-Transport Support** |
13 |
| - Accessible via: |
| 11 | +???+ abstract "Supported Transports" |
14 | 12 |
|
15 |
| - - HTTP/JSON-RPC |
16 |
| - - WebSocket (bi-directional with ping/pong) |
17 |
| - - Server-Sent Events (SSE) |
18 |
| - - stdio (for subprocess embedding) |
| 13 | + | Transport | Description | Typical Use-case | |
| 14 | + |-----------|-------------|------------------| |
| 15 | + | **HTTP / JSON-RPC** | Low-latency request-response, default for most REST clients | Simple tool invocations | |
| 16 | + | **WebSocket** | Bi-directional, full-duplex | Streaming chat or incremental tool results | |
| 17 | + | **Server-Sent Events (SSE)** | Uni-directional server → client stream | LLM completions or real-time updates | |
| 18 | + | **STDIO** | Local process pipes via `mcpgateway-wrapper` | Editor plugins, headless CLI clients | |
19 | 19 |
|
20 |
| -- **Unified Registry** |
21 |
| - Maintains a centralized catalog of: |
| 20 | +??? example "Try it: SSE from curl" |
22 | 21 |
|
23 |
| - - Tools (native or REST-adapted) |
24 |
| - - Prompts (Jinja2 templates with schema validation) |
25 |
| - - Resources (MIME-aware, URI-addressable) |
26 |
| - - Servers (virtual or federated) |
27 |
| - - Federated Gateways |
| 22 | + ```bash |
| 23 | + curl -N -H "Accept: text/event-stream" \ |
| 24 | + -H "Authorization: Bearer $TOKEN" \ |
| 25 | + http://localhost:4444/servers/1/sse |
| 26 | + ``` |
28 | 27 |
|
29 | 28 | ---
|
30 | 29 |
|
31 |
| -## 🌐 Federation & Discovery |
| 30 | +## 🌍 Federation & Discovery |
| 31 | + |
| 32 | +??? summary "Features" |
| 33 | + |
| 34 | + * **Auto-discovery** – DNS-SD (`_mcp._tcp.local.`) or static peer list |
| 35 | + * **Health checks** – fail-over + removal of unhealthy gateways |
| 36 | + * **Capability sync** – merges remote tool catalogs into the local DB |
| 37 | + * **Request forwarding** – automatic routing to the correct gateway |
| 38 | + |
| 39 | +??? diagram "Architecture" |
| 40 | + |
| 41 | + ```mermaid |
| 42 | + graph TD |
| 43 | + subgraph Local_Gateway |
| 44 | + A[MCP Gateway Core] |
| 45 | + end |
| 46 | + subgraph Remote_Gateway_1 |
| 47 | + B[Peer 1] |
| 48 | + end |
| 49 | + subgraph Remote_Gateway_2 |
| 50 | + C[Peer 2] |
| 51 | + end |
| 52 | + A <-- ping / register --> B |
| 53 | + A <-- ping / register --> C |
| 54 | + ``` |
32 | 55 |
|
33 |
| -- Peer discovery (mDNS or explicit list) |
34 |
| -- Periodic health checks with failover logic |
35 |
| -- Transparent merging of capabilities |
36 |
| -- Federation timeouts, retries, and sync intervals configurable |
| 56 | +??? note "Configuration" |
| 57 | + |
| 58 | + Enable or tweak discovery via `.env`: |
| 59 | + |
| 60 | + ```env |
| 61 | + FEDERATION_ENABLED=true |
| 62 | + FEDERATION_DISCOVERY=true |
| 63 | + FEDERATION_PEERS=https://remote.example.com |
| 64 | + HEALTH_CHECK_INTERVAL=30 |
| 65 | + ``` |
37 | 66 |
|
38 | 67 | ---
|
39 | 68 |
|
40 |
| -## 🛠 Tool Management |
| 69 | +## 🔐 Security |
| 70 | + |
| 71 | +??? tip "Auth mechanisms" |
| 72 | + |
| 73 | + * **JWT bearer** (default, signed with `JWT_SECRET_KEY`) |
| 74 | + * **HTTP Basic** for the Admin UI |
| 75 | + * **Custom headers** (e.g., API keys) per tool or gateway |
| 76 | + |
| 77 | +??? info "Rate limiting" |
41 | 78 |
|
42 |
| -- Register tools via REST, UI, or JSON-RPC |
43 |
| -- Wrap any REST API, CLI command, or function |
44 |
| -- Supports: |
| 79 | + Set `MAX_TOOL_CALLS_PER_MINUTE` to throttle abusive clients. |
| 80 | + Exceeding the limit returns **HTTP 429** with a `Retry-After` header. |
45 | 81 |
|
46 |
| - - JSON Schema validation |
47 |
| - - Concurrency limits |
48 |
| - - Rate limiting |
49 |
| - - Retry policies |
50 |
| - - Output filtering via JSONPath |
| 82 | +??? example "Generate a 24 h token" |
| 83 | + |
| 84 | + ```bash |
| 85 | + python -m mcpgateway.utils.create_jwt_token \ |
| 86 | + --username alice --exp 1440 --secret "$JWT_SECRET_KEY" |
| 87 | + ``` |
51 | 88 |
|
52 | 89 | ---
|
53 | 90 |
|
54 |
| -## 💬 Prompt Templates |
| 91 | +## 🛠 Tool & Server Registry |
| 92 | + |
| 93 | +??? success "What you can register" |
| 94 | + |
| 95 | + | Registry | Entities | Notes | |
| 96 | + |----------|----------|-------| |
| 97 | + | **Tools** | Native MCP tools or wrapped REST / CLI functions | JSON Schema input validation | |
| 98 | + | **Resources** | URIs for blobs, text, images | Optional SSE change notifications | |
| 99 | + | **Prompts** | Jinja2 templates + multimodal content | Versioning & rollback | |
| 100 | + | **Servers** | Virtual collections of tools/prompts/resources | Exposed as full MCP servers | |
55 | 101 |
|
56 |
| -- Jinja2-powered text blocks |
57 |
| -- Enforced schema (required/optional args) |
58 |
| -- Versioned templates with rollback |
59 |
| -- Used by agents and sampling calls |
| 102 | +??? code "REST tool example" |
| 103 | + |
| 104 | + ```bash |
| 105 | + curl -X POST -H "Authorization: Bearer $TOKEN" \ |
| 106 | + -H "Content-Type: application/json" \ |
| 107 | + -d '{ |
| 108 | + "name": "joke_api", |
| 109 | + "url": "https://icanhazdadjoke.com/", |
| 110 | + "requestType": "GET", |
| 111 | + "integrationType": "REST", |
| 112 | + "headers": {"Accept":"application/json"} |
| 113 | + }' \ |
| 114 | + http://localhost:4444/tools |
| 115 | + ``` |
60 | 116 |
|
61 | 117 | ---
|
62 | 118 |
|
63 |
| -## 📦 Resource Handling |
| 119 | +## 🖥 Admin UI |
| 120 | + |
| 121 | +??? abstract "Built with" |
64 | 122 |
|
65 |
| -- URI-addressed resources |
66 |
| -- MIME type detection |
67 |
| -- LRU+TTL caching (in-memory, Redis, or DB) |
68 |
| -- SSE-based subscriptions to dynamic resources |
| 123 | + * **FastAPI** + Jinja2 + HTMX + Alpine.js |
| 124 | + * Tailwind CSS for styling |
69 | 125 |
|
70 | 126 | ---
|
71 | 127 |
|
72 |
| -## 📊 Observability |
| 128 | +## 🗄 Persistence, Caching & Observability |
| 129 | + |
| 130 | +??? info "Storage options" |
73 | 131 |
|
74 |
| -- Structured JSON logs |
75 |
| -- Log levels per route |
76 |
| -- `/health` endpoint with live latency stats |
77 |
| -- Metrics for tools, servers, prompts, and gateways |
| 132 | + * **SQLite** (default dev) |
| 133 | + * **PostgreSQL**, **MySQL/MariaDB**, **MongoDB** — via `DATABASE_URL` |
| 134 | + |
| 135 | +??? example "Redis cache" |
| 136 | + |
| 137 | + ```env |
| 138 | + CACHE_TYPE=redis |
| 139 | + REDIS_URL=redis://localhost:6379/0 |
| 140 | + ``` |
| 141 | + |
| 142 | +??? abstract "Observability" |
| 143 | + |
| 144 | + * Structured JSON logs (tap with `jq`) |
| 145 | + * `/metrics` – Prometheus-friendly counters (`tool_calls_total`, `gateway_up`) |
| 146 | + * `/health` – readiness + dependency checks |
78 | 147 |
|
79 | 148 | ---
|
80 | 149 |
|
81 |
| -## 🖥 Admin Interface |
| 150 | +## 🧩 Dev & Extensibility |
82 | 151 |
|
83 |
| -- Interactive UI with full CRUD for: |
| 152 | +??? summary "Highlights" |
84 | 153 |
|
85 |
| - - Tools |
86 |
| - - Resources |
87 |
| - - Prompts |
88 |
| - - Servers |
89 |
| - - Gateways |
90 |
| - - Roots |
91 |
| -- Built with HTMX, Alpine.js, and Tailwind CSS |
| 154 | + * **Makefile targets** – `make dev`, `make test`, `make lint` |
| 155 | + * **400+ unit tests** – Pytest + HTTPX TestClient |
| 156 | + * **VS Code Dev Container** – Python 3.11 + Docker/Podman CLI |
| 157 | + * **Plug-in friendly** – drop-in FastAPI routers or Pydantic models |
92 | 158 |
|
93 | 159 | ---
|
94 | 160 |
|
95 |
| -## 🔐 Authentication & Security |
| 161 | +## Next Steps |
| 162 | + |
| 163 | +* **Hands-on Walk-through** → [Quick Start](quick_start.md) |
| 164 | +* **Deployment Guides** → [Compose](../deployment/compose.md), [K8s & Cloud](../deployment/index.md) |
| 165 | +* **Admin UI deep dive** → [UI Guide](ui.md) |
96 | 166 |
|
97 |
| -- Supports both Basic and JWT authentication |
98 |
| -- Bearer tokens signed with configurable secrets |
99 |
| -- TLS verification options |
100 |
| -- Optional anonymous/public mode (`AUTH_REQUIRED=false`) |
| 167 | +!!! success "Ready to explore" |
| 168 | + With transports, federation, and security handled for you, focus on building great **MCP tools, prompts, and agents**—the gateway has your back. |
0 commit comments