home / mcp / railway mcp server
Provides direct access to manage Railway projects, deployments, and environment variables via an MCP client.
Configuration
View docs{
"mcpServers": {
"allkindsxyz-railway-mcp-server": {
"command": "node",
"args": [
"/absolute/path/to/railway-mcp-server/dist/index.js"
],
"env": {
"RAILWAY_TOKEN": "your-railway-token-here"
}
}
}
}You are about to run a Railway MCP Server that lets AI systems directly manage Railway projects, deployments, and services. This MCP server runs locally and communicates with Railway using your API token, giving you programmatic control over projects, deploys, environment variables, and real-time status monitoring.
After you configure an MCP client, you can interact with Railway resources through natural language commands. You can view all projects, inspect a specific project, fetch deployment logs, restart or redeploy services, and manage environment variables. Core actions include monitoring deployment status in real time, obtaining service URLs, and retrieving project and service metadata. Use the available commands to perform tasks like viewing projects, viewing a single project, viewing deployment logs, restarting services, and setting or updating environment variables.
Prerequisites you need before starting are Node.js 18+ and a Railway API token.
Step 1: Install prerequisites and clone the project.
# Clone the repository
git clone <your-repo-url>
cd railway-mcp-server
# Install dependencies
npm install
# Build the project
npm run buildStep 2: Obtain your Railway API token.
Follow these steps to generate a token in Railway: 1. Log in to Railway 2. Go to Account Settings → Tokens 3. Create a new token 4. Copy the token
Configure your MCP client (Claude Desktop or Cursor) to connect to the local MCP server. You will run the MCP server locally and point the client to the local process so commands like viewing projects or updating variables are forwarded to Railway.
For Claude Desktop and Cursor you will specify the MCP server as a local stdio process with the node runtime and the built server entry point, plus your Railway token as an environment variable.
You can test and run the MCP server locally using the environment variable that holds your Railway API token and starting the server with Node.
Open a terminal and start the server after setting the token in the environment.
# Set the Railway token in your environment (example for bash)
export RAILWAY_TOKEN="your-token-here"
# Start the server
npm start{
"mcpServers": {
"railway": {
"command": "node",
"args": ["/absolute/path/to/railway-mcp-server/dist/index.js"],
"env": {
"RAILWAY_TOKEN": "your-railway-token-here"
}
}
}
}Configure Cursor similarly to connect to the local MCP server by specifying the same command and arguments, including the Railway token in the environment.
Tokens are stored only in environment variables. The MCP server runs locally to limit exposure. Actions that change state require confirmation, and each service runs in an isolated context to minimize cross-service impact.
Common issues and fixes include token validity, authorization errors, and missing tool configurations. Ensure the RAILWAY_TOKEN environment variable is set correctly and that the token has the required permissions.
If you encounter connectivity or permission problems, restart the client and verify that the MCP server process is running locally.
For interactive debugging, run the MCP Inspector and open the provided URL in your browser to exercise commands in a test environment.
# Run the inspector for debugging
npm run inspectorFetches all Railway projects and their services.
Fetches detailed information about a specific project.
Fetches details for a specific service within a project.
Retrieves logs for a specific deployment.
Triggers a redeploy of a specified service.
Cancels an ongoing deployment.
Restarts a deployment.
Updates or creates an environment variable for a service.
Deletes an environment variable from a service.