Deploy and manage Railway infrastructure through your AI coding assistant. Create projects, deploy services, manage environments, configure variables, and monitor deployments with Railway's official MCP server.
Deploy and manage Railway infrastructure directly from your AI coding assistant. This skill provides access to Railway's official Model Context Protocol (MCP) server, enabling you to create projects, deploy services, manage environments, configure variables, and monitor your deployments without leaving your editor.
The Railway MCP server installation varies by runtime:
**Cursor:** Add to `.cursor/mcp.json`:
```json
{
"mcpServers": {
"railway-mcp-server": {
"command": "npx",
"args": ["-y", "@railway/mcp-server"]
}
}
}
```
**VS Code:** Add to `.vscode/mcp.json`:
```json
{
"servers": {
"railway-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@railway/mcp-server"]
}
}
}
```
**Claude Code:**
```bash
claude mcp add railway-mcp-server -- npx -y @railway/mcp-server
```
When the Railway MCP server is active, you have access to these tools:
1. **Verify Railway CLI is ready:**
- First check that the Railway CLI is installed and the user is authenticated using `check-railway-status`
- If not installed, direct the user to install it from https://docs.railway.com/guides/cli
- If not authenticated, instruct them to run `railway login`
2. **Create a new project:**
- Use `create-project-and-link` to create a new Railway project
- This automatically links the current directory to the project
- The project will appear in the user's Railway dashboard
3. **Deploy from source code:**
- Use `deploy` to deploy the current directory
- Railway will auto-detect the framework and configure build settings
- Monitor deployment status through logs
4. **Deploy from templates:**
- Use `deploy-template` to deploy pre-configured services (databases, queues, etc.)
- Examples: PostgreSQL, MySQL, Redis, ClickHouse, MongoDB
- Templates come from https://railway.com/deploy
- Be specific in prompts to help select the right template
5. **Work with services:**
- Use `list-services` to see all services in a project
- Use `link-service` to link a specific service to the current directory
- Services can be applications, databases, or other infrastructure
6. **Manage environments:**
- Use `create-environment` to create new environments (staging, development, etc.)
- Use `link-environment` to switch between environments
- Environments can duplicate existing ones (e.g., clone production to staging)
7. **Manage environment variables:**
- Use `list-variables` to see all variables for the current service/environment
- Use `set-variables` to add or update variables
- Variables can be service-specific or shared across environments
8. **Configure domains:**
- Use `generate-domain` to create a railway.app subdomain
- Custom domains can be configured through the Railway dashboard
9. **View logs:**
- Use `get-logs` to retrieve build or deployment logs
- For Railway CLI v4.9.0+: Use `lines` parameter to limit output and `filter` parameter to search logs
- For older CLI versions: Logs will stream without filtering
- Useful for debugging deployment issues or monitoring application behavior
**Deploy a new Next.js app:**
```
Create a Next.js app in this directory and deploy it to Railway. Assign it a railway.app domain.
```
**Deploy a database:**
```
Deploy a PostgreSQL database to Railway.
```
**Create a staging environment:**
```
Create a new staging environment that duplicates production, then link it to this directory.
```
**Pull environment variables:**
```
List all environment variables for the current service and save them to a .env file.
```
**Debug deployment issues:**
```
Get the last 100 lines of deployment logs and look for any errors.
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/railway-mcp-server/raw