Railway logo
Developer ToolsAuth: OAuthHosting: Hosted or self-hosted

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

ToolWhat it does
whoamiReturn the authenticated Railway account / identity.
list-projectsList the projects in your Railway workspace.
create-projectCreate a new Railway project.
list-servicesList the services within a project.
redeployRedeploy a service to apply changes or restart it.
accept-deployApprove/accept a pending deployment.
railway-agentDelegate complex, multi-step infrastructure tasks to Railway's agent.

Connect the Railway MCP server

Claude Code (remote, OAuth)

  1. 1

    Add the remote server

    Run: claude mcp add --transport http railway https://mcp.railway.com

  2. 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. 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. 1

    Open MCP settings

    In Cursor, go to Settings > MCP (or edit ~/.cursor/mcp.json).

  2. 2

    Add the server

    Add an entry: {"mcpServers":{"railway":{"url":"https://mcp.railway.com"}}} and save.

  3. 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

After a hotfix is merged, an agent calls redeploy on the production service

It triggers a redeployment and confirms when the new version is live, reducing the time between merge and deploy.

An agent uses create-project to spin up a staging environment for a feature branch

It creates a new Railway project with the same service configuration as production, ready for QA testing.

A team lead asks the agent for an overview of all Railway projects and services

It calls list-projects and list-services to return a structured inventory: project names, service counts, and deployment status.

An agent reviews pending deployments and calls accept-deploy for those that pass automated checks

It approves deployments that meet the criteria and flags any that need manual review, streamlining the deploy pipeline.

An agent delegates a complex infrastructure task (e.g., scaling, networking, environment setup) to railway-agent

Railway's built-in agent handles the multi-step infrastructure change, returning a summary of what was configured.

During an outage, an agent calls redeploy to roll back a service to its previous working state

It triggers a redeployment of the last-known-good version, restoring service availability within minutes.

An agent runs whoami to verify which Railway account and workspace are currently authenticated

It confirms the identity and permissions before performing any deployment or project operations.

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.

Can the Railway MCP server deploy services?

Yes. The redeploy tool triggers a redeployment of any service, and accept-deploy approves pending deployments — covering the core deploy workflow.

Does it support creating new Railway projects?

Yes. The create-project tool creates a new project in your Railway workspace, useful for spinning up staging environments or feature-branch deployments.

What does the railway-agent tool do?

It delegates complex, multi-step infrastructure tasks to Railway's own AI agent — like configuring networking, scaling, or environment setup — and returns a summary of the changes made.