railway-mcp
by: jason-tan-swe
An unofficial and community-built MCP server for integrating with https://railway.app
π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.
Table of Contents
Features β’ Installation β’ Available Tools β’ Example Workflows β’ Security β’ Troubleshooting β’ Contributing
Features
Status | Meaning |
---|---|
β | 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
- Node.js 18+ (for built-in fetch API support)
- An active Railway account
- A Railway API token (create one at https://railway.app/account/tokens)
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
- Go to your Cursor settings and find the MCP section
- Click 'Add new MCP server'
- Name it, e.g.,
railway-mcp
- 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
-
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
- macOS:
-
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"
}
}
}
}
- Restart Claude for Desktop
- Use Railway tools directly in Claude, e.g.,
Please list all my Railway projects
- 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?
- Include a prompt like:
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 projectsproject-info
β Get project detailsproject-create
β Create a new projectproject-delete
β Delete a projectproject-environments
β List environments in a project
Services
service-list
β List services in a projectservice-info
β Get service detailsservice-create-from-repo
β Create service from GitHub reposervice-create-from-image
β Create service from Docker imageservice-delete
β Delete a serviceservice-restart
β Restart a serviceservice-update
β Update service config (build/start commands) | π§ Needs Testing
Deployments
deployment-list
β List service deploymentsdeployment-trigger
β Trigger a deploymentdeployment-logs
β Get deployment logsdeployment-health-check
β Check deployment health/status
Variables
variable-list
β List variables for service or environmentvariable-set
β Create/update a variablevariable-delete
β Delete a variablevariable-bulk-set
β Bulk update variables | π§ Needs Testingvariable-copy
β Copy variables between environments | π§ Needs Testing
Databases
database-list-types
β List available database typesdatabase-deploy
β Deploy a new database service
Example Workflows
Setting up a new service
- List projects to get the project ID
- Create a new service from a template
- Add environment variables
- View the service deployment
Managing environment variables
- List projects to get project ID
- List variables currently set
- Create or update variables as needed
- Delete obsolete variables
Contributing
We welcome community contributions! Please see our Contributing Guidelines for details on getting started, development guidelines, and debugging information.