How to Deploy and Use Context Forge: A Step-by-Step Tutorial
Step-by-step guide to deploying Context Forge with Docker, configuring MCP gateways, and connecting AI agents to a unified API endpoint.
Context Forge Tutorial: Deploy & Configure Your AI Gateway
In this tutorial, we'll walk through deploying Context Forge using Docker, configuring it as a centralized MCP gateway, and connecting your first AI agent. By the end, you'll have a fully functional AI Gateway managing your MCP and REST API traffic.
π Want to deploy Context Forge yourself?
Docker configs, system requirements, and installation guides β all on one page.
View Context Forge Tool Page βStep 1: Prerequisites
- Docker and Docker Compose installed
- At least 2 CPU cores and 4GB RAM (4 cores / 8GB recommended for production)
- An MCP server endpoint or REST API to route through the gateway
Step 2: Deploy with Docker Compose
Create a docker-compose.yml file:
services:
context-forge:
image: gandhipratik203/mcp-context-forge:latest
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- ./data/context-forge:/data
Run: docker compose up -d
Step 3: Configure Your Gateway
Context Forge exposes a REST API on port 8080. Register your first MCP server:
curl -X POST http://localhost:8080/api/v1/servers \
-H "Content-Type: application/json" \
-d '{
"name": "my-mcp-server",
"url": "http://mcp-server:8000",
"protocol": "mcp"
}'
Step 4: Connect Your AI Agent
Configure your AI agent to use Context Forge as the single endpoint:
# In your agent config MCP_GATEWAY_URL=http://localhost:8080 MCP_API_KEY=your-api-key
Step 5: Monitor & Manage
Access the Context Forge dashboard to view metrics, manage servers, and configure rate limits. Use the plugin system to add custom authentication, logging, or request transformations.
π‘ Pro Tip: For production deployments, enable TLS and configure JWT authentication by setting the AUTH_JWT_SECRET environment variable. Context Forge supports OAuth2 integration for enterprise SSO.
π Ready to deploy Context Forge?
Find Docker Compose configs, system requirements, and more on the tool page.
View Context Forge Tool Page β