经 AI Skill Hub 精选评估,mcp-context-forge MCP工具 获评「强烈推荐」。已获得 3.7k 颗 GitHub Star,这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.2 分,适合有一定技术背景的用户使用。
mcp-context-forge MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
mcp-context-forge MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/IBM/mcp-context-forge
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"mcp-context-forge-mcp--": {
"command": "npx",
"args": ["-y", "mcp-context-forge"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 mcp-context-forge MCP工具 执行以下任务... Claude: [自动调用 mcp-context-forge MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"mcp-context-forge_mcp__": {
"command": "npx",
"args": ["-y", "mcp-context-forge"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
An open source registry and proxy that federates MCP, A2A, and REST/gRPC APIs with centralized governance, discovery, and observability. Optimizes Agent & Tool calling, and supports plugins.

ContextForge is an open source registry and proxy that federates tools, agents, and APIs into one clean endpoint for your AI clients. It provides centralized governance, discovery, and observability across your AI infrastructure:
It runs as a fully compliant MCP server, deployable via PyPI or Docker, and scales to multi-cluster environments on Kubernetes with Redis-backed federation and caching.
ContextForge is an open source registry and proxy that federates any Model Context Protocol (MCP) server, A2A server, or REST/gRPC API, providing centralized governance, discovery, and observability. It optimizes agent and tool calling, and supports plugins. See the project roadmap for more details.
It currently supports:
For a list of upcoming features, check out the ContextForge Roadmap
---
<details> <summary><strong>🔌 Gateway Layer with Protocol Flexibility</strong></summary>
2025-11-25)</details>
<details> <summary><strong>🧩 Virtualization of REST/gRPC Services</strong></summary>
</details>
<details> <summary><strong>🔁 REST-to-MCP Tool Adapter</strong></summary>
</details>
<details> <summary><strong>🧠 Unified Registries</strong></summary>
</details>
<details> <summary><strong>📈 Admin UI, Observability & Dev Experience</strong></summary>
</details>
<details> <summary><strong>🔍 OpenTelemetry Observability</strong></summary>
See Observability Documentation for setup guides with Phoenix, Jaeger, and other backends.
</details>
---
Connection URL format:bash DATABASE_URL=postgresql+psycopg://user:password@localhost:5432/mcp
Quick Postgres container:bash docker run --name mcp-postgres \ -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=mysecretpassword \ -e POSTGRES_DB=mcp -p 5432:5432 -d postgres ```
</details>
---
```bash
mkdir mcpgateway && cd mcpgateway python3 -m venv .venv && source .venv/bin/activate pip install --upgrade pip pip install mcp-contextforge-gateway
mkdir mcpgateway ; cd mcpgateway python3 -m venv .venv ; .\.venv\Scripts\Activate.ps1 pip install --upgrade pip pip install mcp-contextforge-gateway
mkdir mcpgateway ; cd mcpgateway uv venv .\.venv\Scripts\activate uv pip install mcp-contextforge-gateway
python3 -m mcpgateway.translate \ --stdio "docker run --rm -i ghcr.io/ibm/fast-time-server:latest -transport=stdio" \ --expose-sse \ --port 8003
Get a full stack running with PostgreSQL and Redis in under 30 seconds:
```bash
helm install mcp-gateway . \ --set mcpContextForge.secret.PLATFORM_ADMIN_EMAIL=admin@yourcompany.com \ --set mcpContextForge.secret.PLATFORM_ADMIN_PASSWORD=changeme \ --set mcpContextForge.secret.JWT_SECRET_KEY=your-secret-key
kubectl get pods -l app.kubernetes.io/name=mcp-context-forge
```bash docker run -d --name mcpgateway \ -p 4444:4444 \ -e MCPGATEWAY_UI_ENABLED=true \ -e MCPGATEWAY_ADMIN_API_ENABLED=true \ -e HOST=0.0.0.0 \ -e JWT_SECRET_KEY=my-test-key-but-now-longer-than-32-bytes \ -e AUTH_REQUIRED=true \ -e PLATFORM_ADMIN_EMAIL=admin@example.com \ -e PLATFORM_ADMIN_PASSWORD=changeme \ -e PLATFORM_ADMIN_FULL_NAME="Platform Administrator" \ -e DATABASE_URL=sqlite:///./mcp.db \ -e SECURE_COOKIES=false \ ghcr.io/ibm/mcp-context-forge:1.0.0-RC-3
make venv install-dev # create .venv + install deps + build Admin UI
make serve # gunicorn on :4444
Rust workspace note: - Workspace-owned Rust crates live under crates/ and are picked up by the root Cargo.toml via crates/*. - Run cargo build, cargo test, and cargo check from the repo root to cover the shared workspace. - mcp-servers/rust/ stays outside the shared workspace on purpose and is managed separately. - make venv install-dev creates the root .venv, which is also reused by the workspace's PyO3/maturin builds.
<details> <summary><strong>Alternative: UV or pip</strong></summary>
```bash
uv pip install 'psycopg[binary]' # dev (pre-built wheels)
These values differ from code defaults to provide a working local/dev setup:
| Variable | Description | Default |
|---|---|---|
HOST | Bind address | 0.0.0.0 |
MCPGATEWAY_UI_ENABLED | Enable Admin UI dashboard | true |
MCPGATEWAY_ADMIN_API_ENABLED | Enable Admin API endpoints | true |
DATABASE_URL | SQLAlchemy connection URL | sqlite:///./mcp.db |
SECURE_COOKIES | Set false for HTTP (non-HTTPS) dev | false |
make compose-up # Start full stack: PostgreSQL, Redis, 3 gateway replicas, Nginx on :8080
make compose-sso # Start SSO stack with Keycloak on :8180
make sso-test-login # Run SSO smoke checks (providers + login URL + test users)
make compose-logs # Tail logs from all services
make compose-down # Stop the stack
ContextForge can be deployed to any major cloud platform:
| Platform | Guide |
|---|---|
| **AWS** | [ECS/EKS Deployment](https://ibm.github.io/mcp-context-forge/deployment/aws/) |
| **Azure** | [AKS Deployment](https://ibm.github.io/mcp-context-forge/deployment/azure/) |
| **Google Cloud** | [Cloud Run](https://ibm.github.io/mcp-context-forge/deployment/google-cloud-run/) |
| **IBM Cloud** | [Code Engine](https://ibm.github.io/mcp-context-forge/deployment/ibm-code-engine/) |
| **Kubernetes** | [Helm Charts](https://ibm.github.io/mcp-context-forge/deployment/minikube/) |
| **OpenShift** | [OpenShift Deployment](https://ibm.github.io/mcp-context-forge/deployment/openshift/) |
For comprehensive deployment guides, see Deployment Documentation.
---
ContextForge is published on PyPI as mcp-contextforge-gateway.
---
TLDR;: (single command using uv)
```bash
BASIC_AUTH_PASSWORD=pass \ MCPGATEWAY_UI_ENABLED=true \ MCPGATEWAY_ADMIN_API_ENABLED=true \ PLATFORM_ADMIN_EMAIL=admin@example.com \ PLATFORM_ADMIN_PASSWORD=changeme \ PLATFORM_ADMIN_FULL_NAME="Platform Administrator" \ uvx --from mcp-contextforge-gateway mcpgateway --host 0.0.0.0 --port 4444
cp .env.example .env
curl -O https://raw.githubusercontent.com/IBM/mcp-context-forge/main/.env.example cp .env.example .env
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/IBM/mcp-context-forge/main/.env.example" -OutFile ".env.example" Copy-Item .env.example .env
curl -s -X POST -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"server":{"name":"time_server","description":"Fast time tools","associated_tools":["6018ca46d32a4ac6b4c054c13a1726a2"]}}' \ http://localhost:4444/servers | jq
Use the official OCI image from GHCR with Docker or Podman. Please note: Currently, arm64 is not supported on production. If you are e.g. running on MacOS with Apple Silicon chips (M1, M2, etc), you can run the containers using Rosetta or install via PyPi instead.
Deploy to Kubernetes with enterprise-grade features:
```bash
uvx --from mcp-contextforge-gateway mcpgateway --host 0.0.0.0 --port 4444 ```
<details> <summary><strong>📋 Prerequisites</strong></summary>
</details>
export MCPGATEWAY_UI_ENABLED=true export MCPGATEWAY_ADMIN_API_ENABLED=true export PLATFORM_ADMIN_EMAIL=admin@example.com export PLATFORM_ADMIN_PASSWORD=changeme export PLATFORM_ADMIN_FULL_NAME="Platform Administrator"
BASIC_AUTH_PASSWORD=pass JWT_SECRET_KEY=my-test-key-but-now-longer-than-32-bytes \ mcpgateway --host 0.0.0.0 --port 4444 & # admin/pass
$Env:MCPGATEWAY_UI_ENABLED = "true" $Env:MCPGATEWAY_ADMIN_API_ENABLED = "true"
export MCPGATEWAY_BEARER_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token --username admin@example.com --exp 10080 --secret my-test-key-but-now-longer-than-32-bytes) export MCP_AUTH="Bearer ${MCPGATEWAY_BEARER_TOKEN}" export MCP_SERVER_URL='http://localhost:4444/servers/UUID_OF_SERVER_1/mcp' export MCP_TOOL_CALL_TIMEOUT=120 export MCP_WRAPPER_LOG_LEVEL=DEBUG # or OFF to disable logging
docker run --rm -i \ -e MCP_AUTH=$MCP_AUTH \ -e MCP_SERVER_URL=http://host.docker.internal:4444/servers/UUID_OF_SERVER_1/mcp \ -e MCP_TOOL_CALL_TIMEOUT=120 \ -e MCP_WRAPPER_LOG_LEVEL=DEBUG \ ghcr.io/ibm/mcp-context-forge:1.0.0-RC-3 \ python3 -m mcpgateway.wrapper ```
</details>
---
⚠️ If any required .env variable is missing or invalid, the gateway will fail fast at startup with a validation error via Pydantic.
Copy the provided .env.example to .env and update the security-sensitive values below.
For the complete list of 300+ environment variables organized by category (authentication, caching, SSO, observability, etc.), see the Configuration Reference.
---
export MCPGATEWAY_BEARER_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token \ --username admin@example.com --exp 10080 --secret my-test-key-but-now-longer-than-32-bytes)
curl -s -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" \ http://127.0.0.1:4444/version | jq
<details>
<summary><strong>Windows (PowerShell) quick-start</strong></summary>
powershell
$Env:JWT_SECRET_KEY = "my-test-key-but-now-longer-than-32-bytes" $Env:PLATFORM_ADMIN_EMAIL = "admin@example.com" $Env:PLATFORM_ADMIN_PASSWORD = "changeme" $Env:PLATFORM_ADMIN_FULL_NAME = "Platform Administrator"
npx -y @modelcontextprotocol/inspector
docker compose exec gateway python3 -m mcpgateway.utils.create_jwt_token \ --username admin@example.com --exp 10080 --secret my-test-key-but-now-longer-than-32-bytes
**What you get:**
- 🗄️ **PostgreSQL** - Production-ready database with 55+ tables
- 🚀 **ContextForge** - Full-featured gateway with Admin UI
- 📊 **Redis** - High-performance caching and session storage
- 🔧 **Admin Tools** - pgAdmin, Redis Insight for database management
- 🌐 **Nginx Proxy** - Caching reverse proxy on port 8080
**Enable HTTPS (optional):**bash
kubectl exec deployment/mcp-gateway-mcp-context-forge -- \ python3 -m mcpgateway.utils.create_jwt_token \ --username admin@yourcompany.com --exp 10080 --secret your-secret-key ```
SSRF note: Helm defaults to strict SSRF settings (SSRF_ALLOW_PRIVATE_NETWORKS=false). If you register in-cluster tool URLs (for example fast-time or fast-test services), allow only your cluster CIDRs viamcpContextForge.config.SSRF_ALLOWED_NETWORKSor, for local-only benchmark setups, temporarily setSSRF_ALLOW_PRIVATE_NETWORKS=true. Seedocs/docs/manage/configuration.md#ssrf-protectionanddocs/docs/deployment/helm.md.
Enterprise Features: - 🔄 Auto-scaling - HPA with CPU/memory targets - 🗄️ Database Choice - PostgreSQL (prod), SQLite (dev) - 📊 Observability - Prometheus metrics, OpenTelemetry tracing - 🔒 Security - RBAC, network policies, secret management - 🚀 High Availability - Multi-replica deployments with Redis clustering - 📈 Monitoring - Built-in Grafana dashboards and alerting
---
docker logs -f mcpgateway docker run --rm -it ghcr.io/ibm/mcp-context-forge:1.0.0-RC-3 \ python3 -m mcpgateway.utils.create_jwt_token --username admin@example.com --exp 10080 --secret my-test-key-but-now-longer-than-32-bytes
Browse to **[http://localhost:4444/admin](http://localhost:4444/admin)** and login with `PLATFORM_ADMIN_EMAIL` / `PLATFORM_ADMIN_PASSWORD`.
<details>
<summary><strong>Advanced: Persistent storage, host networking, airgapped</strong></summary>
**Persist SQLite database:**bash mkdir -p $(pwd)/data && touch $(pwd)/data/mcp.db && chmod 777 $(pwd)/data docker run -d --name mcpgateway --restart unless-stopped \ -p 4444:4444 -v $(pwd)/data:/data \ -e DATABASE_URL=sqlite:////data/mcp.db \ -e MCPGATEWAY_UI_ENABLED=true -e MCPGATEWAY_ADMIN_API_ENABLED=true \ -e HOST=0.0.0.0 -e JWT_SECRET_KEY=my-test-key-but-now-longer-than-32-bytes \ -e PLATFORM_ADMIN_EMAIL=admin@example.com -e PLATFORM_ADMIN_PASSWORD=changeme \ ghcr.io/ibm/mcp-context-forge:1.0.0-RC-3
**Host networking** (access local MCP servers):bash docker run -d --name mcpgateway --network=host \ -v $(pwd)/data:/data -e DATABASE_URL=sqlite:////data/mcp.db \ -e MCPGATEWAY_UI_ENABLED=true -e HOST=0.0.0.0 -e PORT=4444 \ ghcr.io/ibm/mcp-context-forge:1.0.0-RC-3
**Airgapped deployment** (no internet):bash docker build -f Containerfile.lite -t mcpgateway:airgapped . docker run -d --name mcpgateway -p 4444:4444 \ -e MCPGATEWAY_UI_AIRGAPPED=true -e MCPGATEWAY_UI_ENABLED=true \ -e HOST=0.0.0.0 -e JWT_SECRET_KEY=my-test-key-but-now-longer-than-32-bytes \ mcpgateway:airgapped ```
</details>
---
| Command | Server | Port | Database | Use Case |
|---|---|---|---|---|
make dev | Uvicorn | **8000** | SQLite | Development (single instance, auto-reload) |
make serve | Gunicorn | **4444** | SQLite | Production single-node (multi-worker) |
make serve-ssl | Gunicorn | **4444** | SQLite | Production single-node with HTTPS |
make compose-up | Docker Compose + Nginx | **8080** | PostgreSQL + Redis | Full stack (3 replicas, load-balanced) |
make compose-sso | Docker Compose + Keycloak | **8080 / 8180** | PostgreSQL + Redis | Local SSO testing (Keycloak profile) |
make testing-up | Docker Compose + Nginx | **8080** | PostgreSQL + Redis | Testing environment |
Interactive API documentation is available when the server is running:
Quick Authentication: ```bash
curl -H "Authorization: Bearer $TOKEN" http://localhost:4444/health ```
For comprehensive curl examples covering all endpoints, see the API Usage Guide.
---
Clone the repo and open in VS Code—it will detect .devcontainer and prompt to "Reopen in Container". The container includes Python 3.11, Docker CLI, and all project dependencies.
For detailed setup, workflows, and GitHub Codespaces instructions, see Developer Onboarding.
---
Common issues and solutions:
| Issue | Quick Fix |
|---|---|
| SQLite "disk I/O error" on macOS | Avoid iCloud-synced directories; use ~/mcp-context-forge/data |
| Port 4444 not accessible on WSL2 | Configure WSL integration in Docker Desktop |
| Gateway exits immediately | Copy .env.example to .env and configure required vars |
ModuleNotFoundError | Run make install-dev |
For detailed troubleshooting guides, see Troubleshooting Documentation.
---
ContextForge 是一个开源的注册表和代理,通过中央治理、发现和可观察性来联合 MCP 服务器、A2A 服务器或 REST/gRPC API。它优化了代理和工具的调用,并支持插件。
首先安装系统依赖项
安装和运行(copy-paste 友好的)
快速入门 - PyPI
编辑 .env 来自定义您的设置
3️⃣ 生成一个令牌并测试 API
功能完整的MCP生态工具,解决多协议聚合和网关问题,社区活跃(3.7k星),Python生态友好,是构建AI基础设施的重要选择。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
AI Skill Hub 点评:mcp-context-forge MCP工具 的核心功能完整,质量优秀。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | mcp-context-forge |
| 原始描述 | 开源MCP工具:An AI Gateway, registry, and proxy that sits in front of any MCP, A2A, or REST/g。⭐3.7k · Python |
| Topics | MCP网关API代理AI基础设施异步处理认证中间件 |
| GitHub | https://github.com/IBM/mcp-context-forge |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-05-14 · 更新时间:2026-05-16 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端