mcp-context-forge

IBMApache-2.0活跃维护

统一接入 MCP、A2A 和 REST/gRPC 的 AI 网关与注册中心,集中做服务发现、鉴权和调用管控,优化 Agent 与工具调用。

An AI Gateway, registry, and proxy that sits in front of any MCP, A2A, or REST/gRPC APIs, exposing a unified endpoint with centralized discovery, guardrails and management. Optimizes Agent & Tool calling, and supports plugins.

v1.1.0发布于 2026-10-20 17:31 UTC4,788star +19 / 7 天964fork同步于 2026-11-10 11:37 UTC

怎么上手

由 README 提炼,执行前请确认
python3 -m mcpgateway.scripts.init_secrets
uvx --from mcp-contextforge-gateway mcpgateway --host 0.0.0.0 --port 4444
硬件要求按 README 说明

README 未说明显存或 GPU 要求,仅要求 Python ≥ 3.11,可通过 PyPI 或 Docker 部署。

支持 Apple Silicon有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把 MCP、A2A 和 REST/gRPC 服务统一成一个端点,集中做发现、治理和可观测

统一接入 MCP、A2A 和 REST/gRPC 的 AI 网关与注册中心,集中做服务发现、鉴权和调用管控,优化 Agent 与工具调用。

核心能力

  • 联邦多个 MCP 与 REST 服务并暴露统一端点
  • 将 REST/gRPC 服务虚拟化为 MCP 工具与服务器
  • 内置认证、重试与限流并支持用户级 OAuth 令牌
  • 用 OpenTelemetry 接入 Phoenix、Jaeger、Zipkin
  • 提供 Admin UI 与独立 Web UI 实时管理配置

容易踩的坑

JWT_SECRET_KEY 和 AUTH_ENCRYPTION_SECRET 必须先生成并设置,否则网关无法启动;需先下载 .env.example 并生成密钥再启动;Web UI 运行在单独容器中,需额外部署。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.1.0
  1. v1.1.0v1.1.0 - Release 2026-10-20 - Modern MCP Protocol, New Redesigned Web UI, Federated Completions, and Catalog Pagination最新正式版2026-10-20 · 2026-10-20 17:31 UTC

    [1.1.0] - 2026-10-19 - Modern MCP Protocol, New Redesigned Web UI, Federated Completions, and Catalog Pagination

    Overview

    Release 1.1.0 delivers modern MCP protocol negotiation on by default, federated completions, MCP catalog pagination, MCP Origin/Host transport security enforcement, federated gateway tool-name collision detection, and configuration import ownership enforcement. It also removes deprecated anyio monkey-patch settings and the in-tree mcp-servers/ directory. This release consolidates 69 PRs across:

    • Protocol & Transport - MCP_CLIENT_CONNECT_MODE and MCP_INBOUND_PROTOCOL_MODE now default to auto, inbound MCP era negotiation is complete, completion/complete is forwarded to the owning upstream, downstream MCP catalog lists are paginated, and federated resource names carry the gateway name as a prefix.
    • Security & Auth - Added private_key_jwt token endpoint client authentication, MCP Origin/Host enforcement, configuration import ownership enforcement, call-time URL scheme allowlisting, DCR outbound request pinning, and external IdP token fallback on all auth paths.
    • API & Platform - Added named A2A response models, the invitee invitations API, passwordless SSO user provisioning, per-user MCP server rate limiting, and success and error counts in the metrics timeseries.
    • Operations - Added make container-bump-image-versions, moved CSS linting from Stylelint to Biome, migrated Tailwind CSS to v4, removed the anyio monkey-patch settings, the Rust MCP config surface, and the in-tree mcp-servers/ directory.
    • Testing - Eliminated pytest warnings and redundant tests, restored OAuth gateway membership coverage, verified resource template federation, and fixed the live-gateway E2E suite.

    Added

    Protocol & Transport
    • Modern MCP protocol negotiation is on by default (#7061) - MCP_CLIENT_CONNECT_MODE and MCP_INBOUND_PROTOCOL_MODE now default to auto instead of legacy. Outbound upstream connections probe server/discover and negotiate the 2026-07-28 revision, with transparent fallback to the legacy initialize handshake. Inbound clients may send mcp-protocol-version: 2026-07-28 instead of receiving a 400. Set either variable to legacy to restore the previous behaviour.
    • Inbound MCP era negotiation (#7156) - Completed inbound MCP era negotiation.
    • Federated completions (#6629, #6760) - Forward completion/complete to the owning upstream with request metadata. Both legacy and modern MCP connections remain supported through existing negotiation settings; forwarding has no modern-only gate.
    • Streamable HTTP serverInfo stamping (#6566, #7145) - The streamable HTTP server is configured with the app name and version for serverInfo.
    • Federated resource names prefixed with gateway names (#6780) - Federated resource names carry the owning gateway's name as a prefix.
    • structuredContent accepts any JSON value for 2026-era callers (#7244) - Tool results on the 2026-07-28 wire now accept any JSON value (string, number, array, null, or object) as structuredContent. The 2025 wire is unchanged: non-object values are stripped and the text copy in content is used instead.
    • Federated gateway tool-name collisions (#6534) - Gateway registration, refresh, OAuth discovery, reactivation, rename, and visibility updates now reject detected tool-name collisions in public, team, and private visibility scopes. Gateway automat
  2. v1.0.11v1.0.11 - Release 2026-09-28 - MCP Python SDK 2.x, Tool Preview, SSO Controls, and Live E2E Coverage2026-09-28 · 2026-09-28 15:49 UTC
    查看更新说明

    Overview

    Release 1.0.11 consolidates 57 PRs focused on the MCP Python SDK 2.x migration, tool preview, SSO linking and group-mapping controls, catalog and OAuth registration fixes, CORS and schema-validation hardening, and live black-box E2E coverage:

    • Protocol & Transport - Moved to mcp>=2.0.0 with mcp-types, added modern protocol negotiation to legacy(MCP_CLIENT_CONNECT_MODE, MCP_INBOUND_PROTOCOL_MODE, GATEWAY_MODERN_LISTENERS_ENABLED, all legacy by default), and paginated every upstream list_* call.
    • Security & Auth - CORS origin reflection now requires an explicit allowlist, schema validation refuses remote $refs, SSO cross-provider linking is fail-closed behind SSO_ALLOW_PROVIDER_LINKING, SSO and SIEM output is XSS-hardened, and tool lookup caches are isolated per tenant scope.
    • API & Platform - Added the tool preview endpoint, per-caller OAuth token status, a team search filter, passwordless SSO-only users, and MCP-compliant tool execution errors.
    • Operations - Removed the stdio wrapper in favour of FastMCP, migrated the output length guard to the Rust-backed CPEX package, fixed OCP PGO Helm deployment on fresh clusters, and refreshed Python, Node.js, and Rust dependencies.
    • Testing - Consolidated the live MCP E2E suites and added virtual server, user, token, team, and gateway lifecycle coverage against a running gateway.

    Added

    API & Platform
    • Tool preview endpoint (#6443) - Added POST /tools/preview/{name} (and its /v1 mount), a dry-run counterpart to tool invocation that validates arguments against the tool's input_schema, resolves local vs. federated targeting, and reports which plugin pre-invoke hooks would run, without ever dispatching the tool. Gated behind MCPGATEWAY_TOOL_PREVIEW_ENABLED (off by default) and the tools.preview RBAC permission. Only plugins tagged preview_safe actually run during a preview; every other hook that would run live is reported as a warning instead.
    • Per-caller OAuth token status (#6620) - /oauth/status reports the calling user's own token state instead of a shared gateway-level state.
    • Team search filter (#6652) - GET /v1/teams/ accepts a search_query filter.
    • APP_DOMAIN-derived server URL (#6656) - ServerRead exposes a url built from APP_DOMAIN, so clients behind ingress proxies receive a reachable address.
    Security & Auth
    • Passwordless SSO-only users (#6603) - Users provisioned through SSO exist without a local password instead of carrying an unusable placeholder credential.
    • SSO_ALLOW_PROVIDER_LINKING (#6616) - Explicit, fail-closed setting (default false) that gates cross-provider sign-in for an already-linked email.
    Catalog & Plugins
    • OAuth discovery metadata in the bundled catalog (#6613) - Seeded discovery metadata into mcp-catalog.yml, so OAuth-protected catalog entries register without manual endpoint entry.
    • Rust-backed output length guard (#6846) - Migrated the output length guard plugin to the Rust-backed CPEX package.

    Breaking Changes

    • Configurable header sanitization limit (#6654) - Added MAX_HEADER_VALUE_LENGTH with a 4096 default. Existing deployments without this setting retain current behavior. Python integrations importing the removed MAX_HEADER_VALUE_LENGTH module constants must use settings.max_header_value_length. Invalid pre-existing MAX_HEADER_VALUE_LENGTH
  3. v1.0.7-20260921v1.0.7-20260921 - Patch Fix - Upstream MCP Pagination Fix and Security Dependency Updates2026-09-21 · 2026-09-21 17:38 UTC
    查看更新说明

    [1.0.7-20260921] - 2026-09-21 - Upstream MCP Pagination Fix and Security Dependency Updates

    Overview

    Maintenance patch release for the v1.0.7 support line addressing upstream MCP pagination discovery and patching vulnerable dependencies and container base images.

    Fixed

    • Upstream MCP Pagination (#6809) - Follow nextCursor when discovering tools, resources, and prompts from upstream MCP servers across SSE, OAuth SSE, and Streamable HTTP transports rather than only fetching the first page.

    Security

    • Container Base Images - Updated Red Hat UBI 10 base images to 10.2-1789952991 (ubi10), 10.2-1789645153 (ubi10-minimal), and 10.2-1789966145 (nodejs-24).
    • Python Dependencies - Patched h2, pip and tornado.
    • Node Dependencies - Patched vitest / @vitest/mocker and fast-uri.
  4. v1.0.10v1.0.10 - OAuth Security, Observability, Plugin Context, and Reliability2026-09-07 · 2026-09-07 18:57 UTC
    查看更新说明

    [1.0.10] - 2026-09-07 - OAuth Security, Observability, Plugin Context, and Reliability

    Overview

    Release 1.0.10 consolidates 10 PRs focused on OAuth security and reliability, observability and session-affinity performance, plugin context propagation, Vault support for A2A agents, team management reliability, and dependency security:

    • Security & Auth - Rejects default passwords when authentication features are enabled, adds a strict post-OAuth redirect allowlist, and fixes cached team-membership checks during gateway OAuth authorization.
    • Gateway & Plugins - Preserves plugin context across MCP tool, prompt, and resource hooks; supports Vault token injection for A2A agents exposed as MCP tools; and uses the configured public application domain for Vault OAuth callbacks.
    • Observability & Performance - Adds affinity-path tracing, W3C trace propagation, optional Redis/HTTPX/SQLAlchemy instrumentation, and bounded concurrent affinity forwarding while preserving per-session ordering.
    • Reliability & Tooling - Returns clear client errors for duplicate active team names, centralizes interrogate configuration, and refreshes Python and Node.js dependencies with security updates.

    Added

    Security & OAuth
    • Post-OAuth redirect allowlist (#6411) - Added optional redirect_uri_after_oauth gateway configuration for returning users to an external application after Authorization Code OAuth. Redirects require an exact HTTPS origin configured by OAUTH_REDIRECT_ALLOWED_ORIGIN and are validated at configuration and callback time.
    Observability & Performance
    • Affinity-path tracing and concurrent forwarding (#6164) - Added affinity-path spans, W3C trace propagation across affinity hops, optional Redis/HTTPX/SQLAlchemy auto-instrumentation, and bounded concurrent forwarding while preserving per-session FIFO ordering and timeout fallback.
    Plugins
    • Vault support for A2A agents exposed as MCP tools (#6395) - Vault plugin now detects A2A-backed MCP tools, injects matching bearer tokens for tagged agents, and strips X-Vault-Tokens headers from forwarded requests.

    Breaking Changes

    • Enabled authentication rejects default passwords (#6570) - When Basic Auth or email authentication is enabled, empty, placeholder, and known-weak password values now fail startup. Set BASIC_AUTH_PASSWORD for API_ALLOW_BASIC_AUTH=true or DOCS_ALLOW_BASIC_AUTH=true; set PLATFORM_ADMIN_PASSWORD and DEFAULT_USER_PASSWORD for EMAIL_AUTH_ENABLED=true. Existing deployments must run make init-secrets-patch-env or update their deployment Secret before restarting. See the migration guide.

    Fixed

    OAuth & Gateway Access
    • Team gateway OAuth access with cached users (#6589) - Gateway OAuth authorization now checks team membership through TeamManagementService, avoiding false 403 responses caused by detached cached user records.
    • Vault OAuth callback origin behind reverse proxies (#6556) - Vault authorization now builds its callback URI from APP_DOMAIN instead of the internal request origin, preventing identity providers from rejecting redirects behind ingress proxies.
    MCP Transport & Plugins
    • Plugin context propagation over /mcp (#6140) - Streamable HTTP tool calls, prompt fetches, and resource reads now receive context created by HTTP_PRE_REQUEST, preserving cross-hook plugin state on the MCP transport.
    Teams & API Reliability
    • **Active team name collision ha
  5. v1.0.9v1.0.9 - mTLS, OAuth Quick Wins, Tool Preview, Catalog Actions, and Security Hardening2026-09-01 · 2026-09-01 14:23 UTC
    查看更新说明

    [1.0.9] - 2026-08-31 - mTLS, OAuth Quick Wins, Tool Preview, Catalog Actions, and Security Hardening

    Overview

    Release 1.0.9 consolidates 41 PRs focused on inbound mTLS client certificate auth, MCP server OAuth improvements, pluggable OAuth token storage, tool preview and schema publishing, catalog gateway actions, TLS/SSL enhancements, and security hardening:

    • Security & Auth - Inbound mTLS (client certificate authentication), pluggable OAuth token storage with HashiCorp Vault backend, MCP server OAuth form quick wins (read-only redirect URI, drop password grant), session refresh and validate endpoints, default token creation to creator's personal team, invisible Unicode stripping from stored auth credentials, and catalog registration scope enforcement.
    • API & Platform - MCP handshake test endpoint for Test Connection and virtual servers, new tool preview permission and preview functions, tool schema publishing to dataplane, catalog gateway actions backend support, gateway-side TLS override for end-to-end HTTPS, versioned API aliases, recent activity feed endpoint, and durable observability metrics endpoints.
    • Operations - Experimental UI added to compose, SSL/TLS exposed for gateway pods, TLS cipher suite exposure, automated catalog icon generation, and load test consolidation.
    • Documentation - Dynamic env production risk documentation for translate, live black-box test requirement policy.

    Added

    Security & Auth
    • Inbound mTLS (client certificate authentication) (#6352) - Added inbound mTLS support for client certificate authentication.
    • MCP server OAuth form quick wins (#6315) - Read-only redirect URI and dropped password grant from MCP server OAuth form.
    • Session refresh and validate endpoints (#6235) - Added session refresh and validate endpoints.
    • Pluggable OAuth token storage with HashiCorp Vault backend (#5599) - Pluggable OAuth token storage with HashiCorp Vault backend.
    API & Platform
    • MCP handshake test endpoint for Test Connection (#5934) - Added MCP handshake test endpoint for Test Connection.
    • Tool preview permission (#6321) - Added new permission for tool preview.
    • Tool preview functions (#6360) - Added preview functions to the tools service.
    • Tool schema publishing to dataplane (#6348) - Publish tool schemas to the dataplane.
    • Catalog gateway actions backend (#6355) - Support catalog gateway actions in backend.
    • Gateway-side TLS override (#6422) - Added gateway-side TLS override for end-to-end HTTPS.
    • Versioned API aliases (#6257) - Two new paths added as versioned API aliases.
    • Recent activity feed endpoint (#6292) - Recent activity feed endpoint (audit + security union).
    • Durable observability metrics endpoints (#6293) - Durable observability metrics endpoints for the home dashboard.
    Operations & Tooling

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    ContextForge

    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 Banner

    Build Python Package  Dependency Review  Tests & Coverage  Lint & Static Analysis

    Async License  PyPI  Docker Image 

    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:

    • Tools Gateway — MCP, REST, gRPC-to-MCP translation, and TOON compression
    • Agent Gateway — A2A protocol, OpenAI-compatible and Anthropic agent routing
    • API Gateway — Rate limiting, auth, retries, and reverse proxy for REST services
    • Plugin Extensibility — 40+ plugins for additional transports, protocols, and integrations
    • Observability — OpenTelemetry tracing with Phoenix, Jaeger, Zipkin, and other OTLP backends

    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 Web UI

    Table of Contents


    📌 Quick Links

    ResourceDescription
    5-Minute SetupGet started fast — uvx, Docker, Compose, or local dev
    Getting HelpSupport options, FAQ, community channels
    Issue GuideHow to file bugs, request features, contribute
    Full DocumentationComplete guides, tutorials, API reference
    DeprecationsDeprecated runtime paths and migration guidance

    Overview & Goals

    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:

    • Federation across multiple MCP and REST services
    • A2A (Agent-to-Agent) integration for external AI agents (OpenAI, Anthropic, custom)
    • gRPC-to-MCP translation via automatic reflection-based service discovery
    • Virtualization of legacy APIs as MCP-compliant tools and servers
    • Transport over HTTP, JSON-RPC, WebSocket, SSE (with configurable keepalive), and Streamable HTTP; stdio transport available for server-side use
    • An Admin UI for real-time management, configuration, and log monitoring (with airgapped deployment support)
    • A redesigned, more user-friendly Web UI that runs in a separate container
    • Built-in auth, retries, and rate-limiting with user-scoped OAuth tokens and unconditional X-Upstream-Authorization header support
    • OpenTelemetry observability with Phoenix, Jaeger, Zipkin, and other OTLP backends
    • Scalable deployments via Docker or PyPI, Redis-backed caching, and multi-cluster federation

    ContextForge Architecture

    For a list of upcoming features, check out the ContextForge Roadmap


    • Federates any MCP server or REST API
    • Lets you choose your MCP protocol version (e.g., 2025-11-25)
    • Exposes a single, unified interface for diverse backends
    • Wraps non-MCP services as virtual MCP servers
    • Registers tools, prompts, and resources with minimal configuration
    • gRPC-to-MCP translation via server reflection protocol
    • Automatic service discovery and method introspection
    • Adapts REST APIs into tools with:

      • Automatic JSON Schema extraction
      • Support for headers, tokens, and custom auth
      • Retry, timeout, and rate-limit policies
    • Prompts: Jinja2 templates, multimodal support, rollback/versioning
    • Resources: URI-based access, MIME detection, caching, SSE updates
    • Tools: Native or adapted, with input validation and concurrency controls
    • Admin UI built with HTMX 2.0.3 (bundled) + Alpine.js
    • Real-time log viewer with filtering, search, and export capabilities
    • Auth: Basic, JWT, or custom schemes
    • Structured logs, health endpoints, metrics
    • 7,000+ tests, Makefile targets, live reload, pre-commit hooks
    • Vendor-agnostic tracing with OpenTelemetry (OTLP) protocol support
    • Multiple backend support: Phoenix (LLM-focused), Jaeger, Zipkin, Tempo, DataDog, New Relic
    • Distributed tracing across federated gateways and services
    • Automatic instrumentation of tools, prompts, resources, and gateway operations
    • LLM-specific metrics: Token usage, costs, model performance
    • Zero-overhead when disabled with graceful degradation

    See Observability Documentation for setup guides with Phoenix, Jaeger, and other backends.


    Quick Start - PyPI

    ContextForge is published on PyPI as mcp-contextforge-gateway.


    ⚠️ JWT_SECRET_KEY and AUTH_ENCRYPTION_SECRET are required in every environment — including local development. The gateway will not start without them. Generate real secrets with python3 -m mcpgateway.scripts.init_secrets before first run.

    TLDR — single command using uv:

    # 1️⃣  Generate secure secrets (creates .env.secrets)
    python3 -m mcpgateway.scripts.init_secrets
    
    # 2️⃣  Export the generated values
    export JWT_SECRET_KEY="$(grep '^JWT_SECRET_KEY=' .env.secrets | cut -d= -f2)"
    export AUTH_ENCRYPTION_SECRET="$(grep '^AUTH_ENCRYPTION_SECRET=' .env.secrets | cut -d= -f2)"
    
    # 3️⃣  Start the gateway
    JWT_SECRET_KEY="$JWT_SECRET_KEY" \
    AUTH_ENCRYPTION_SECRET="$AUTH_ENCRYPTION_SECRET" \
    MCPGATEWAY_UI_ENABLED=true \
    MCPGATEWAY_ADMIN_API_ENABLED=true \
    [email protected] \
    uvx --from mcp-contextforge-gateway mcpgateway --host 0.0.0.0 --port 4444
    
    • Python ≥ 3.11
    • curl + jq - only for the last smoke-test step

    1 - Install & run (copy-paste friendly)

    # 1️⃣  Create an isolated env and install from PyPI
    mkdir mcpgateway && cd mcpgateway
    python3 -m venv .venv && source .venv/bin/activate
    pip install --upgrade pip
    pip install mcp-contextforge-gateway
    
    # 2️⃣  Download .env.example and generate real secrets
    curl -O https://raw.githubusercontent.com/IBM/mcp-context-forge/main/.env.example
    cp .env.example .env
    
    # Generate cryptographically secure secrets into .env.secrets
    python3 -m mcpgateway.scripts.init_secrets
    
    # Patch the generated secrets into .env (replaces __REPLACE_ME__ placeholders)
    python3 -m mcpgateway.scripts.init_secrets --patch-env .env
    
    # 3️⃣  Start the gateway
    mcpgateway --host 0.0.0.0 --port 4444 &
    
    # 4️⃣  Generate a bearer token and smoke-test
    export JWT_SECRET_KEY=$(grep '^JWT_SECRET_KEY=' .env | cut -d= -f2)
    export MCPGATEWAY_BEARER_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token \
        --username [email protected] --exp 10080 --secret "$JWT_SECRET_KEY")
    
    curl -s -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" \
         http://127.0.0.1:4444/version | jq
    
    # 1️⃣  Isolated env + install from PyPI
    mkdir mcpgateway ; cd mcpgateway
    python3 -m venv .venv ; .\.venv\Scripts\Activate.ps1
    pip install --upgrade pip
    pip install mcp-contextforge-gateway
    
    # 2️⃣  Download .env.example and generate real secrets
    Invoke-WebRequest -Uri "https://raw.githubusercontent.com/IBM/mcp-context-forge/main/.env.example" -OutFile ".env.example"
    Copy-Item .env.example .env
    
    # Generate cryptographically secure secrets into .env.secrets
    python3 -m mcpgateway.scripts.init_secrets
    
    # Patch the generated secrets into .env (replaces __REPLACE_ME__ placeholders)
    python3 -m mcpgateway.scripts.init_secrets --patch-env .env
    
    # 3️⃣  Launch the gateway
    mcpgateway.exe --host 0.0.0.0 --port 4444
    
    # 4️⃣  Bearer token and smoke-test
    $Env:JWT_SECRET_KEY = (Get-Content .env | Select-String '^JWT_SECRET_KEY=').ToString().Split('=')[1]
    $Env:MCPGATEWAY_BEARER_TOKEN = python3 -m mcpgateway.utils.create_jwt_token `
        --username [email protected] --exp 10080 --secret $Env:JWT_SECRET_KEY
    
    curl -s -H "Authorization: Bearer $Env:MCPGATEWAY_BEARER_TOKEN" `
         http://127.0.0.1:4444/version | jq
    
    # 1️⃣  Isolated env + install from PyPI using uv
    mkdir mcpgateway ; cd mcpgateway
    uv venv
    .\.venv\Scripts\activate
    uv pip install mcp-contextforge-gateway
    
    # Continue with steps 2️⃣-4️⃣ above...
    

    Copy .env.example to .env and tweak any of the settings (or use them as env variables).

    # 1️⃣  Spin up the sample MCP time server using mcpgateway.translate & docker (replace docker with podman if needed)
    python3 -m mcpgateway.translate \
         --stdio "docker run --rm -i ghcr.io/ibm/fast-time-server:latest -transport=stdio" \
         --expose-sse \
         --port 8003
    
    # Or using the official mcp-server-git using uvx:
    pip install uv # to install uvx, if not already installed
    python3 -m mcpgateway.translate --stdio "uvx mcp-server-git" --expose-sse --port 9000
    
    # NEW: Expose via multiple protocols simultaneously!
    python3 -m mcpgateway.translate \
         --stdio "uvx mcp-server-git" \
         --expose-sse \
         --expose-streamable-http \
         --port 9000
    # Now accessible via both /sse (SSE) and /mcp (streamable HTTP) endpoints
    
    # 2️⃣  Register it with the gateway
    curl -s -X POST -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" \
         -H "Content-Type: application/json" \
         -d '{"name":"fast_time","url":"http://localhost:8003/sse"}' \
         http://localhost:4444/gateways
    
    # 3️⃣  Verify tool catalog
    curl -s -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" http://localhost:4444/tools | jq
    
    # 4️⃣  Create a *virtual server* bundling those tools. Use the ID of tools from the tool catalog (Step #3) and pass them in the associatedTools list.
    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":[<ID_OF_TOOLS>]}}' \
         http://localhost:4444/servers | jq
    
    # Example curl
    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
    
    # 5️⃣  List servers (should now include the UUID of the newly created virtual server)
    curl -s -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" http://localhost:4444/servers | jq
    
    # 6️⃣  Client HTTP endpoint. Inspect it interactively with the MCP Inspector CLI (or use any MCP client)
    npx -y @modelcontextprotocol/inspector
    # Transport Type: Streamable HTTP, URL: http://localhost:4444/servers/UUID_OF_SERVER_1/mcp,  Header Name: "Authorization", Bearer Token
    

    Quick Start - Containers

    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.

    🚀 Quick Start - Docker Compose

    Important: docker compose up -d does not build the gateway image locally by default — it uses the pre-built image from GHCR. The compose file includes a build: block as a fallback, but local builds require a hermetic wheel closure that is only produced by the CI pipeline. If you see a cryptography or dependency resolution error during build, you are hitting this — just pull the image instead (step 2 below handles this automatically).

    You also must have a .env file with real secrets before running docker compose up -d. The gateway will not start with placeholder values.

    Get a full stack running with PostgreSQL and Redis:

    # 1️⃣  Clone the repository
    git clone https://github.com/IBM/mcp-context-forge.git
    cd mcp-context-forge
    
    # 2️⃣  Set up .env with real secrets AND pull the pre-built images
    cp .env.example .env
    python3 -m mcpgateway.scripts.init_secrets --patch-env .env
    # .env now has strong JWT_SECRET_KEY and AUTH_ENCRYPTION_SECRET
    
    # Pull pre-built images from GHCR (avoids local build entirely)
    docker pull ghcr.io/ibm/mcp-context-forge:latest
    echo 'IMAGE_LOCAL=ghcr.io/ibm/mcp-context-forge:latest' >> .env
    
    # Build only the nginx image (small, local-only, builds in seconds)
    docker compose build nginx
    
    # 3️⃣  Start the full stack
    docker compose up -d
    
    # 4️⃣  Check status
    docker compose ps
    
    # 5️⃣  View logs
    docker compose logs -f gateway
    
    # 6️⃣  Access Admin UI: http://localhost:8080/admin
    #     Login: PLATFORM_ADMIN_EMAIL / PLATFORM_ADMIN_PASSWORD (from .env)
    
    # 7️⃣  Generate an API token
    export JWT_SECRET_KEY=$(grep '^JWT_SECRET_KEY=' .env | cut -d= -f2)
    docker compose exec gateway python3 -m mcpgateway.utils.create_jwt_token \
      --username [email protected] --exp 10080 --secret "$JWT_SECRET_KEY"
    

    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):

    # Start with TLS enabled (auto-generates self-signed certs)
    make compose-tls
    
    # Access via HTTPS: https://localhost:8443/admin
    
    # Or bring your own certificates:
    # Unencrypted key:
    mkdir -p certs
    cp your-cert.pem certs/cert.pem && cp your-key.pem certs/key.pem
    make compose-tls
    
    # Passphrase-protected key:
    mkdir -p certs
    cp your-cert.pem certs/cert.pem && cp your-encrypted-key.pem certs/key-encrypted.pem
    echo "KEY_FILE_PASSWORD=your-passphrase" >> .env
    make compose-tls
    
    Optional Web UI

    The ContextForge Web UI v0.2.4 provides a redesigned, more user-friendly interface, separate from the built-in Admin UI. It runs in its own container and connects to the gateway API.

    After the Docker Compose setup above, start the Web UI with these commands from the gateway checkout:

    make compose-pull PROFILE="--profile ui"
    make compose-up PROFILE="--profile ui"
    

    Open http://localhost:3001 and sign in with your gateway account. Set WEB_UI_PORT in .env to change the port. The ui profile starts the Web UI and its dedicated Redis session store alongside the gateway.

    PROFILE replaces the Makefile's default profiles. On linux/amd64, use PROFILE="--profile with-fast-time --profile ui" in both commands to retain the default fast-time service.

    For separate npm development setup, see the Web UI setup guide.

    ☸️ Quick Start - Helm (Kubernetes)

    Deploy to Kubernetes with enterprise-grade features:

    # Add Helm repository (when available)
    # helm repo add mcp-context-forge https://ibm.github.io/mcp-context-forge
    # helm repo update
    
    # For now, use local chart
    git clone https://github.com/IBM/mcp-context-forge.git
    cd mcp-context-forge/charts/mcp-stack
    
    # Generate secrets first
    python3 -m mcpgateway.scripts.init_secrets
    JWT_SECRET=$(grep '^JWT_SECRET_KEY=' .env.secrets | cut -d= -f2)
    ENC_SECRET=$(grep '^AUTH_ENCRYPTION_SECRET=' .env.secrets | cut -d= -f2)
    
    # Install with PostgreSQL (default)
    # IMPORTANT: replace <strong-password> with a real password — do not use 'changeme' in production
    helm install mcp-gateway . \
      --set mcpContextForge.secret.PLATFORM_ADMIN_EMAIL=admin@yourcompany.com \
      --set mcpContextForge.secret.PLATFORM_ADMIN_PASSWORD=<strong-password> \
      --set mcpContextForge.secret.BASIC_AUTH_PASSWORD=<strong-password> \
      --set "mcpContextForge.secret.JWT_SECRET_KEY=${JWT_SECRET}" \
      --set "mcpContextForge.secret.AUTH_ENCRYPTION_SECRET=${ENC_SECRET}"
    
    # Check deployment status
    kubectl get pods -l app.kubernetes.io/name=mcp-context-forge
    
    # Port forward to access Admin UI
    kubectl port-forward svc/mcp-gateway-mcp-context-forge 4444:80
    # Access: http://localhost:4444/admin
    
    # Generate API token (reads JWT_SECRET_KEY from the pod's environment)
    kubectl exec deployment/mcp-gateway-mcp-context-forge -- \
      python3 -m mcpgateway.utils.create_jwt_token \
      --username [email protected] --exp 10080 --secret "${JWT_SECRET}"
    

    SSRF note: Helm defaults to strict SSRF settings (SSRF_ALLOW_PRIVATE_NETWORKS=false). If you register in-cluster tool URLs, allow only your cluster CIDRs via mcpContextForge.config.SSRF_ALLOWED_NETWORKS or, for local-only benchmark setups, temporarily set SSRF_ALLOW_PRIVATE_NETWORKS=true. See docs/docs/manage/configuration.md#ssrf-protection and docs/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 (Single Container)

    # Generate secrets first (creates .env.secrets)
    python3 -m mcpgateway.scripts.init_secrets
    export JWT_SECRET_KEY="$(grep '^JWT_SECRET_KEY=' .env.secrets | cut -d= -f2)"
    export AUTH_ENCRYPTION_SECRET="$(grep '^AUTH_ENCRYPTION_SECRET=' .env.secrets | cut -d= -f2)"
    
    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="${JWT_SECRET_KEY}" \
      -e AUTH_ENCRYPTION_SECRET="${AUTH_ENCRYPTION_SECRET}" \
      -e AUTH_REQUIRED=true \
      -e [email protected] \
      -e PLATFORM_ADMIN_PASSWORD=<strong-password> \
      -e PLATFORM_ADMIN_FULL_NAME="Platform Administrator" \
      -e DATABASE_URL=sqlite:///./mcp.db \
      -e SECURE_COOKIES=false \
      ghcr.io/ibm/mcp-context-forge:latest
    
    # Tail logs
    docker logs -f mcpgateway
    
    # Generate API token (using the same secret)
    docker run --rm -it \
      -e JWT_SECRET_KEY="${JWT_SECRET_KEY}" \
      ghcr.io/ibm/mcp-context-forge:latest \
      python3 -m mcpgateway.utils.create_jwt_token \
      --username [email protected] --exp 10080 --secret "${JWT_SECRET_KEY}"
    

    Browse to http://localhost:4444/admin and login with PLATFORM_ADMIN_EMAIL / PLATFORM_ADMIN_PASSWORD.

    Persist SQLite database:

    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="${JWT_SECRET_KEY}" \
      -e AUTH_ENCRYPTION_SECRET="${AUTH_ENCRYPTION_SECRET}" \
      -e [email protected] -e PLATFORM_ADMIN_PASSWORD=<strong-password> \
      ghcr.io/ibm/mcp-context-forge:latest
    

    Host networking (access local MCP servers):

    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 \
      -e JWT_SECRET_KEY="${JWT_SECRET_KEY}" -e AUTH_ENCRYPTION_SECRET="${AUTH_ENCRYPTION_SECRET}" \
      ghcr.io/ibm/mcp-context-forge:latest
    

    Airgapped deployment (no internet):

    docker build -f Containerfile -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="${JWT_SECRET_KEY}" \
      -e AUTH_ENCRYPTION_SECRET="${AUTH_ENCRYPTION_SECRET}" \
      mcpgateway:airgapped
    

    🦭 Podman (rootless-friendly)

    podman run -d --name mcpgateway \
      -p 4444:4444 -e HOST=0.0.0.0 -e DATABASE_URL=sqlite:///./mcp.db \
      ghcr.io/ibm/mcp-context-forge:1.0.0-RC-3
    

    Persist SQLite:

    mkdir -p $(pwd)/data && chmod 777 $(pwd)/data
    podman run -d --name mcpgateway --restart=on-failure \
      -p 4444:4444 -v $(pwd)/data:/data \
      -e DATABASE_URL=sqlite:////data/mcp.db \
      ghcr.io/ibm/mcp-context-forge:1.0.0-RC-3
    

    Host networking:

    podman run -d --name mcpgateway --network=host \
      -v $(pwd)/data:/data -e DATABASE_URL=sqlite:////data/mcp.db \
      ghcr.io/ibm/mcp-context-forge:1.0.0-RC-3
    

    • .env files - Put all the -e FOO= lines into a file and replace them with --env-file .env. See the provided .env.example for reference.

    • Pinned tags - Use an explicit version (e.g. 1.0.0-RC-3) instead of latest for reproducible builds.

    • JWT tokens - Generate one in the running container (reads the secret from the container environment):

      docker exec mcpgateway python3 -m mcpgateway.utils.create_jwt_token \
        --username [email protected] --exp 10080 --secret "${JWT_SECRET_KEY}"
      
    • Upgrades - Stop, remove, and rerun with the same -v $(pwd)/data:/data mount; your DB and config stay intact.


    curl -s -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" \
         http://localhost:4444/health | jq
    curl -s -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" \
         http://localhost:4444/tools | jq
    curl -s -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" \
         http://localhost:4444/version | jq
    

    Quick Start: VS Code Dev Container

    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.


    Installation

    make venv install-dev      # create .venv + install deps + build Admin UI
    make serve                 # gunicorn on :4444
    
    # UV (faster)
    uv venv && source .venv/bin/activate
    uv pip install -e '.[dev]'
    
    # pip
    python3 -m venv .venv && source .venv/bin/activate
    pip install -e ".[dev]"
    

    Install the psycopg driver for PostgreSQL:

    # Install system dependencies first
    # Debian/Ubuntu: sudo apt-get install libpq-dev
    # macOS: brew install libpq
    
    uv pip install 'psycopg[binary]'   # dev (pre-built wheels)
    # or: uv pip install 'psycopg[c]'  # production (requires compiler)
    

    Connection URL format:

    DATABASE_URL=postgresql+psycopg://user:password@localhost:5432/mcp
    

    Quick Postgres container:

    docker run --name mcp-postgres \
      -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=mysecretpassword \
      -e POSTGRES_DB=mcp -p 5432:5432 -d postgres
    

    Upgrading

    For upgrade instructions, migration guides, and rollback procedures, see:


    Configuration

    ⚠️ 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.

    🔐 Required: Set Before Starting

    These variables must be set before the gateway will start. There are no usable defaults — the application fails at startup if these are missing or placeholder values:

    VariableDescriptionHow to generate
    JWT_SECRET_KEYHMAC secret for signing JWTs (32+ chars)python3 -m mcpgateway.scripts.init_secrets
    AUTH_ENCRYPTION_SECRETPassphrase for encrypting stored credentialspython3 -m mcpgateway.scripts.init_secrets

    These variables have insecure defaults and should be changed before production use:

    VariableDescriptionDefault
    BASIC_AUTH_USERUsername for HTTP Basic authadmin
    BASIC_AUTH_PASSWORDPassword for HTTP Basic authrequired — no default; set via make init-secrets-patch-env
    PLATFORM_ADMIN_EMAILEmail for bootstrap admin user[email protected]
    PLATFORM_ADMIN_PASSWORDPassword for bootstrap admin userrequired — set a strong value before first run
    PLATFORM_ADMIN_FULL_NAMEDisplay name for bootstrap adminAdmin User

    🔒 Security Defaults (Secure by Default)

    These settings are enabled by default for security—only disable for backward compatibility:

    VariableDescriptionDefault
    REQUIRE_JTIRequire JTI claim in tokens for revocation supporttrue
    REQUIRE_TOKEN_EXPIRATIONRequire exp claim in tokenstrue
    PUBLIC_REGISTRATION_ENABLEDAllow public user self-registrationfalse

    🛡️ Content Security

    Content size limits prevent DoS attacks and ensure system stability:

    VariableDescriptionDefault
    CONTENT_MAX_RESOURCE_SIZEMaximum resource content size (bytes)102400 (100KB)
    CONTENT_MAX_PROMPT_SIZEMaximum prompt template size (bytes)10240 (10KB)

    Note: Size limits apply only to new create/update operations. Existing content is not retroactively validated.

    🌐 UAID Cross-Gateway Routing Security

    UAID Security Configuration

    Production Requirements:

    Cross-gateway UAID routing requires explicit security configuration:

    1. Configure Domain Allowlist:

      UAID_ALLOWED_DOMAINS=["gateway1.example.com", "gateway2.example.com"]
      
    2. Ensure JWT Trust:

      • Both gateways must trust the same JWT issuer
      • Option A: Shared secret (same JWT_SECRET_KEY on all gateways)
      • Option B: Federated SSO (Google, GitHub, Entra ID)
    3. Enable Authentication:

      AUTH_REQUIRED=true
      UAID_FORWARD_AUTH=true
      

    Authentication Flow:

    Cross-gateway calls forward the user's bearer token via the Authorization header. Remote gateways validate tokens through existing auth middleware, preserving RBAC context.

    Security Features:

    • ✅ Fail-closed default: Empty allowlist blocks all cross-gateway routing
    • ✅ Bearer token forwarding: User authentication preserved across hops
    • ✅ Audit trail: Source gateway and user tracked in headers
    • ✅ Clear error messages: Misconfigurations caught at startup and runtime

    Troubleshooting:

    • "UAID_ALLOWED_DOMAINS not configured" error: Add trusted domains to allowlist in .env
    • 401/403 from remote gateway: Verify both gateways trust same JWT issuer
    • "proceeding without authentication token" warning: Check auth middleware extracts token to request.state.bearer_token

    For detailed security architecture, see docs/security/uaid-cross-gateway-auth.md.

    ⚙️ Project Defaults (Dev Setup)

    These values differ from code defaults to provide a working local/dev setup:

    VariableDescriptionDefault
    HOSTBind address0.0.0.0
    MCPGATEWAY_UI_ENABLEDEnable Admin UI dashboardtrue
    MCPGATEWAY_ADMIN_API_ENABLEDEnable Admin API endpointstrue
    DATABASE_URLSQLAlchemy connection URLsqlite:///./mcp.db
    SECURE_COOKIESSet false for HTTP (non-HTTPS) devfalse

    📚 Full Configuration Reference

    For the complete list of 300+ environment variables organized by category (authentication, caching, SSO, observability, etc.), see the Configuration Reference.


    Running

    Quick Reference

    CommandServerPortDatabaseUse Case
    make devUvicorn8000SQLiteDevelopment (single instance, auto-reload)
    make serveGunicorn4444SQLiteProduction single-node (multi-worker)
    make serve-sslGunicorn4444SQLiteProduction single-node with HTTPS
    make compose-upDocker Compose + Nginx8080PostgreSQL + RedisFull stack (3 replicas, load-balanced)
    make compose-ssoDocker Compose + Keycloak8080 / 8180PostgreSQL + RedisLocal SSO testing (Keycloak profile)
    make testing-upDocker Compose + Nginx8080PostgreSQL + RedisTesting environment

    Development Server (Uvicorn)

    make dev                 # Uvicorn on :8000 with auto-reload and SQLite
    # or
    ./run.sh --reload --log debug --workers 2
    

    run.sh is a wrapper around uvicorn that loads .env, supports reload, and passes arguments to the server.

    Key flags:

    FlagPurposeExample
    -e, --env FILEload env-file--env prod.env
    -H, --hostbind address--host 127.0.0.1
    -p, --portlisten port--port 8080
    -w, --workersgunicorn workers--workers 4
    -r, --reloadauto-reload--reload

    Production Server (Gunicorn)

    make serve               # Gunicorn on :4444 with multiple workers
    make serve-ssl           # Gunicorn behind HTTPS on :4444 (uses ./certs)
    

    Docker Compose (Full Stack)

    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
    

    Manual (Uvicorn)

    uvicorn mcpgateway.main:app --host 0.0.0.0 --port 4444 --workers 4
    

    Cloud Deployment

    ContextForge can be deployed to any major cloud platform:

    PlatformGuide
    AWSECS/EKS Deployment
    AzureAKS Deployment
    Google CloudCloud Run
    IBM CloudCode Engine
    KubernetesHelm Charts
    OpenShiftOpenShift Deployment

    For comprehensive deployment guides, see Deployment Documentation.


    API Reference

    Interactive API documentation is available when the server is running:

    • Swagger UI — Try API calls directly in your browser
    • ReDoc — Browse the complete endpoint reference

    Quick Authentication:

    # Read JWT_SECRET_KEY from your .env (it must already contain a real secret)
    export JWT_SECRET_KEY=$(grep '^JWT_SECRET_KEY=' .env | cut -d= -f2)
    
    # Generate a JWT token
    export TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token \
      --username [email protected] --exp 10080 --secret "$JWT_SECRET_KEY")
    
    # Test API access
    curl -H "Authorization: Bearer $TOKEN" http://localhost:4444/health
    

    For comprehensive curl examples covering all endpoints, see the API Usage Guide.


    Testing

    make test            # Run unit tests
    make lint            # Run all linters
    make doctest         # Run doctests
    make coverage        # Generate coverage report
    

    See Doctest Coverage Guide for documentation testing details.


    Project Structure

    mcpgateway/          # Core FastAPI application
    ├── main.py          # Entry point
    ├── config.py        # Pydantic Settings configuration
    ├── db.py            # SQLAlchemy ORM models
    ├── schemas.py       # Pydantic validation schemas
    ├── services/        # Business logic layer (50+ services)
    ├── routers/         # HTTP endpoint definitions
    ├── middleware/      # Cross-cutting concerns
    └── transports/      # SSE, WebSocket, stdio, streamable HTTP
    
    tests/               # Test suite (7,000+ tests)
    docs/docs/           # Full documentation (MkDocs)
    charts/              # Kubernetes/Helm charts
    plugins/             # Plugin framework and implementations
    

    Security: Never run untrusted MCP servers directly on your local filesystem. Always use a sandbox, container, or microVM (e.g. gVisor, Firecracker) with restricted capabilities. Exercise caution when registering any remote MCP server, including servers from public catalogs — perform your own security evaluation before granting access to your gateway.

    For complete structure, see CONTRIBUTING.md or run tree -L 2.


    Development

    make dev             # Dev server with auto-reload (:8000)
    make test            # Run test suite
    make lint            # Run all linters
    make coverage        # Generate coverage report
    

    Run make to see all available targets.

    For development workflows, see:


    Troubleshooting

    Common issues and solutions:

    IssueQuick Fix
    docker compose up fails with cryptography or dependency resolution errorThe local build requires a CI-produced wheel closure. Run docker pull ghcr.io/ibm/mcp-context-forge:latest && echo 'IMAGE_LOCAL=ghcr.io/ibm/mcp-context-forge:latest' >> .env then retry
    docker compose up fails with SecurityConfigurationError: jwt_secret_key.env is missing or has __REPLACE_ME__ placeholders. Run cp .env.example .env && python3 -m mcpgateway.scripts.init_secrets --patch-env .env
    docker compose up fails — mcpgateway/nginx-cache pull access deniednginx image must be built locally: docker compose build nginx
    make dev — nothing on port 8000Check terminal for SecurityConfigurationError — run make ensure-secrets then retry. On WSL2 use http://127.0.0.1:8000 not localhost
    SQLite "disk I/O error" on macOSAvoid iCloud-synced directories; use ~/mcp-context-forge/data
    Port 4444 not accessible on WSL2Configure WSL integration in Docker Desktop
    Gateway exits immediatelyRun cp .env.example .env && python3 -m mcpgateway.scripts.init_secrets --patch-env .env
    ModuleNotFoundErrorRun make install-dev

    For detailed troubleshooting guides, see Troubleshooting Documentation.


    Contributing

    1. Fork the repo, create a feature branch.
    2. Run make lint and fix any issues.
    3. Keep make test green.
    4. Open a PR with signed commits (git commit -s).

    See CONTRIBUTING.md for full guidelines and Issue Guide #2502 for how to file bugs, request features, and find issues to work on.


    Changelog

    A complete changelog can be found here: CHANGELOG.md

    License

    Licensed under the Apache License 2.0 - see LICENSE

    Star History and Project Activity

    Star History Chart

    PyPi Downloads  Stars  Forks  Contributors  Last Commit  Open Issues