home / mcp / railway mcp server

Railway MCP Server

Provides a local MCP server with workflows and tools to manage Railway projects, services, environments, variables, and domains.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "railwayapp-railway-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@railway/mcp-server"
      ]
    }
  }
}

You can run a local MCP server that provides practical workflows to manage Railway resources. It runs alongside your development environment and exposes a focused set of tools for creating projects, linking services, deploying, and handling environment variables and domains. This guide shows how to install, run, and integrate the Railway MCP Server with common MCP clients so you can automate and streamline your Railway work without destructive actions.

How to use

Connect an MCP client to the Railway MCP Server to perform project setup, service deployment, environment management, and domain generation. You can start the server locally and then configure your MCP client to load the server from your development instance. The server provides a curated set of tools for common Railway tasks such as listing projects, creating and linking projects, deploying services or templates, managing environments and variables, and retrieving logs.

How to install

Prerequisites you must have before running the server locally or installing via an MCP client.

Prerequisites include: Node.js 20.x or newer and pnpm 10.x or newer.

Option 1 — Quick start using an MCP client (recommended for most workflows)

Run the MCP server using your preferred package runner. The following command starts the server locally and keeps it running for interactive use with MCP clients.

Start the server with the standard MCP command:

pnpm dev

Configuration for MCP clients

Configure your MCP client so it can connect to the running server. Below are the example configurations to load the Railway MCP Server into two common MCP clients. Update paths as needed to reflect where your server is running.

{
  "mcpServers": {
    "railway-mcp-server": {
      "command": "node",
      "args": ["/path/to/railway-mcp-server/dist/index.js"]
    }
  }
}

Alternative: run from source (development workflow)

If you want to develop or customize the server locally, you can clone the repository, install dependencies, and run the development server. This builds a live server in memory and automatically rebuilds on changes.

Follow these steps in sequence.

Clone the repository, install dependencies, and start the dev server.

git clone https://github.com/railwayapp/railway-mcp-server.git
cd railway-mcp-server
pnpm install
pnpm dev

Notes for usage

When you start the server in development mode, a build is generated under dist/ and will rebuild automatically as you make changes.

Security and behavior

The MCP server is designed to avoid destructive actions by default. You should still monitor which tools and commands are being executed on your Railway resources.

Available tools

check-railway-status

Verifies that the Railway CLI is installed and the user is logged in.

list-projects

Lists all Railway projects in your account.

create-project-and-link

Creates a new project and links it to the current directory.

list-services

Lists all services within a selected project.

link-service

Links a service to the current directory for management.

deploy

Deploys a service to Railway.

deploy-template

Deploys a template from the Railway Template Library.

create-environment

Creates a new environment for development, staging, or production.

link-environment

Links a specific environment to the current directory.

list-variables

Lists environment variables for the linked project or environment.

set-variables

Sets or updates environment variables in the linked context.

generate-domain

Generates a railway.app domain for a project.

get-logs

Retrieves build or deployment logs for a service. CLI version dependent behavior is described: v4.9.0+ supports lines and filter for log output; older versions stream logs without filtering.