Deploy OmniRoute MCP

AI gateway with built-in MCP for routing control

Deploy OmniRoute MCP

Just deployed

/app/data

Deploy and Host self hosted OmniRoute MCP (Open-Source AI Gateway) on Railway

OmniRoute MCP is the same OmniRoute stack with the angle on its built-in Model Context Protocol server. Agents hit /api/mcp/stream or /api/mcp/sse to inspect routing, quotas, and health, while coding tools keep using OpenAI-compatible /v1. Image diegosouzapw/omniroute:3.8.51 is digest-pinned with /app/data and generated secrets.

About Hosting OmniRoute MCP open-source software on Railway (self hosted OmniRoute template)

One service: diegosouzapw/omniroute:3.8.51 pinned by digest, port 20128, health /healthz, volume /app/data. Dashboard at /dashboard. /v1 speaks OpenAI, Claude, Gemini, and Responses-compatible shapes. SQLite (better-sqlite3, WAL) stores state; provider keys are encrypted with AES-256-GCM. No Postgres or Redis. Generated secrets: INITIAL_PASSWORD, JWT_SECRET, API_KEY_SECRET, OMNIROUTE_WS_BRIDGE_SECRET, MACHINE_ID_SALT. Fixed: PORT=20128, HOSTNAME=0.0.0.0, DATA_DIR=/app/data, BASE_URL and NEXT_PUBLIC_BASE_URL, AUTH_COOKIE_SECURE=true, REQUIRE_API_KEY=true, OMNIROUTE_MEMORY_MB.

Why Deploy OmniRoute MCP, the OpenRouter alternative on Railway (Railway Free Trial)

OpenRouter is SaaS with credit fees and no self-host. OmniRoute keeps your keys and usage on your volume, adds MCP so an agent can audit the gateway, and still fronts Claude Code, Cursor, and friends on /v1. Railway's $5 trial is enough to stand up HTTPS MCP without wiring Nginx yourself.

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 OmniRoute MCP 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.

Railway vs Other Hosting Providers and VPS for OmniRoute MCP self hosting

ProviderMCP over HTTPSVolume for SQLiteOps burden
DigitalOceanYou add proxy, certs, firewallBlock storage or droplet diskHigh for one gateway
AWSALB/ACM plus ECS or EC2EBSVery high for a solo deploy
HetznerManual reverse proxy and TLSLocal NVMe or volumeCheap compute, DIY TLS

Railway gives a public domain, TLS, volume mount, and secret generation in one click. That matters when MCP clients expect a stable HTTPS URL and Bearer key.

Common Use Cases for hosted OmniRoute MCP

Wire Claude Code or Cursor MCP settings to https://YOUR-DOMAIN/api/mcp/stream with a Bearer API key so the agent can check health, combos, and quota before a long coding run. Keep /v1 as the chat/completions and Responses endpoint for the same tools. Use model "auto" to build a virtual combo across the 372-provider catalog (150+ free tiers; providers marked tos: avoid stay out of auto routing by default). Lean on 19 routing strategies, 4-tier fallback (subscription -> API key -> cheap -> free), circuit breakers, and key cooldowns when accounts flap. Enable RTK and Caveman compression when traces are huge; upstream claims 15-95% savings on eligible workloads. Raise OMNIROUTE_MEMORY_MB toward 8192 and the Railway memory limit toward ~10 GB when /v1/responses coding agents thrash the default 1024 MB heap. A2A is also built in for agent-to-agent JSON-RPC on the same service.

Dependencies for OmniRoute MCP Docker hosted on Railway

No managed Postgres, Redis, or object storage. Dependencies are the pinned image, writable /app/data, outbound HTTPS to providers, and at least one provider account after login. Railway supplies domain and TLS so MCP HTTP transports work without a sidecar proxy. Secrets are generated on deploy. You still paste provider keys into the dashboard; they never belong in the template defaults.

Deployment Dependencies for Managed OmniRoute MCP Service (AI Gateway)

  • diegosouzapw/omniroute:3.8.51 digest pin
  • Port 20128, health /healthz
  • Volume /app/data
  • Generated INITIAL_PASSWORD, JWT_SECRET, API_KEY_SECRET, OMNIROUTE_WS_BRIDGE_SECRET, MACHINE_ID_SALT
  • REQUIRE_API_KEY=true for /v1 and MCP HTTP
  • Public HTTPS domain for /api/mcp/stream and /api/mcp/sse

Implementation Details for OmniRoute MCP (Using OmniRoute official docker image)

The container is TypeScript/Next.js on Node 22/24. MCP ships in-process: streamable HTTP at /api/mcp/stream, SSE at /api/mcp/sse, and local stdio via omniroute --mcp (stdio is for a laptop CLI, not the Railway public URL). Clients authenticate with a dashboard API key. Dashboard and /v1 share the same process and SQLite file. Default OMNIROUTE_MEMORY_MB=1024 is fine for dashboard and light chat; bump it for Responses-heavy agents per upstream guidance.

How does OmniRoute MCP compare against other AI gateway platforms

OmniRoute MCP vs 9Router

  • MCP: OmniRoute has a built-in MCP server. 9Router does not.
  • Shared ground: Both MIT, one container, SQLite, port 20128, RTK compression.
  • Catalog: OmniRoute lists a larger provider catalog and more strategies. 9Router is lighter for simple Claude Code proxying.
  • RAM: OmniRoute wants more memory under agent/Responses load.

OmniRoute MCP vs LiteLLM

  • Stack: OmniRoute is TypeScript with SQLite. LiteLLM is Python and often needs Postgres for teams and budgets.
  • MCP: Native MCP here; LiteLLM is not an MCP control plane out of the box.
  • Fit: LiteLLM wins multi-team spend controls. OmniRoute wins coding-tool routing plus agent-visible gateway tools.

OmniRoute MCP vs OpenRouter

  • Hosting: Self-hosted vs SaaS only.
  • Billing: No OmniRoute markup; you pay providers and Railway. OpenRouter sells credits with fees.
  • Control: MCP lets agents inspect combos and breakers. OpenRouter selection stays on their side.

OmniRoute MCP vs CLIProxyAPI

  • Purpose: CLIProxyAPI is a Go proxy that wraps CLI subscriptions as an API.
  • Breadth: OmniRoute also fronts subscriptions, then adds free tiers, compression, analytics, dashboard, MCP, and A2A.
  • Weight: CLIProxyAPI is leaner if subscription bridging is all you need.

How to use OmniRoute MCP (the OSS AI gateway)?

Deploy and wait for /healthz. Log into /dashboard with INITIAL_PASSWORD and change it. Connect providers, create an API key. For MCP, add a server entry in Claude Code or Cursor pointing at https://YOUR-DOMAIN/api/mcp/stream (or /api/mcp/sse) with Authorization: Bearer YOUR-KEY. For chat tools, set base URL to https://YOUR-DOMAIN/v1 with the same key and model "auto" or a specific id. Do not expect omniroute --mcp stdio to work as the remote transport; use HTTP MCP on Railway.

How to self host OmniRoute MCP on other VPS Services (OmniRoute MCP self hosting guide)

Clone the Repository

git clone https://github.com/diegosouzapw/OmniRoute.git, or skip source with npm install -g omniroute / Docker image diegosouzapw/omniroute:3.8.51.

Install Dependencies

Docker is the easy path. From source you need a current Node (22/24 per upstream) so better-sqlite3 can build.

Configure Environment Variables

PORT=20128, HOSTNAME=0.0.0.0, DATA_DIR=/app/data, BASE_URL and NEXT_PUBLIC_BASE_URL to your HTTPS origin, AUTH_COOKIE_SECURE=true, REQUIRE_API_KEY=true, OMNIROUTE_MEMORY_MB as needed, plus the five generated-style secrets.

Start the OmniRoute MCP Application

Run the image or omniroute / npm start. Put TLS in front if you are not on Railway. Confirm /healthz, /dashboard, /v1, and /api/mcp/stream.

Official Pricing of OmniRoute MCP (OmniRoute MCP pricing)

OmniRoute is MIT and free. No paid OmniRoute plan. You pay provider usage and Railway (or VPS) compute. Free tiers in the catalog are provider free tiers with their own limits and terms, not unlimited OmniRoute credits.

OmniRoute MCP cloud vs self hosted comparison (Pricing, features, costs, and more)

There is no required OmniRoute SaaS control plane. Railway is managed self-hosting. A VPS is the same image with more manual TLS. Features (MCP, /v1, dashboard) match wherever you run the container.

Monthly cost of self hosting OmniRoute MCP on Railway

Light single-user use at 1-2 GB is often about $5-15/mo. Coding agents on /v1/responses need higher memory and cost more. Railway's $5 trial covers early smoke tests. Provider bills are separate.

System Requirements for Hosting OmniRoute MCP on a VPS

1 vCPU and 1 GB RAM for dashboard/light chat. Plan ~8 GB heap / ~10 GB container when Responses agents are the main load. A few GB disk for SQLite. Public HTTPS for remote MCP clients.

Frequently Asked Questions (FAQs)

How do I authenticate MCP on Railway?

Create an API key in /dashboard. Send it as a Bearer token to /api/mcp/stream or /api/mcp/sse on your public domain. REQUIRE_API_KEY is already true.

Can agents change routing through MCP?

They can inspect and operate gateway controls the MCP server exposes (health, combos, quotas, routing-related tools). Do not put provider API keys in chat. Exact tool lists change with releases; check the running catalog after deploy.

What memory should I use for Responses API coding agents?

Default OMNIROUTE_MEMORY_MB=1024 is for light chat. Upstream guidance for /v1/responses agents is about 8192 heap and roughly 10 GB container memory. Raise both on Railway before long agent loops.

Are the 150+ free tiers unlimited?

No. They are provider free tiers behind your own accounts. Limits and terms vary. Entries marked tos: avoid are excluded from auto routing by default.

Does A2A run with MCP?

Yes. A2A is built in alongside MCP and /v1 on the same service. No second container.

Why not use omniroute --mcp on Railway?

That flag starts stdio MCP for local IDE wiring. On Railway the gateway already serves HTTP MCP. Point remote clients at the HTTPS URLs instead. Keep the volume attached; it holds all state.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
7
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
86