# Railway MCP

> Railway MCP connects your AI agent directly to your live cloud infrastructure. Use it to manage projects, trigger deployments, restart services, and pull environment variables—all from your chat terminal without needing to open a web dashboard.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** deployment, cloud-hosting, environment-variables, infrastructure-as-code, serverless, automation

## Description

You can run core DevOps tasks right through your agent's conversational interface. Instead of opening multiple browser tabs or running complex CLI commands every time you need an update, your AI client handles the plumbing. You can ask it to list all projects available on your account or pull up a service’s runtime config instantly. Need to verify if a recent code push succeeded? Just ask for deployment history and get the status back. If a container is acting up, triggering a restart is as simple as asking. This level of deep access lets you manage everything from project creation to sensitive configuration variables without ever leaving your chat window. It's exactly what Vinkius delivers when it connects you to powerful services like Railway.

## Tools

### create_project
Creates a brand new cloud project within your Railway account.

### delete_project
Permanently removes an entire cloud project. Be careful; this action cannot be undone.

### get_project
Retrieves detailed information about a single, specific cloud project.

### get_service_instances
Fetches the current runtime configuration and details for an operational service.

### list_deployments
Displays a list of all past and present deployments for a given project, environment, and service.

### list_projects
Retrieves a comprehensive list of every Railway project your token has access to.

### list_variables
Lists all current environment variables associated with a service, helping you check configuration keys.

### restart_service
Forcibly restarts a running service instance when it's behaving poorly or needs a fresh container cycle.

### trigger_deploy
Initiates and queues up an entirely new deployment run for the specified service.

### whoami
Retrieves your personal profile information associated with the Railway API token.

## Prompt Examples

**Prompt:** 
```
List all active projects on my Railway account.
```

**Response:** 
```
I retrieved your projects using `list_projects`. You currently have two active projects: 'ECommerce Backend' (ID: prj_xyz123) and 'Auth Service' (ID: prj_abc789).
```

**Prompt:** 
```
Restart the deployment for the ECommerce Backend service.
```

**Response:** 
```
I executed `restart_service`. The service 'ECommerce Backend' successfully began recycling its containers. You can track the current startup health via the logs.
```

**Prompt:** 
```
Has the latest Production build finished yet?
```

**Response:** 
```
Using the `get_deployments` query, I found the latest deployment status. The Production build on service 'sv_222' successfully completed 4 minutes ago and is currently in a 'SUCCESS' state.
```

## Capabilities

### Manage Project Lifecycles
Create or retrieve details for specific cloud projects across your account.

### Review Build Status and History
View a project's full deployment history, checking build statuses and rollout logs to ensure stability.

### Troubleshoot Live Services
Get the current runtime configuration for services or restart an unhealthy container instance on demand.

### Configure Environment Variables
Securely read, update, or sync sensitive environment keys across different service instances.

### Initiate Code Deployments
Force a new deployment run for any connected service immediately after writing code.

## Use Cases

### Investigating a Broken Production Build
A developer noticed the staging environment was failing after a push. Instead of manually checking logs, they ask their agent to list_deployments for that service and confirm if the latest build status is 'FAILURE'. The agent immediately diagnoses the issue.

### Scaling Up a Service After Success
A system administrator notices high latency on an old container. They ask the agent to get_service_instances, verify resource usage, and then run restart_service to cycle out the problematic instance immediately.

### Setting Up a New Microservice
A fullstack developer needs a new backend service. They first ask list_projects to see what exists, use create_project for the new one, and then get_service_instances to verify its initial state.

### Confirming Credentials Before Launch
Before pushing code live, a DevOps engineer uses list_variables on the target service. This confirms that all necessary API keys are present and correctly configured before they trigger_deploy the final version.

## Benefits

- Forget jumping through dashboards. You can check the status of a build and get deployment history using list_deployments, all in one prompt.
- Need to cycle containers because of intermittent bugs? Instead of navigating menus, just ask the agent to run restart_service for that service name.
- Project setup is fast. Use create_project or get_project to manage your core infrastructure details without ever touching a web form.
- Secrets management gets easier. You can list_variables to check which configuration keys are active on any given service instance, saving you from guessing.
- Deployment workflows accelerate. When development wraps up, simply trigger_deploy the changes and track the outcome—all through your chat interface.

## How It Works

The bottom line is that it eliminates context switching by bringing your entire operational dashboard into natural conversation.

1. Enable the MCP integration within your agent client and provide your Railway API Token.
2. Give your AI client a simple prompt, like 'Show me all projects' or 'Restart service X'.
3. The agent calls the necessary tool, reads the live data from Railway, and provides you with a concise summary.

## Frequently Asked Questions

**How do I use Railway MCP to see all my projects?**
You run the list_projects tool. This tells you every project linked to your account, which is a great first step before working on any single service.

**Can I restart a service using the Railway MCP? If so, how?**
Yes, use the restart_service tool. Just provide the name of the running service instance, and the agent handles cycling its containers for you.

**What if my latest deployment failed? Should I use list_deployments?**
Absolutely. Use list_deployments. This tool gives you a full timeline of build attempts and provides key details about where the rollout stopped, helping pinpoint the failure point.

**Does Railway MCP let me change environment variables?**
Yes, it allows management via list_variables. You can check what values are currently set for a service instance before making any changes.

**Is the delete_project action irreversible with the Railway MCP?**
The listing specifies that delete_project is an irreversible action, so always confirm you're deleting the correct project before running it.