home / mcp / railway mcp server

Railway MCP Server

An unofficial and community-built MCP server for integrating with https://railway.app

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "antonioevans-railway-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@jasontanswe/railway-mcp"
      ],
      "env": {
        "RAILWAY_API_TOKEN": "YOUR_API_TOKEN_HERE"
      }
    }
  }
}

You can connect MCP clients to Railway.app and manage projects, deployments, services, and variables through simple, token-authenticated commands. This MCP server lets you control Railway resources from supported clients using straightforward, scriptable actions.

How to use

Use an MCP client (for example Claude Desktop or Cursor) to interact with Railway resources by running the provided MCP commands. You can authenticate with a Railway API token and then list, create, restart, or delete projects, services, environments, and variables. You can also create services from GitHub repositories or Docker images, monitor deployments, and manage networks and volumes through the MCP endpoints.

Key capabilities include authenticating with your Railway API token, listing and inspecting projects, environments, services, and deployments, creating services from repositories or images, updating variables, and restarting services as needed. You can also view deployment logs and health status to monitor your infrastructure.

How to install

Prerequisites you need before installation are the following:

  • Node.js 18 or newer
  • An active Railway account
  • A Railway API token (create one at Railway account settings)

Choose an installation path for your MCP client integration. You can install automatically with Smithery or set up manually for specific clients like Cursor or Claude Desktop.

Install via Smithery for Claude Desktop directly with this command:

npx -y @smithery/cli install @jason-tan-swe/railway-mcp --client claude

Install for Cursor by running this command and providing your Railway API token when prompted or via the passed argument:

npx -y @smithery/cli@latest run @jason-tan-swe/railway-mcp --config "{\"railwayApiToken\":\"token\"}"

Manual installation for Cursor

If you prefer a manual setup for Cursor, follow these steps.

1. Open your Cursor settings and go to the MCP section.

2. Add a new MCP server and name it for clarity (e.g., railway_mcp).

3. Use this command, substituting your Railway API token for <RAILWAY_API_TOKEN>:

npx -y @jasontanswe/railway-mcp <RAILWAY_API_TOKEN>

Manual installation for Claude

If you use Claude Desktop, configure the MCP server in Claude’s config with your Railway API token.

1. Locate Claude desktop config paths for your OS.

2. Add the railway-mcp server with the following settings and your API token either in the env or via the config:

{
  "railway": {
    "command": "npx",
    "args": ["-y", "@jasontanswe/railway-mcp"],
    "env": {
      "RAILWAY_API_TOKEN": "your-railway-api-token-here"
    }
  }
}

Example Claude/Cursor configurations

If you manage multiple MCP servers, your configuration might include the railway-mcp entry alongside other servers.

{
  "mcpServers": {
    "railway": {
      "command": "npx",
      "args": ["-y", "@jasontanswe/railway-mcp"],
      "env": {
        "RAILWAY_API_TOKEN": "your-railway-api-token-here"
      }
    }
  }
}

Security and tokens

Railway API tokens grant full access to your Railway account. Treat tokens as sensitive credentials. When using environment variables, the token is stored in the client configuration file and is masked in outputs. All communications use HTTPS to secure data in transit.

Troubleshooting

If you encounter authentication issues, verify that your Railway API token is valid and has the required permissions. If the token is provided via environment variables, ensure it is properly formatted in the config file. For connection problems, confirm you’re using the latest server version and that Node.js 18+ is installed. Restart the MCP client after configuration changes.

Notes and recommendations

This MCP server works best with clients that can access a terminal or have Git integration. It orchestrates containers and streamlines deployments for Railway projects, environments, and services.

Example workflows

Setting up a new service: List projects, create a new service from a template or repository, add environment variables, then view deployment status.

Managing environment variables: List variables, create or update as needed, and remove obsolete ones.

Available tools

configure

Set your Railway API token for authentication and enable subsequent commands to access your Railway projects and deployments.

project-list

List all projects in your Railway account and inspect project details.

project-info

Get detailed information about a specific project.

project-create

Create a new project, with optional team association.

project-delete

Delete an existing project.

project-environments

List all environments within a project.

service-list

List all services within a specific project.

service-info

Get detailed information about a specific service.

service-create-from-repo

Create a new service from a GitHub repository.

service-create-from-image

Create a new service from a Docker image.

service-delete

Delete a service from a project.

service-restart

Restart a service in a specific environment.

service-update

Update service configuration (build/start commands, etc.).

deployment-list

List recent deployments for a service.

deployment-trigger

Trigger a new deployment for a service.

deployment-logs

Get logs for a deployment.

deployment-health-check

Check the health status of a deployment.

variable-list

List variables for a service or environment.

variable-set

Create or update a variable.

variable-delete

Delete a variable.

variable-copy

Copy variables between environments.

database-list-types

List available database types that can be deployed.

database-deploy

Deploy a new database service.