|Docs

Railway MCP Server

The Railway MCP Server is a Model Context Protocol (MCP) server that enables natural language interaction with your Railway projects and infrastructure.

With this server, you can ask your IDE or AI assistant to create projects, deploy templates, create/select environments, or pull environment variables.

The Railway MCP Server is open-source and available on GitHub.

Understanding MCP and Railway MCP server

The Model Context Protocol (MCP) defines a standard for how AI applications (hosts) can interact with external tools and data sources through a client-server architecture.

  • Hosts: Applications such as Cursor, VS Code, Claude Desktop, or Windsurf that connect to MCP servers.
  • Clients: The layer within hosts that maintains one-to-one connections with individual MCP servers.
  • Servers: Standalone programs (like the Railway MCP Server) that expose tools and workflows for managing external systems.

The Railway MCP Server acts as the server in this architecture, translating natural language requests into CLI workflows powered by the Railway CLI.

Prerequisites

To get started with the MCP server, you need to have the Railway CLI installed and authenticated.

Installation

CLI installer

To install the Railway CLI and configure Railway agent support, including MCP, in one step:

If the CLI is already installed, configure MCP for detected tools with:

You can also run the full agent setup flow, which installs agent skills, configures MCP, and checks authentication:

Use railway mcp install --remote to configure supported tools with the hosted MCP server at https://mcp.railway.com instead of the local stdio server.

Use railway mcp install --agent <agent> to target a specific supported tool. Supported values are claude-code, cursor, factory-droid, copilot, codex, and opencode.

Cursor

You can one-click install the MCP server in Cursor by clicking the "Add to Cursor" button below:

Install MCP Server

Alternatively, you can add the following configuration to your .cursor/mcp.json file manually:

VS Code

Add the following configuration to your .vscode/mcp.json file:

Claude Code

To install the MCP server in Claude Code, you can use the following command:

Codex

To install the MCP server in the OpenAI Codex CLI, you can use the following command:

GitHub Copilot CLI

Add the following configuration to your ~/.copilot/mcp-config.json file:

Alternatively, run /mcp add from inside an active Copilot CLI session and follow the prompts.

Factory

To install the MCP server in Factory, you can use the following command:

Or run /mcp from inside a droid session to manage MCP servers interactively.

OpenCode

Add the following configuration to your opencode.json file:

Example usage

  • Create and deploy a new app

  • Deploy from a template

  • Pull environment variables

  • Create a new environment

Available MCP tools

The Railway MCP Server provides a curated set of tools. Your AI assistant will automatically call these tools based on the context of your request.

  • Status

    • check-railway-status - Verify CLI installation and authentication
  • Project Management

    • list-projects - List all projects
    • create-project-and-link - Create a project and link it to the current directory
  • Service Management

    • list-services - List project services
    • link-service - Link a service to the current directory
    • deploy - Deploy a service
    • deploy-template - Deploy from the Railway Template Library
  • Environment Management

    • create-environment - Create a new environment
    • link-environment - Link environment to current directory
  • Configuration & Variables

    • list-variables - List environment variables
    • set-variables - Set environment variables
    • generate-domain - Generate a Railway domain
  • Monitoring & Logs

    • get-logs - Retrieve service logs

Security considerations

Under the hood, the Railway MCP Server runs the Railway CLI commands. While destructive operations are intentionally excluded and not exposed as MCP tools, you should still:

  • Review actions requested by the LLM before running them.
  • Restrict access to ensure only trusted users can invoke the MCP server.
  • Avoid production risks by limiting usage to local development and non-critical environments.

Feature requests

The Railway MCP Server is a work in progress. We are actively working on adding more tools and features. If you have a feature request, leave your feedback on this Central Station post.