Deploy & Host ContextForge | Railway

Deploy and Host ContextForge on Railway

ContextForge is IBM's open-source gateway, registry and proxy for the Model Context Protocol. It federates many MCP servers and REST APIs behind one authenticated endpoint, groups their tools into virtual servers, and adds an admin UI, JWT and OAuth auth, teams, rate limiting, observability and plugins for agent platforms.

About Hosting ContextForge

This template deploys ContextForge v1.0.10 from the official image with a Railway Postgres database. Every endpoint requires authentication: the admin signs in with a generated password, public registration is off and cookies are secure. JWT and encryption secrets are generated at deploy time, and worker count is pinned. Private network access is allowed, so you can register MCP servers running as other Railway services by their internal address. Connect agents and IDEs to the gateway with a token. It fits the Hobby plan. Back up Postgres regularly, since it stores gateways, tools and tokens.

Common Use Cases

Dependencies for ContextForge Hosting

Deployment Dependencies

Implementation Details

Service Image Networking Storage
contextforge ghcr.io/ibm/mcp-context-forge:v1.0.10 public domain on 4444; private none (state in Postgres)
Postgres Railway Postgres 18 private only volume
TOKEN=$(curl -s -X POST https:///auth/email/login -H 'Content-Type: application/json' \
  -d '{"email":"admin@example.com","password":""}' | jq -r .access_token)
curl -X POST https:///gateways -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"name":"my-mcp","url":"http://my-mcp.railway.internal:3001/mcp","transport":"STREAMABLEHTTP"}'
Variable Default Purpose
PLATFORM_ADMIN_EMAIL / PLATFORM_ADMIN_PASSWORD admin@example.com / generated Admin login (UI and API)
JWT_SECRET_KEY / AUTH_ENCRYPTION_SECRET generated Token signing and secret encryption
SSRF_ALLOW_PRIVATE_NETWORKS true Allow MCP servers on the Railway private network
GUNICORN_WORKERS 2 Worker processes (default scales with host CPUs)

Notes:

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the ContextForge project or its maintainers.

Why Deploy ContextForge on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying ContextForge on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.