home / mcp / railway mcp server
Provides a local MCP server with workflows and tools to manage Railway projects, services, environments, variables, and domains.
Configuration
View docs{
"mcpServers": {
"railwayapp-railway-mcp-server": {
"command": "npx",
"args": [
"-y",
"@railway/mcp-server"
]
}
}
}You can run a local MCP server that provides practical workflows to manage Railway resources. It runs alongside your development environment and exposes a focused set of tools for creating projects, linking services, deploying, and handling environment variables and domains. This guide shows how to install, run, and integrate the Railway MCP Server with common MCP clients so you can automate and streamline your Railway work without destructive actions.
Connect an MCP client to the Railway MCP Server to perform project setup, service deployment, environment management, and domain generation. You can start the server locally and then configure your MCP client to load the server from your development instance. The server provides a curated set of tools for common Railway tasks such as listing projects, creating and linking projects, deploying services or templates, managing environments and variables, and retrieving logs.
Prerequisites you must have before running the server locally or installing via an MCP client.
Prerequisites include: Node.js 20.x or newer and pnpm 10.x or newer.
Option 1 — Quick start using an MCP client (recommended for most workflows)
Run the MCP server using your preferred package runner. The following command starts the server locally and keeps it running for interactive use with MCP clients.
Start the server with the standard MCP command:
pnpm devConfigure your MCP client so it can connect to the running server. Below are the example configurations to load the Railway MCP Server into two common MCP clients. Update paths as needed to reflect where your server is running.
{
"mcpServers": {
"railway-mcp-server": {
"command": "node",
"args": ["/path/to/railway-mcp-server/dist/index.js"]
}
}
}If you want to develop or customize the server locally, you can clone the repository, install dependencies, and run the development server. This builds a live server in memory and automatically rebuilds on changes.
Follow these steps in sequence.
Clone the repository, install dependencies, and start the dev server.
git clone https://github.com/railwayapp/railway-mcp-server.git
cd railway-mcp-server
pnpm install
pnpm devWhen you start the server in development mode, a build is generated under dist/ and will rebuild automatically as you make changes.
The MCP server is designed to avoid destructive actions by default. You should still monitor which tools and commands are being executed on your Railway resources.
Verifies that the Railway CLI is installed and the user is logged in.
Lists all Railway projects in your account.
Creates a new project and links it to the current directory.
Lists all services within a selected project.
Links a service to the current directory for management.
Deploys a service to Railway.
Deploys a template from the Railway Template Library.
Creates a new environment for development, staging, or production.
Links a specific environment to the current directory.
Lists environment variables for the linked project or environment.
Sets or updates environment variables in the linked context.
Generates a railway.app domain for a project.
Retrieves build or deployment logs for a service. CLI version dependent behavior is described: v4.9.0+ supports lines and filter for log output; older versions stream logs without filtering.