|Docs

railway mcp

Connect AI coding tools to the Railway MCP server at mcp.railway.com, or install the configuration into supported tools.

Usage

Run the command without a subcommand to connect to the MCP server, or use the install subcommand to write editor configuration.

railway mcp [COMMAND] [OPTIONS]

Running railway mcp with no subcommand connects to mcp.railway.com over stdio. The command authenticates every request with your railway login credentials, so connecting doesn't require a second authentication. This is the command used by the MCP client configurations that railway mcp install writes.

Note: Connecting to mcp.railway.com by default requires CLI version 5.44.0 or later. On earlier versions, railway mcp starts the in-process server described in Run the server locally.

Subcommands

SubcommandDescription
installInstall Railway's MCP server config into AI coding tools
localServe an in-process MCP server over stdio, without reaching mcp.railway.com. See Run the server locally
proxyBehaves the same as running railway mcp with no subcommand. Kept so configurations written before it became the default keep working

Options for

The install command can target specific tools and select how the connection authenticates.

FlagDescription
--agent <AGENT>Target a specific tool instead of all detected tools. Can be used more than once
--oauthConfigure the direct https://mcp.railway.com endpoint so the MCP client handles OAuth. Takes precedence over --remote
--localConfigure the in-process local server (railway mcp local) instead of the default connection
--remoteConfigure the default CLI connection to mcp.railway.com. This is already the default, and the flag is kept as a compatibility alias

Choose a connection

The MCP server supports credential reuse through the CLI or direct OAuth through the MCP client.

ConnectionInstall commandAuthentication
CLI (default)railway mcp installReuses your railway login credentials
OAuthrailway mcp install --oauthOAuth managed by the MCP client

The CLI connection keeps credentials out of editor configuration. It refreshes your Railway access token when needed and forwards requests to mcp.railway.com. Run railway login if a tool call reports that you aren't authenticated. The next tool call uses the new login without restarting the editor.

Supported agents

Pass one or more of these values to --agent.

AgentValue
Claude Codeclaude-code
Cursorcursor
Factory Droidfactory-droid
GitHub Copilotcopilot
OpenAI Codexcodex
OpenCodeopencode

Installed MCP entries

The installed entry depends on the target tool and connection.

AgentCLI (default)OAuthLocal server (--local)
Claude Codecommand: "railway", args: ["mcp"]type: "http", url: "https://mcp.railway.com"command: "railway", args: ["mcp", "local"]
Cursorcommand: "railway", args: ["mcp"]url: "https://mcp.railway.com"command: "railway", args: ["mcp", "local"]
Factory Droidtype: "stdio", command: "railway", args: ["mcp"], disabled: falsetype: "http", url: "https://mcp.railway.com", disabled: falsetype: "stdio", command: "railway", args: ["mcp", "local"], disabled: false
GitHub Copilottype: "local", command: "railway", args: ["mcp"], tools: ["*"]type: "http", url: "https://mcp.railway.com", tools: ["*"]type: "local", command: "railway", args: ["mcp", "local"], tools: ["*"]
OpenCodetype: "local", command: ["railway", "mcp"], enabled: truetype: "remote", url: "https://mcp.railway.com", enabled: truetype: "local", command: ["railway", "mcp", "local"], enabled: true
OpenAI Codexcommand = "railway", args = ["mcp"]url = "https://mcp.railway.com"command = "railway", args = ["mcp", "local"]

railway mcp install merges the Railway server entry into existing configs without removing other MCP servers.

Note: Configurations that run railway mcp proxy continue to work and connect to mcp.railway.com. Re-run railway mcp install to update them to the bare railway mcp form.

Examples

These examples cover detected tools, targeted installs, and OAuth.

Install MCP for detected tools

Run the install command without selectors to configure detected tools with the default CLI connection.

railway mcp install

Install MCP for a specific tool

Pass --agent to configure one tool explicitly.

railway mcp install --agent cursor

Install MCP for multiple tools

Repeat --agent to update more than one tool in the same command.

railway mcp install --agent claude-code --agent copilot

Install MCP with OAuth

Use direct OAuth when your editor can authenticate an HTTP MCP server without the CLI.

railway mcp install --oauth

Connect through the CLI

MCP clients connect to the Railway MCP server through the CLI by running:

railway mcp

The process communicates with the editor over stdio and forwards requests to mcp.railway.com over HTTPS, attaching your railway login credentials to each request. The railway mcp install command writes this configuration for supported tools automatically.

Connect with OAuth

MCP clients that support OAuth can connect directly to https://mcp.railway.com. The client manages OAuth without using the Railway CLI. Run railway mcp install --oauth to write this configuration for supported tools.

Run the server locally

The CLI also ships an in-process MCP server for machines that can't reach mcp.railway.com, for example on egress-restricted networks. It talks directly to the Railway API using your CLI credentials and exposes a different tool set from mcp.railway.com. MCP clients start it by running:

railway mcp local

Pass --local to the install command to write this configuration for supported tools:

railway mcp install --local

These pages cover agent setup and the MCP server's capabilities.