Context Forge

v1.0.0Cloud Servicesstable

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.

agentsaiapi-gatewayasyncioauthentication-middleware
Share:
3,743
Stars
0
Downloads
0
Weekly
0/5

What is Context Forge?

Context Forge is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 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...

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.

This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • An AI Gateway, registry, and proxy that sits in front of any

Use Cases

AI gateway and MCP registry with orchestration
Centralized discovery and guardrails management
IBM

Maintainer

LicenseApache-2.0
Languagepython
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-context-forge

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Context Forge

Context Forge (IBM MCP Context Forge) is an AI gateway, registry, and proxy that federates MCP, A2A (Agent-to-Agent), and REST/gRPC APIs behind a single governed endpoint. It provides centralized tool discovery, authentication (JWT/OAuth/Basic), rate limiting, retry policies, and OpenTelemetry observability across all connected services. Organizations use it to expose their entire internal API and tool ecosystem to AI agents in a secure, auditable way without rewriting existing services as MCP servers.

Prerequisites

  • Docker and Docker Compose installed (recommended), or Python 3.10+ with uv for PyPI install
  • A secure JWT_SECRET_KEY of 32+ characters (generate with openssl rand -hex 32)
  • An MCP client such as Claude Desktop or MCP Inspector
  • Network connectivity to the backend APIs or MCP servers you want to federate
1

Clone the repository and start with Docker Compose

Docker Compose brings up the full stack including the gateway, database, and admin UI. This is the fastest way to get a working deployment.

git clone https://github.com/IBM/mcp-context-forge.git
cd mcp-context-forge
docker compose up -d
2

Set required environment variables

Configure the critical security variables before production use. At minimum, set JWT_SECRET_KEY, PLATFORM_ADMIN_EMAIL, and PLATFORM_ADMIN_PASSWORD. The gateway binds to port 4444 by default.

export JWT_SECRET_KEY=$(openssl rand -hex 32)
export [email protected]
export PLATFORM_ADMIN_PASSWORD=changeme
3

Generate an API bearer token

Create a JWT token for authenticating MCP client requests. The --exp parameter controls expiry in minutes (10080 = 7 days).

python3 -m mcpgateway.utils.create_jwt_token \
  --username [email protected] \
  --exp 10080 \
  --secret $JWT_SECRET_KEY
4

Register backend services via the admin API

Register existing MCP servers, REST APIs, or gRPC services. For REST APIs the gateway auto-extracts the schema from OpenAPI specs. For MCP servers, provide the SSE endpoint URL.

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my_mcp_server","url":"http://localhost:8003/sse"}' \
  http://localhost:4444/gateways
5

Configure your MCP client to use the unified gateway

Point your MCP client at the gateway's unified MCP endpoint. All registered tools are accessible through this single connection.

{
  "mcpServers": {
    "mcp-context-forge": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:4444/mcp",
               "--header", "Authorization:Bearer your-jwt-token"]
    }
  }
}
6

Explore the admin UI and Swagger docs

The web admin UI is available at http://localhost:4444 and the Swagger API reference at http://localhost:4444/docs. Use these to manage registered services, view metrics, and test tool calls.

Context Forge Examples

Client configuration

MCP client configuration for connecting to a locally running Context Forge gateway with JWT authentication.

{
  "mcpServers": {
    "mcp-context-forge": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:4444/mcp",
        "--header",
        "Authorization:Bearer your-jwt-token-here"
      ]
    }
  }
}

Prompts to try

Example prompts for working with the Context Forge gateway once services are registered.

- "List all tools currently registered in the gateway and group them by service"
- "Use the inventory-lookup tool to find stock levels for product SKU-42"
- "Register the REST API at https://api.internal.example.com/openapi.json as a set of MCP tools"
- "Show me a summary of tool call success rates and latencies from the last 24 hours"
- "What A2A agents are currently connected through the gateway?"

Troubleshooting Context Forge

Gateway fails to start: JWT_SECRET_KEY too short

The key must be at least 32 characters. Run 'openssl rand -hex 32' to generate a valid key, set it in your environment or Docker run command, and restart the container.

Backend MCP server registered but shows offline

When running in Docker, use the host machine's Docker bridge IP (e.g., 172.17.0.1) instead of 'localhost' for backend service URLs. Verify the backend service is actually running and accepting connections on its SSE endpoint.

Bearer token rejected with 401 Unauthorized

Confirm the token was generated with the same JWT_SECRET_KEY that the gateway is using. Check token expiry with a JWT decoder at jwt.io. Regenerate a token if expired.

Frequently Asked Questions about Context Forge

What is Context Forge?

Context Forge is a Model Context Protocol (MCP) server that 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. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Context Forge?

Follow the installation instructions on the Context Forge GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Context Forge?

Context Forge works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Context Forge free to use?

Yes, Context Forge is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Cloud Services MCP Servers

Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-context-forge": { "command": "npx", "args": ["-y", "mcp-context-forge"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Context Forge?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides