---
title: "Deploy Supergateway"
description: "Run stdio MCP servers as one remote, key-protected Streamable HTTP URL"
category: "AI/ML"
url: https://railway.com/deploy/supergateway
---

# Deploy Supergateway

Run stdio MCP servers as one remote, key-protected Streamable HTTP URL

**[Deploy Supergateway on Railway](https://railway.com/template/supergateway)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/supergateway/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** AI/ML

## Template content

### Supergateway https://avatars.githubusercontent.com/u/152935339?v=4

- **Source:** https://github.com/aalfath/supergateway-railway-template
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host Supergateway on Railway

Supergateway is an open-source (MIT) gateway that runs MCP servers built for stdio and serves them over the network as Streamable HTTP, SSE or WebSockets. AI clients such as Claude, Cursor or your own agents can then use those tools from anywhere through one URL, without installing each server locally.

## About Hosting Supergateway

This template runs Supergateway 4.2.3 (official `-uvx` image, pinned by digest) as one service, built from a public GitHub repo. It serves two MCP servers on `https://YOUR-DOMAIN/mcp`. The memory server keeps a knowledge graph. The filesystem server reads and writes files in a sandboxed folder. Both keep their data on a Railway volume at `/data`. Every request needs the generated `SUPERGATEWAY_API_KEY`. The `/healthz` endpoint stays open, so Railway can check the service. A small front queues requests once the memory limit is reached, so the service runs on the 0.5 GB plan. If the gateway stops, the service restarts. You can replace the default servers with any stdio MCP server (`npx` or `uvx`).

## Common Use Cases

* Give Claude, Cursor or another MCP client a remote memory and a file workspace that persist between sessions
* Host stdio-only MCP servers (from npm or PyPI) behind one authenticated HTTPS URL for a team or for hosted agents
* Run your own MCP servers next to your other Railway services, reachable over the private network

## Dependencies for Supergateway Hosting

* A Railway volume mounted at `/data` (files, memory graph, package cache)
* An MCP client that speaks Streamable HTTP and can send an `Authorization` header

### Deployment Dependencies

* [Supergateway on GitHub](https://github.com/supercorp-ai/supergateway)
* [Template repo (Dockerfile, start script, default config)](https://github.com/aalfath/supergateway-railway-template)
* [Model Context Protocol reference servers](https://github.com/modelcontextprotocol/servers)

### Implementation Details

After the deploy, copy `SUPERGATEWAY_API_KEY` from the service's Variables tab and add the server to your client. For example, in Claude Code:

```sh
claude mcp add --transport http supergateway https://YOUR-DOMAIN/mcp --header "Authorization: Bearer YOUR-API-KEY"
```

Or in a client that uses a JSON config:

```json
{ "mcpServers": { "supergateway": { "type": "http", "url": "https://YOUR-DOMAIN/mcp", "headers": { "Authorization": "Bearer YOUR-API-KEY" } } } }
```

To serve other MCP servers, set `SUPERGATEWAY_CONFIG` to a Supergateway config file (JSON, or base64 of it), or put one at `/data/supergateway.json`. Start from the repo's `default-config.json`. Each request starts the servers again, at about 80 MB with the defaults. On 0.5 GB, 4 requests run at once and the rest wait. Set `SUPERGATEWAY_MAX_CONCURRENT` to change that. When we bump the Supergateway version in the repo, Railway shows an update notice on your project. The repo's `CHANGELOG.md` lists what changed.

## Why Deploy Supergateway 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 Supergateway 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.



## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/supergateway
