railway-mcp
by Gaaldaco
README.md
# railway-mcp
An MCP server that exposes the [Railway](https://railway.com) API as tools for Claude. Manage your Railway projects, services, deployments, variables, environments, and domains directly from Claude.
## Tools
| Tool | Description |
|------|-------------|
| `get_me` | Get current authenticated user details |
| `list_projects` | List all Railway projects |
| `get_project` | Get project details with services and environments |
| `create_project` | Create a new Railway project |
| `update_project` | Update project name or description |
| `delete_project` | Permanently delete a project |
| `list_environments` | List all environments in a project |
| `get_environment` | Get environment details |
| `create_environment` | Create a new environment (optionally clone from existing) |
| `rename_environment` | Rename an environment |
| `delete_environment` | Delete an environment and all its deployments |
| `get_service` | Get service details |
| `get_service_instance` | Get environment-specific service config |
| `create_service` | Create a service from GitHub, Docker image, or empty |
| `update_service` | Update service name or icon |
| `delete_service` | Permanently delete a service |
| `deploy_service` | Trigger a new deployment |
| `list_deployments` | List deployments for a service |
| `get_deployment` | Get deployment details |
| `redeploy` | Redeploy an existing deployment |
| `restart_deployment` | Restart a deployment without rebuilding |
| `rollback_deployment` | Roll back to a previous deployment |
| `stop_deployment` | Stop a running deployment |
| `cancel_deployment` | Cancel a building/queued deployment |
| `get_build_logs` | Fetch build logs for a deployment |
| `get_deploy_logs` | Fetch runtime logs for a deployment |
| `get_variables` | Get environment variables for a service |
| `upsert_variable` | Set or update a single variable |
| `upsert_variables` | Set or update multiple variables at once |
| `delete_variable` | Delete a variable |
| `list_domains` | List all domains for a service |
| `create_service_domain` | Generate a Railway-provided domain |
| `delete_service_domain` | Delete a Railway-provided domain |
| `create_custom_domain` | Add a custom domain |
| `delete_custom_domain` | Remove a custom domain |
## Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| `RAILWAY_TOKEN` | Yes | Railway API token — generate at https://railway.com/account/tokens |
| `TRANSPORT` | No | `http` (default) for remote, `stdio` for Claude Desktop |
| `PORT` | No | Port to listen on (default `8080`, Railway injects this automatically) |
## Deploy to Railway
1. Fork or push this repo to GitHub
2. Go to [Railway](https://railway.com) → **New Project** → **Deploy from GitHub repo**
3. Select this repository
4. In **Variables**, add `RAILWAY_TOKEN` with your Railway API token
5. Railway will build and deploy automatically
6. Go to **Settings → Networking → Generate Domain** to get your public URL
## Connect to Claude
### Remote (Railway deployment)
Add to `claude.ai` MCP settings:
```json
{
"mcpServers": {
"railway": {
"url": "https://your-app.up.railway.app/sse"
}
}
}
```
### Local (Claude Desktop / stdio)
```json
{
"mcpServers": {
"railway": {
"command": "node",
"args": ["/path/to/railway-mcp/dist/index.js"],
"env": {
"TRANSPORT": "stdio",
"RAILWAY_TOKEN": "your_railway_token"
}
}
}
}
```
## Local Development
```bash
cp .env.example .env
# Edit .env with your RAILWAY_TOKEN
npm install
npm run build
node dist/index.js
```
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo issues