Get the FREE Ultimate OpenClaw Setup Guide →

railway

Official Railway MCP Server for interacting with your Railway account

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio railwayapp-railway-mcp-server npx -y @railway/mcp-server

How to use

The Railway MCP Server provides a focused set of tools to manage Railway resources from your MCP client. It exposes commands to verify your Railway CLI setup, manage projects, services, environments, and configuration variables, deploy templates, and fetch logs. This makes it straightforward to create or link projects, deploy services (including templates), generate domains, and pull or set environment variables directly from your MCP client. The server automatically detects the Railway CLI version to adapt its behavior and feature set accordingly, ensuring compatibility with newer CLI capabilities when available.

To use the server, add it to your MCP client configuration (Cursor, VSCode, Claude Code, etc.) and point the client at the server executable provided by the npx package. Once configured, you can run tools such as list-projects, create-project-and-link, list-services, deploy, deploy-template, create-environment, link-environment, list-variables, set-variables, and generate-domain. You can also fetch logs with get-logs, with enhanced capabilities on Railway CLI v4.9.0+ for filtering and line-limited output.

How to install

Prerequisites:

  • Node.js (recommended: latest LTS) - required for the npx-based installation
  • Access to npm or corepack for npx
  • Railway CLI installed and authenticated (as the MCP server relies on the Railway CLI)

Installation steps:

  1. Install and run the MCP server via npx:
npx add-mcp @railway/mcp-server --name railway
  1. (Optional) Add to Cursor configuration:
{
  "mcpServers": {
    "railway-mcp-server": {
      "command": "npx",
      "args": ["-y", "@railway/mcp-server"]
    }
  }
}
  1. (Optional) Add to VS Code MCP client configuration:
{
  "servers": {
    "railway-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@railway/mcp-server"]
    }
  }
}
  1. Start the server (as needed by your environment) and point your MCP client at the running server. The README notes that you should configure your MCP client to execute the server via npx and the package name.

Additional notes

Tips and considerations:

  • This MCP server uses the Railway CLI under the hood; ensure the CLI is installed and authenticated before use.
  • The server does not implement destructive actions by design, so exercise caution when invoking deploy or template deployment tools.
  • The provided tooling covers common workflows: project and environment management, service deployment, variable handling, and domain generation.
  • If you run into issues, ensure your MCP client is configured to invoke the server via the same Node environment and that your shell can resolve npx correctly.
  • For advanced log handling, use get-logs with the Railway CLI v4.9.0+ to leverage lines filtering and search capabilities.

Related MCP Servers

Sponsor this space

Reach thousands of developers