# Railway MCP

> The Railway MCP lets your AI agent manage cloud deployments and infrastructure settings through natural conversation. List projects, check service statuses across environments like staging or production, track deployment histories, audit persistent storage volumes, and adjust environment variables—all without opening a browser dashboard.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** paas, deployment, infrastructure-as-code, microservices, environment-management, cloud-hosting

## Description

Managing multi-service applications often means clicking through half a dozen tabs in the web console just to find one status update. This MCP changes that. It connects your AI agent directly to your Railway account, letting you handle complex cloud operations using plain chat. Need to know if production variables are set correctly? Ask. Want to see why the last deployment failed? Just ask for the history. Your agent acts like a dedicated ops engineer, pulling data on everything from project details and service configurations to persistent storage volumes. Because this MCP is part of Vinkius's massive catalog, you connect once to your preferred AI client (like Cursor or Claude) and gain access to all your infrastructure tools in one place. It gives you full control over your deployments right inside your existing workflow.

## Tools

### delete_variable
Permanently removes an environment variable from a service, which stops it from being used in future deployments.

### list_deployments
Retrieves the full deployment history for a service, showing status, timestamps, and IDs.

### list_domains
Checks which custom domains are configured for a service and verifies their SSL certificate status.

### list_environments
Lists the operational environments (like production or staging) configured within a given project.

### get_project
Retrieves detailed information about a single specific Railway project using its ID.

### list_projects
Lists every cloud project associated with your account, giving you the starting point for all operations.

### list_services
Shows all deployable units, such as web apps and databases, for a specified environment in a project.

### set_variable
Sets an environment variable value that will be available to all deployments of a specified service.

### list_variables
Lists environment variables for a service, indicating their scope (service, environment, or project).

### get_viewer
Use this to verify which account the API token belongs to.

Get current authenticated Railway user details

### list_volumes
Lists persistent storage volumes, showing their size and the services they are attached to.

## Prompt Examples

**Prompt:** 
```
Show me all my Railway projects and their services.
```

**Response:** 
```
I found 3 projects: 'my-api' (2 services: api-web, postgres), 'frontend-app' (1 service: nextjs), and 'worker-service' (1 service: redis). Would you like the deployment history for any specific service?
```

**Prompt:** 
```
Set the DATABASE_URL variable for my api-web service in production.
```

**Response:** 
```
Done! I've set the `DATABASE_URL` environment variable for the api-web service in the production environment. The new value will be available on the next deployment.
```

**Prompt:** 
```
What's the deployment status of my api-web service?
```

**Response:** 
```
The api-web service has 4 deployments. The most recent one deployed successfully 2 hours ago with image tag v2.3.1. The previous deployment (v2.3.0) failed due to a missing environment variable. Would you like more details?
```

## Capabilities

### Audit Project Structure
Retrieve a complete list of your cloud projects, including names and basic details.

### Inspect Services and Environments
See all deployed services (web apps, databases) within a project and filter them by specific environments like development or staging.

### Track Deployment Status
Get the deployment history for any service to check success/failure statuses and timestamps.

### Manage Config Variables
Check what environment variables exist or set new values for a specific service in a given environment.

### Review Custom Domains
List custom domains assigned to services and check their SSL certificate status to ensure public access is working.

## Use Cases

### Diagnosing a Failed Deployment
A developer notices the web app is down. Instead of checking the dashboard, they ask their agent to run `list_deployments`. The agent reports that the most recent deployment failed because the required environment variable was missing for that service.

### Onboarding a New Service
A team lead needs to check if the new worker API is properly configured. They ask their agent to run `list_services` filtered by the 'staging' environment, immediately seeing all related containers and databases.

### Changing Production Configs
The database password changes. The DevOps engineer asks the agent to use `set_variable` for the main API service in production, getting instant confirmation that the variable was updated successfully.

### Reviewing Infrastructure Scope
A team needs to know which services are using custom URLs. They ask their agent to run `list_domains`, which quickly provides a comprehensive list of all registered domains and verifies if the SSL certificates are ready.

## Benefits

- Check deployment history without leaving your IDE. Your agent runs `list_deployments` and tells you if the latest build succeeded or failed, saving clicks.
- Audit project scope instantly. Use `list_projects` to get an overview of every service group you manage across multiple applications.
- Control environment variables directly. You can use `set_variable` when your team needs a database connection string updated for staging without logging into the web UI.
- Monitor system health with domain checks. Run `list_domains` to quickly confirm if custom URLs are correctly pointing to services and have valid SSL certificates.
- Understand data persistence. Use `list_volumes` to see exactly which services rely on persistent storage and how large those volumes are.

## How It Works

The bottom line is you manage complex cloud infrastructure by talking to your AI agent instead of clicking through dashboards.

1. Subscribe to this MCP and provide your Railway Personal Access Token.
2. Connect the MCP to your preferred AI client (e.g., Cursor or Claude).
3. Give your agent a natural language command, like 'List all services in production for my main API project,' and get the data back.

## Frequently Asked Questions

**How do I use the list_projects tool with Railway MCP?**
You simply ask your agent to 'List all my Railway projects.' The system uses `list_projects` and returns a clean list of every project name, allowing you to select the right one for subsequent actions.

**Does Railway MCP support environment variable deletion?**
Yes. If you need to remove an old or deprecated key, your agent can run `delete_variable` after confirming the service ID, environment ID, and variable name with you.

**Can I check deployment status using list_deployments?**
Absolutely. By running `list_deployments`, your agent gives you a clear history of every attempt, showing success or failure statuses and when they occurred for the specific service.

**What is the difference between listing services and list_environments?**
Use `list_projects` first to see all your projects. Then you use `list_environments` on a project to narrow down to 'staging' or 'production,' before finally running `list_services` for that specific environment.

**Does Railway MCP show me which services are using volumes?**
Yes. Running the `list_volumes` tool shows you every persistent volume, and crucially, it links each volume ID to the specific service that is relying on that data.