Railway MCP server

Integrates with Railway's platform and CLI to enable deployment, service management, environment configuration, and infrastructure monitoring through conversational workflows.
Back to servers
Setup instructions
Provider
Railway
Release date
Aug 10, 2025
Language
Go
Stats
52 stars

The Railway MCP Server provides a local Model Context Protocol interface for interacting with your Railway account. It offers opinionated workflows and tools for managing Railway resources through AI-powered assistance in compatible editors like Cursor and VS Code.

Prerequisites

The Railway MCP Server requires the Railway CLI to function properly.

Installation

For Cursor

You can add the Railway MCP Server to Cursor by clicking the button below:

Install MCP Server (Cursor)

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

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

For VS Code

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

{
  "servers": {
    "railway-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@railway/mcp-server"]
    }
  }
}

Usage Examples

Creating and Deploying a Project

To create a new project, deploy it, and generate a domain, you can use natural language instructions like:

Create a Next.js app in this directory and deploy it to Railway. Make sure to also assign it a domain. Since we're starting from scratch, there is no need to pull information about the deployment or build for now

Deploying from Templates

Deploy database systems or other services using templates with prompts like:

Deploy a Postgres database

Or for more specific requirements:

Deploy a single node Clickhouse database

You can browse all available templates at Railway Templates.

Managing Environment Variables

To pull environment variables for your project:

I would like to pull environment variables for my project and save them in a .env file

Creating and Setting Environments

To create a new environment for testing:

I would like to create a new development environment called `development` where I can test my changes. This environment should duplicate production. Once the environment is created, I want to set it as my current linked environment

Available Tools

The Railway MCP Server provides the following tools for managing your Railway infrastructure:

Status and Authentication

  • check-railway-status - Verifies CLI installation and authentication

Project Management

  • list-projects - Lists all Railway projects
  • create-project-and-link - Creates a new project and links it to the current directory

Service Management

  • list-services - Lists all services in a project
  • link-service - Links a service to the current directory
  • deploy - Deploys a service
  • deploy-template - Deploys a template from the template library

Environment Management

  • create-environment - Creates a new environment
  • link-environment - Links an environment to the current directory

Configuration & Variables

  • list-variables - Lists environment variables
  • set-variables - Sets environment variables
  • generate-domain - Generates a railway.app domain for a project

Monitoring & Logs

  • get-logs - Retrieves build or deployment logs for a service

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "railway-mcp-server" '{"command":"npx","args":["-y","@railway/mcp-server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later