railway-mcp

railway-mcp

让 Claude 和 Cursor 通过自然语言管理你的 Railway 基础设施。 部署、配置和监控——自主且安全。

云平台
开发者工具
虚拟化
访问服务器

Tools

domain_delete

[API] Delete a domain from a service ⚡️ Best for: ✓ Removing unused domains ✓ Cleaning up configurations ✓ Domain management ⚠️ Not for: × Temporary domain disabling × Port updates (use domain_update) → Prerequisites: domain_list → Alternatives: domain_update → Related: service_update

database_list_types

[QUERY] List all available database types that can be deployed using Railway's official templates ⚡️ Best for: ✓ Discovering supported database types ✓ Planning database deployments ✓ Checking template availability ⚠️ Not for: × Listing existing databases × Getting database connection details → Alternatives: service_create_from_image → Next steps: database_deploy → Related: database_deploy, service_create_from_image

domain_update

[API] Update a domain's configuration ⚡️ Best for: ✓ Changing target ports ✓ Updating domain settings ✓ Reconfiguring endpoints ⚠️ Not for: × Changing domain names (delete and recreate instead) × TCP proxy configuration → Prerequisites: domain_list → Next steps: domain_list → Related: service_update

database_deploy_from_template

[WORKFLOW] Deploy a pre-configured database using Railway's official templates and best practices ⚡️ Best for: ✓ Standard database deployments ✓ Quick setup with security defaults ✓ Common database types (PostgreSQL, MongoDB, Redis) ⚠️ Not for: × Custom database versions × Complex configurations × Unsupported database types → Prerequisites: database_list_types → Alternatives: service_create_from_image → Next steps: variable_list, service_info → Related: volume_create, service_update

deployment_list

[API] List recent deployments for a service in a specific environment ⚡️ Best for: ✓ Viewing deployment history ✓ Monitoring service updates → Prerequisites: service_list → Next steps: deployment_logs, deployment_trigger → Related: service_info, service_restart

deployment_trigger

[API] Trigger a new deployment for a service ⚡️ Best for: ✓ Deploying code changes ✓ Applying configuration updates ✓ Rolling back to previous states ⚠️ Not for: × Restarting services (use service_restart) × Updating service config (use service_update) × Database changes → Prerequisites: service_list → Alternatives: service_restart → Next steps: deployment_logs, deployment_status → Related: variable_set, service_update

deployment_logs

[API] Get logs for a specific deployment ⚡️ Best for: ✓ Debugging deployment issues ✓ Monitoring deployment progress ✓ Checking build output ⚠️ Not for: × Service runtime logs × Database logs → Prerequisites: deployment_list → Next steps: deployment_status → Related: service_info, deployment_trigger

deployment_status

[API] Check the current status of a deployment ⚡️ Best for: ✓ Monitoring deployment progress ✓ Verifying successful deployments ✓ Checking for deployment failures ⚠️ Not for: × Service runtime logs × Database logs → Prerequisites: deployment_list, deployment_trigger → Next steps: deployment_logs → Related: service_info, service_restart, deployment_wait

domain_list

[API] List all domains (both service and custom) for a service ⚡️ Best for: ✓ Viewing service endpoints ✓ Managing domain configurations ✓ Auditing domain settings → Prerequisites: service_list → Next steps: domain_create, domain_update → Related: service_info, tcp_proxy_list

domain_create

[API] Create a new domain for a service ⚡️ Best for: ✓ Setting up custom domains ✓ Configuring service endpoints ✓ Adding HTTPS endpoints ⚠️ Not for: × TCP proxy setup (use tcp_proxy_create) × Internal service communication → Prerequisites: service_list, domain_check → Alternatives: tcp_proxy_create → Next steps: domain_update → Related: service_info, domain_list

domain_check

[API] Check if a domain is available for use ⚡️ Best for: ✓ Validating domain availability ✓ Pre-deployment checks ✓ Domain planning → Next steps: domain_create → Related: domain_list

project_list

[API] List all projects in your Railway account ⚡️ Best for: ✓ Getting an overview of all projects ✓ Finding project IDs ✓ Project discovery and management → Next steps: project_info, service_list → Related: project_create, project_delete

project_info

[API] Get detailed information about a specific Railway project ⚡️ Best for: ✓ Viewing project details and status ✓ Checking environments and services ✓ Project configuration review → Prerequisites: project_list → Next steps: service_list, variable_list → Related: project_update, project_delete

project_create

[API] Create a new Railway project ⚡️ Best for: ✓ Starting new applications ✓ Setting up development environments ✓ Creating project spaces ⚠️ Not for: × Duplicating existing projects → Next steps: service_create_from_repo, service_create_from_image, database_deploy → Related: project_delete, project_update

project_delete

[API] Delete a Railway project and all its resources ⚡️ Best for: ✓ Removing unused projects ✓ Cleaning up test projects ⚠️ Not for: × Temporary project deactivation × Service-level cleanup (use service_delete) → Prerequisites: project_list, project_info → Alternatives: service_delete → Related: project_create

project_environments

List all environments in a project

service_list

[API] List all services in a specific Railway project ⚡️ Best for: ✓ Getting an overview of a project's services ✓ Finding service IDs ✓ Checking service status → Prerequisites: project_list → Next steps: service_info, deployment_list → Related: project_info, variable_list

service_info

[API] Get detailed information about a specific service ⚡️ Best for: ✓ Viewing service configuration and status ✓ Checking deployment details ✓ Monitoring service health → Prerequisites: service_list → Next steps: deployment_list, variable_list → Related: service_update, deployment_trigger

service_create_from_repo

[API] Create a new service from a GitHub repository ⚡️ Best for: ✓ Deploying applications from source code ✓ Services that need build processes ✓ GitHub-hosted projects ⚠️ Not for: × Pre-built Docker images (use service_create_from_image) × Database deployments (use database_deploy) × Static file hosting → Prerequisites: project_list → Alternatives: service_create_from_image, database_deploy → Next steps: variable_set, service_update → Related: deployment_trigger, service_info

service_create_from_image

[API] Create a new service from a Docker image ⚡️ Best for: ✓ Custom database deployments ✓ Pre-built container deployments ✓ Specific version requirements ⚠️ Not for: × Standard database deployments (use database_deploy) × GitHub repository deployments (use service_create_from_repo) × Services needing build process → Prerequisites: project_list → Alternatives: database_deploy, service_create_from_repo → Next steps: variable_set, service_update, tcp_proxy_create → Related: volume_create, deployment_trigger

variable_delete

[API] Delete a variable for a service in a specific environment ⚡️ Best for: ✓ Removing unused configuration ✓ Security cleanup ✓ Configuration management ⚠️ Not for: × Temporary variable disabling × Bulk variable removal → Prerequisites: service_list → Next steps: deployment_trigger, service_restart → Related: variable_list, variable_set

service_update

[API] Update a service's configuration ⚡️ Best for: ✓ Changing service settings ✓ Updating resource limits ✓ Modifying deployment configuration ⚠️ Not for: × Updating environment variables (use variable_set) × Restarting services (use service_restart) × Triggering new deployments (use deployment_trigger) → Prerequisites: service_list, service_info → Next steps: deployment_trigger → Related: service_restart, variable_set

service_delete

[API] Delete a service from a project ⚡️ Best for: ✓ Removing unused services ✓ Cleaning up test services ✓ Project reorganization ⚠️ Not for: × Temporary service stoppage (use service_restart) × Updating service configuration (use service_update) → Prerequisites: service_list, service_info → Alternatives: service_restart → Related: project_delete

service_restart

[API] Restart a service in a specific environment ⚡️ Best for: ✓ Applying configuration changes ✓ Clearing service state ✓ Resolving runtime issues ⚠️ Not for: × Deploying new code (use deployment_trigger) × Updating service config (use service_update) × Long-term service stoppage (use service_delete) → Prerequisites: service_list → Alternatives: deployment_trigger → Related: service_info, deployment_logs

tcp_proxy_list

[API] List all TCP proxies for a service in a specific environment ⚡️ Best for: ✓ Viewing TCP proxy configurations ✓ Managing external access ✓ Auditing service endpoints → Prerequisites: service_list → Next steps: tcp_proxy_create → Related: domain_list, service_info

tcp_proxy_create

[API] Create a new TCP proxy for a service ⚡️ Best for: ✓ Setting up database access ✓ Configuring external connections ✓ Exposing TCP services ⚠️ Not for: × HTTP/HTTPS endpoints (use domain_create) × Internal service communication → Prerequisites: service_list → Alternatives: domain_create → Next steps: tcp_proxy_list → Related: service_info, service_update

tcp_proxy_delete

[API] Delete a TCP proxy ⚡️ Best for: ✓ Removing unused proxies ✓ Security management ✓ Endpoint cleanup ⚠️ Not for: × Temporary proxy disabling × Port updates → Prerequisites: tcp_proxy_list → Related: service_update

list_service_variables

[API] List all environment variables for a service ⚡️ Best for: ✓ Viewing service configuration ✓ Auditing environment variables ✓ Checking connection strings → Prerequisites: service_list → Next steps: variable_set, variable_delete → Related: service_info, variable_bulk_set

variable_set

[API] Create or update an environment variable ⚡️ Best for: ✓ Setting configuration values ✓ Updating connection strings ✓ Managing service secrets ⚠️ Not for: × Bulk variable updates (use variable_bulk_set) × Temporary configuration changes → Prerequisites: service_list → Alternatives: variable_bulk_set → Next steps: deployment_trigger, service_restart → Related: variable_list, variable_delete

variable_bulk_set

[WORKFLOW] Create or update multiple environment variables at once ⚡️ Best for: ✓ Migrating configuration between services ✓ Initial service setup ✓ Bulk configuration updates ⚠️ Not for: × Single variable updates (use variable_set) × Temporary configuration changes → Prerequisites: service_list → Alternatives: variable_set → Next steps: deployment_trigger, service_restart → Related: variable_list, service_update

variable_copy

[WORKFLOW] Copy variables from one environment to another ⚡️ Best for: ✓ Environment migration ✓ Configuration sharing ✓ Environment duplication ⚠️ Not for: × Single variable updates (use variable_set) × Temporary configuration changes → Prerequisites: service_list → Alternatives: variable_set → Next steps: deployment_trigger, service_restart → Related: variable_list, service_update

configure_api_token

[UTILITY] Configure the Railway API token for authentication (only needed if not set in environment variables) ⚡️ Best for: ✓ Initial setup ✓ Token updates ✓ Authentication configuration ⚠️ Not for: × Project configuration × Service settings × Environment variables → Next steps: project_list, service_list → Related: project_create

volume_list

[API] List all volumes in a project ⚡️ Best for: ✓ Viewing persistent storage configurations ✓ Managing data volumes ✓ Auditing storage usage → Prerequisites: project_list → Next steps: volume_create → Related: service_info, database_deploy

volume_create

[API] Create a new persistent volume for a service ⚡️ Best for: ✓ Setting up database storage ✓ Configuring persistent data ✓ Adding file storage ⚠️ Not for: × Temporary storage needs × Static file hosting × Memory caching → Prerequisites: service_list → Next steps: volume_list → Related: service_update, database_deploy

volume_update

Update a volume's properties

volume_delete

[API] Delete a volume from a service ⚡️ Best for: ✓ Removing unused storage ✓ Storage cleanup ✓ Resource management ⚠️ Not for: × Temporary data removal × Data backup (use volume_backup first) → Prerequisites: volume_list → Related: service_update

README

Railway MCP 服务器

<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://avatars.githubusercontent.com/u/66716858?s=200&v=4" /> <source media="(prefers-color-scheme: light)" srcset="https://avatars.githubusercontent.com/u/66716858?s=200&v=4" /> <img alt="Railway" src="https://avatars.githubusercontent.com/u/66716858?s=200&v=4" height="40" /> </picture>    <picture> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/38db1bcd-50df-4a49-a106-1b5afd924cb2" /> <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/82603097-07c9-42bb-9cbc-fb8f03560926" /> <img alt="MCP" src="https://github.com/user-attachments/assets/82603097-07c9-42bb-9cbc-fb8f03560926" height="40" /> </picture> </p>

<p align="center"> <strong> 让 Claude 和其他 MCP 客户端管理您的 Railway.app 基础设施。通过自然语言部署服务、管理变量和监控部署。 </strong> </p> <p align="center"> <table align="center"> <th align="center"> 请注意:此项目正在开发中,并非所有功能都已可用。 🚧 </th> </table> </p>

<a href="https://glama.ai/mcp/servers/lwn74iwigz"> <img width="380" height="200" src="https://glama.ai/mcp/servers/lwn74iwigz/badge" alt="railway-mcp MCP server" /> </a>

一个用于与 Railway.app 平台集成的 模型上下文协议 (MCP) 服务器。

smithery badge

目录

<p align="center"> <a href="#features">功能</a> • <a href="#installation">安装</a> • <a href="#available-tools">可用工具</a> • <a href="#example-workflows">示例工作流程</a> • <a href="#security-considerations">安全</a> • <a href="#troubleshooting">故障排除</a> • <a href="#contributing">贡献</a> </p>

功能

状态 含义
完成
🚧🔨⏳ 正在构建或需要测试
目前未构建
  • ✅ 使用 Railway API 令牌进行身份验证
  • ✅ 项目管理(列表、信息、删除)
  • ✅ 部署管理(列表、重启)
  • ✅ 服务管理(从 GitHub 仓库或 Docker 镜像创建、列表)
  • ✅ 变量管理(列表、创建/更新、删除)
  • ✅ 服务网络管理
  • ✅ 卷管理
  • ❌ 完全支持所有模板
    • 🚧🔨⏳ 数据库模板支持
    • 自动数据库和网络工作流程
  • 🚧🔨⏳ 最常用的工作流程
  • ❌ 自动 GitHub 仓库链接到服务

安装

前提条件

  • Node.js 18+(用于内置的 fetch API 支持)
  • 一个有效的 Railway 帐户
  • 一个 Railway API 令牌(在 https://railway.app/account/tokens 创建一个)

快速开始

此 MCP 服务器旨在与以下 MCP 客户端一起使用:

  • Claude for Desktop | ✅ 经过实战测试
  • Cursor | ✅ 需要测试
  • Cline | 🚧🔨⏳ 需要测试
  • Windsurf | 🚧🔨⏳ 需要测试
  • 其他 MCP 客户端 | 🚧🔨⏳ 需要测试

通过 Smithery 安装

要自动安装 railway-mcp,我们建议使用 Smithery

Claude Desktop

npx -y @smithery/cli install @jason-tan-swe/railway-mcp --client claude

Cursor

npx -y @smithery/cli@latest run @jason-tan-swe/railway-mcp --config "{\"railwayApiToken\":\"token\"}"

<details> <summary> <h3>Cursor 的手动安装</h3></summary>

  1. 前往您的 Cursor 设置并找到 MCP 部分

  2. 点击“添加新的 MCP 服务器”

  3. 随意命名,我们建议使用 railway-mcp 以获得更好的清晰度

  4. 将此命令粘贴到“命令”部分,其中 <RAILWAY_API_TOKEN> 是您帐户的 Railway 令牌:

npx -y @jasontanswe/railway-mcp <RAILWAY_API_TOKEN>

</details>

<details>

<summary><h3>Claude 的手动安装</h3></summary>

  1. 创建或编辑您的 Claude for Desktop 配置文件:

    • macOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. 使用您的 API 令牌将 railway-mcp 服务器添加到您的配置中:

   "railway": {
      "command": "npx",
      "args": ["-y", "@jasontanswe/railway-mcp"],
      "env": {
         "RAILWAY_API_TOKEN": "your-railway-api-token-here"
      }
   }

当您有多个 MCP 服务器时,您的配置文件可能如下所示:

{
  "mcpServers": {
    // ... 所有现有的 MCP 服务器 ...

    // 使用您的 API 令牌将 railway-mcp 服务器添加到您的配置中
    "railway": {
      "command": "npx",
      "args": ["-y", "@jasontanswe/railway-mcp"],
      "env": {
        "RAILWAY_API_TOKEN": "your-railway-api-token-here"
      }
    }
  }
}
  1. 重启 Claude for Desktop

  2. 您现在可以直接在 Claude 中开始使用 Railway 工具。例如:

请列出我所有的 Railway 项目
  1. 或者,如果您不想将令牌添加到配置文件中,您可以使用以下命令在 Claude 中配置它:
请使用我的令牌配置 Railway API:{YOUR_API_TOKEN_HERE}

</details>

建议和其他信息

此服务器最好与可以访问终端或 Git (Cursor, Windsurf) 的 MCP 客户端结合使用。 建议将此 MCP 与其他 MCP 结合使用,因为 railway-mcp 可以协调容器并无缝地简化您的部署过程。

推荐组合使用的 MCP 服务器

对于 Claude

  • Claude 开箱即用,没有终端访问权限,因此它无法触发部署,因为它无法获取最新的提交。
  • 启动不同的服务并监控它们是 Claude 的最佳用例。

对于 Cursor

  • 与 GitHub MCP 一起使用,或者在 GitHub 上已经设置了存储库并在本地计算机上克隆了存储库,以利用与 railway-mcp 的完全集成。
  • 当 Cursor 进行更改时,它可能会忘记将其更改推送到 GitHub,从而导致它尝试部署 Railway 无法拉取的提交。
    • 解决方案: 始终询问或在提示中的某个位置包含:您是否已将我们的更改推送到 GitHub?

安全注意事项

  • Railway API 令牌提供对您帐户的完全访问权限。 确保它们的安全。
  • 使用环境变量方法时,您的令牌存储在 Claude Desktop 配置文件中。
  • 敏感变量值在显示时会自动屏蔽。
  • 所有 API 调用都使用 HTTPS 进行安全通信。
  • 服务器的仅内存令牌存储意味着您的令牌永远不会写入配置文件之外的磁盘。

故障排除

如果您遇到问题:

  1. 令牌身份验证问题

    • 确保您的 API 令牌有效并且具有必要的权限
    • 如果使用环境变量方法,请检查令牌在配置文件中的格式是否正确
    • 如果环境变量令牌不起作用,请尝试直接在 Claude 中使用 configure 工具
  2. 服务器连接问题

    • 检查您是否已安装最新版本的服务器
    • 验证是否已安装 Node.js 18 或更高版本
    • 在更改配置后重启 Claude for Desktop
  3. API 错误

    • 验证您是否使用了正确的项目、环境和服务 ID
    • 检查 Railway 的状态页面是否有任何服务中断
    • Railway API 有速率限制 - 避免在短时间内发出太多请求

贡献

我们欢迎社区的贡献! 请参阅我们的 贡献指南 以获取有关如何开始、开发指南和调试信息的详细信息。

</details>

可用工具

<details> <summary>查看全部</summary>

身份验证

  • configure - 设置您的 Railway API 令牌(仅当未在环境变量中提供时才需要)

项目

  • project-list - 列出您帐户中的所有项目
  • project-info - 获取有关特定项目的详细信息
  • project-create - 创建一个新项目,带有可选的团队 ID
  • project-delete - 删除一个项目
  • project-environments - 列出项目中的所有环境

服务

  • service-list - 列出特定项目中的所有服务
  • service-info - 获取有关特定服务的详细信息
  • service-create-from-repo - 从 GitHub 仓库创建一个新服务
  • service-create-from-image - 从 Docker 镜像创建一个新服务
  • service-delete - 从项目中删除一个服务
  • service-restart - 在特定环境中重启一个服务
  • service-update - 更新服务配置(构建命令、启动命令等)| 🚧 需要测试

部署

  • deployment-list - 列出服务的最近部署
  • deployment-trigger - 触发服务的新部署
  • deployment-logs - 获取特定部署的日志
  • deployment-health-check - 检查部署的健康/状态

变量

  • variable-list - 列出服务或环境的变量
  • variable-set - 创建或更新一个变量
  • variable-delete - 删除一个变量
  • variable-bulk-set - 批量更新服务的变量 | 🚧 需要测试
  • variable-copy - 在环境之间复制变量 | 🚧 需要测试

数据库

  • database-list-types - 列出可以部署的所有可用数据库类型
  • database-deploy - 部署一个新的数据库服务 </details>

<details> <summary>示例工作流程</summary>

设置新服务

  1. 列出项目以获取项目 ID
  2. 从模板创建一个新服务
  3. 添加环境变量
  4. 查看服务部署

管理环境变量

  1. 列出项目以查找您的项目 ID
  2. 列出变量以查看当前设置的内容
  3. 根据需要创建或更新变量
  4. 删除任何过时的变量

</details>

推荐服务器

Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
MCP Package Docs Server

MCP Package Docs Server

促进大型语言模型高效访问和获取 Go、Python 和 NPM 包的结构化文档,通过多语言支持和性能优化来增强软件开发。

精选
本地
TypeScript
Claude Code MCP

Claude Code MCP

一个实现了 Claude Code 作为模型上下文协议(Model Context Protocol, MCP)服务器的方案,它可以通过标准化的 MCP 接口来使用 Claude 的软件工程能力(代码生成、编辑、审查和文件操作)。

精选
本地
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

用于任务管理的模型上下文协议服务器。它允许 Claude Desktop(或任何 MCP 客户端)在基于队列的系统中管理和执行任务。

精选
本地
JavaScript
contentful-mcp

contentful-mcp

在你的 Contentful Space 中更新、创建、删除内容、内容模型和资源。

精选
TypeScript
Supabase MCP Server

Supabase MCP Server

一个模型上下文协议(MCP)服务器,它提供对 Supabase 管理 API 的编程访问。该服务器允许 AI 模型和其他客户端通过标准化的接口来管理 Supabase 项目和组织。

精选
JavaScript
mermaid-mcp-server

mermaid-mcp-server

一个模型上下文协议 (MCP) 服务器,用于将 Mermaid 图表转换为 PNG 图像。

精选
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP 服务器向 AI 编码助手(如 Cursor)提供 Jira 工单信息。

精选
TypeScript
Linear MCP Server

Linear MCP Server

一个模型上下文协议(Model Context Protocol)服务器,它与 Linear 的问题跟踪系统集成,允许大型语言模型(LLM)通过自然语言交互来创建、更新、搜索和评论 Linear 问题。

精选
JavaScript