MCP HubMCP Hub
jason-tan-swe

railway-mcp

by: jason-tan-swe

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

24created 28/02/2025
Visit
railway
community

πŸ“ŒOverview

Purpose: The Railway MCP Server aims to facilitate managing Railway.app infrastructure through natural language commands, enabling efficient deployment and monitoring of services.

Overview: This Model Context Protocol (MCP) server integrates seamlessly with Railway.app, allowing users to manage projects, services, and variables. It is designed for use with various MCP clients, streamlining workflows and enhancing user interaction with infrastructure management.

Key Features:

  • Authentication with Railway API tokens: Ensures secure access to Railway services, allowing users to manage their projects and environment effectively.

  • Project management: Users can list, retrieve information, and delete projects effortlessly, helping to maintain organization in their Railway.app accounts.

  • Deployment management: Facilitates listing and restarting deployments, allowing quick response to issues or updates.

  • Service management: Users can create services from GitHub repositories or Docker images, which simplifies deployment from existing code.

  • Variable management: Offers capabilities to list, create, update, and delete environment variables, ensuring flexibility in configurations.

  • Service Network and Volume management: Enhances the control over service interactions and data storage while managing dependencies effectively.


Railway MCP Server

Let Claude and other MCP clients manage your Railway.app infrastructure. Deploy services, manage variables, and monitor deployments β€” all through natural language.

A Model Context Protocol (MCP) server for integrating with the Railway.app platform.

smithery badge


Table of Contents

Features β€’ Installation β€’ Available Tools β€’ Example Workflows β€’ Security β€’ Troubleshooting β€’ Contributing


Features

StatusMeaning
βœ…Complete
πŸš§πŸ”¨β³Being Built or Needs Testing
❌Not Built at the moment
  • βœ… Authentication with Railway API tokens
  • βœ… Project management (list, info, delete)
  • βœ… Deployment management (list, restart)
  • βœ… Service management (create from GitHub repo or Docker image, list)
  • βœ… Variable management (list, create/update, delete)
  • βœ… Service Network management
  • βœ… Volume management
  • ❌ Full support for all templates
    • πŸš§πŸ”¨β³ Database template support
    • Automatic database and networking workflows
  • πŸš§πŸ”¨β³ Most commonly used workflows
  • ❌ Automatic GitHub repository linking for services

Installation

Prerequisites

Quick Start

This MCP server is designed to work with MCP Clients like:

  • Claude for Desktop | βœ… Battle-Tested
  • Cursor | βœ… Needs Testing
  • Cline | πŸš§πŸ”¨β³ Needs Testing
  • Windsurf | πŸš§πŸ”¨β³ Needs Testing
  • Other MCP Clients | πŸš§πŸ”¨β³ Needs Testing

Installing via Smithery

To install railway-mcp automatically, use Smithery

Claude Desktop

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

Cursor

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

Manual Installation For Cursor

  1. Go to your Cursor settings and find the MCP section
  2. Click 'Add new MCP server'
  3. Name it, e.g., railway-mcp
  4. Paste the command into the 'Command' section, replacing <RAILWAY_API_TOKEN> with your Railway token:
npx -y @jasontanswe/railway-mcp <RAILWAY_API_TOKEN>

Manual Installation For Claude

  1. Create or edit your Claude for Desktop config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the railway-mcp server configuration with your API token:

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

If multiple MCP servers exist, your config file might look like:

{
  "mcpServers": {
    "railway": {
      "command": "npx",
      "args": ["-y", "@jasontanswe/railway-mcp"],
      "env": {
        "RAILWAY_API_TOKEN": "your-railway-api-token-here"
      }
    }
  }
}
  1. Restart Claude for Desktop
  2. Use Railway tools directly in Claude, e.g.,
Please list all my Railway projects
  1. Alternatively, configure your token inside Claude:
Please configure the Railway API with my token: {YOUR_API_TOKEN_HERE}

Recommendations and Other Information

This server is best combined with MCP clients that have terminal or Git access (Cursor, Windsurf). railway-mcp orchestrates containers and streamlines deployments seamlessly.

Recommended MCP Servers to Combine With

  • Git (Official Link)
  • GitHub (Official, Smithery)

For Claude

  • Claude does not have terminal access out of the box, so it cannot trigger deployments due to lack of commit access.
  • Best for spinning up and monitoring services.

For Cursor

  • Use with GitHub MCP or repositories cloned locally to leverage full integration.
  • To avoid deployment errors, ensure changes are pushed to GitHub:
    • Include a prompt like: Have you pushed our changes to GitHub yet?

Security Considerations

  • Railway API tokens provide full account access; keep them secure.
  • Using environment variables stores tokens in the configuration file.
  • Sensitive variable values are masked when displayed.
  • API calls use HTTPS for security.
  • Tokens are stored only in memory during runtime, not written to disk outside config files.

Troubleshooting

Token Authentication Issues

  • Verify your API token is valid with necessary permissions.
  • Ensure proper formatting in the environment variable config.
  • Use the configure tool inside Claude if environment variables fail.

Server Connection Issues

  • Make sure you have the latest server version.
  • Confirm Node.js 18+ is installed.
  • Restart Claude after config changes.

API Errors

  • Verify project, environment, and service IDs.
  • Check Railway's status for service disruptions.
  • Avoid exceeding Railway API rate limits.

Available Tools

Authentication

  • configure β€” Set your Railway API token (if not provided via environment variables)

Projects

  • project-list β€” List all projects
  • project-info β€” Get project details
  • project-create β€” Create a new project
  • project-delete β€” Delete a project
  • project-environments β€” List environments in a project

Services

  • service-list β€” List services in a project
  • service-info β€” Get service details
  • service-create-from-repo β€” Create service from GitHub repo
  • service-create-from-image β€” Create service from Docker image
  • service-delete β€” Delete a service
  • service-restart β€” Restart a service
  • service-update β€” Update service config (build/start commands) | 🚧 Needs Testing

Deployments

  • deployment-list β€” List service deployments
  • deployment-trigger β€” Trigger a deployment
  • deployment-logs β€” Get deployment logs
  • deployment-health-check β€” Check deployment health/status

Variables

  • variable-list β€” List variables for service or environment
  • variable-set β€” Create/update a variable
  • variable-delete β€” Delete a variable
  • variable-bulk-set β€” Bulk update variables | 🚧 Needs Testing
  • variable-copy β€” Copy variables between environments | 🚧 Needs Testing

Databases

  • database-list-types β€” List available database types
  • database-deploy β€” Deploy a new database service

Example Workflows

Setting up a new service

  1. List projects to get the project ID
  2. Create a new service from a template
  3. Add environment variables
  4. View the service deployment

Managing environment variables

  1. List projects to get project ID
  2. List variables currently set
  3. Create or update variables as needed
  4. Delete obsolete variables

Contributing

We welcome community contributions! Please see our Contributing Guidelines for details on getting started, development guidelines, and debugging information.