Railway MCP Server
Connect AI agents to Railway to create projects, deploy services, and manage env vars via natural language.
Updated
What is Railway MCP?
The Railway MCP server is a Model Context Protocol server that lets AI agents and IDEs interact with your Railway account in natural language — creating projects, deploying services, and managing deployments and environment variables.
Railway offers two flavors. The remote (hosted) server lives at https://mcp.railway.com and requires no local install or CLI: clients connect over HTTP and authenticate through OAuth in the browser, where you consent and choose which workspaces and projects the client can access. The local server runs through the Railway CLI (railway mcp) on your machine and shares the CLI's auth and project context — handy for coding-agent workflows that want a broader set of CRUD tools.
The remote server exposes a focused tool set plus a railway-agent entry point that can delegate more complex, multi-step tasks. Because it's hosted by Railway and OAuth-scoped, it's the simplest path for connecting Claude or Cursor to your infrastructure without managing local credentials.
Tools the Railway MCP server exposes
| Tool | What it does |
|---|---|
| whoami | Return the authenticated Railway account / identity. |
| list-projects | List the projects in your Railway workspace. |
| create-project | Create a new Railway project. |
| list-services | List the services within a project. |
| redeploy | Redeploy a service to apply changes or restart it. |
| accept-deploy | Approve/accept a pending deployment. |
| railway-agent | Delegate complex, multi-step infrastructure tasks to Railway's agent. |
Connect the Railway MCP server
Claude Code (remote, OAuth)
- 1
Add the remote server
Run: claude mcp add --transport http railway https://mcp.railway.com
- 2
Authenticate
Trigger any Railway tool; Claude opens an OAuth browser flow where you sign in to Railway and pick the workspaces/projects to grant access to.
- 3
Verify
Run /mcp in Claude Code to confirm the railway server is connected, then ask it to list your projects.
Cursor (remote, OAuth)
- 1
Open MCP settings
In Cursor, go to Settings > MCP (or edit ~/.cursor/mcp.json).
- 2
Add the server
Add an entry: {"mcpServers":{"railway":{"url":"https://mcp.railway.com"}}} and save.
- 3
Authorize
Cursor prompts an OAuth browser login to Railway; consent and select the workspaces/projects to expose, then invoke a Railway tool from chat.
Sample use cases
Spin up a new environment from chat
Agent calls create-project and list-services to scaffold and inspect a Railway project without leaving the IDE.
Automated redeploys after CI
A scheduled or event-triggered Gamut agent calls redeploy/accept-deploy to ship the latest build.
Infrastructure inventory
Use whoami and list-projects to audit which workspaces and services exist across an account.
Security & permissions
The remote Railway MCP server authenticates via OAuth in the browser — there are no static API keys to paste. During consent you choose which workspaces and projects the client can access, scoping what the agent can see and change. Tokens are short-lived and revocable at any time from your Railway account settings.
Granted tools can create projects and trigger deployments, so treat access as you would deploy credentials: connect only trusted clients, review actions an LLM proposes before approving (especially deploys/redeploys), and grant the narrowest workspace/project scope you need.
Using Railway MCP with Gamut
In a Gamut workflow, Railway becomes a connected tool a Gamut agent can call on a schedule or in response to an event — Gamut manages the OAuth connection so the agent can list projects, inspect services, and trigger a redeploy or accept-deploy as part of an automated runbook. For example, a deploy-orchestration agent could, on a webhook from CI, redeploy the affected Railway service and report status to Slack. Scope the connection to the relevant workspace/projects and keep human review on destructive deploy steps.
Frequently asked questions
What is the Railway MCP server?
It's an official Model Context Protocol server from Railway that lets AI agents and IDEs manage your Railway infrastructure — creating projects, deploying services, and managing deployments — in natural language. The hosted version runs at https://mcp.railway.com.
Is the Railway MCP server free?
The MCP server itself is provided by Railway and requires a Railway account. Railway offers a free trial (a one-time $5 credit, no credit card required); paid usage starts at the $5/month Hobby plan plus per-second resource costs for anything you actually host.
Is the Railway MCP server hosted or self-hosted?
Both. Railway offers a remote, hosted server at https://mcp.railway.com (OAuth, no install) and a local server that runs through the Railway CLI (railway mcp) and shares your CLI auth and project context.
How do I connect the Railway MCP server to Claude Code or Cursor?
For Claude Code, run claude mcp add --transport http railway https://mcp.railway.com and complete the OAuth browser login. For Cursor, add {"mcpServers":{"railway":{"url":"https://mcp.railway.com"}}} to your MCP config and authorize via OAuth when prompted.