railway-mcp
铁路MCP服务器
用于与Railway.app平台集成的模型上下文协议 (MCP)服务器。
目录
Related MCP server: Railway MCP Server
特征
地位 | 意义 |
✅ | 完全的 |
🚧🔨⏳ | 正在构建或需要测试 |
❌ | 目前尚未建造 |
✅ 使用 Railway API 令牌进行身份验证
✅ 项目管理(列表、信息、删除)
✅ 部署管理(列表、重启)
✅ 服务管理(从 GitHub repo 或 Docker 镜像创建、列出)
✅ 变量管理(列出、创建/更新、删除)
✅ 服务网络管理
✅ 音量管理
❌ 全面支持所有模板
🚧🔨⏳ 数据库模板支持
自动化数据库和网络工作流程
🚧🔨⏳ 最常用的工作流程
❌ 自动为服务提供 GitHub 存储库链接
安装
先决条件
Node.js 18+(用于内置 fetch API 支持)
活跃的铁路账户
Railway API 令牌(在https://railway.app/account/tokens创建一个)
快速入门
此 MCP 服务器旨在与以下 MCP 客户端配合使用:
Claude 桌面版 | ✅ 实战测试
光标 | ✅ 需要测试
Cline | 🚧🔨⏳ 需要测试
风帆冲浪 | 🚧🔨⏳ 需要测试
其他 MCP 客户端 | 🚧🔨⏳ 需要测试
通过 Smithery 安装
为了自动安装 railway-mcp,我们建议使用Smithery
克劳德桌面
npx -y @smithery/cli install @jason-tan-swe/railway-mcp --client claude光标
npx -y @smithery/cli@latest run @jason-tan-swe/railway-mcp --config "{\"railwayApiToken\":\"token\"}"前往光标设置并找到 MCP 部分
点击“添加新的 MCP 服务器”
随便你怎么命名,我们推荐
railway-mcp以获得更好的清晰度将此命令粘贴到“命令”部分,其中 <RAILWAY_API_TOKEN> 是您的帐户铁路令牌:
npx -y @jasontanswe/railway-mcp <RAILWAY_API_TOKEN>创建或编辑您的 Claude for Desktop 配置文件:
macOS:
~/Library/Application\ Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
使用您的 API 令牌将 railway-mcp 服务器添加到您的配置中:
"railway": {
"command": "npx",
"args": ["-y", "@jasontanswe/railway-mcp"],
"env": {
"RAILWAY_API_TOKEN": "your-railway-api-token-here"
}
}当您有多个 MCP 服务器时,您的配置文件可能如下所示:
{
"mcpServers": {
// ... All of your existing MCP servers ...
// Add the railway-mcp server to your configuration with your API token
"railway": {
"command": "npx",
"args": ["-y", "@jasontanswe/railway-mcp"],
"env": {
"RAILWAY_API_TOKEN": "your-railway-api-token-here"
}
}
}
}重启 Claude 桌面版
现在,您可以直接在 Claude 中使用 Railway 工具。例如:
Please list all my Railway projects或者,如果您不想将令牌添加到配置文件中,则可以在 Claude 中使用以下命令进行配置:
Please configure the Railway API with my token: {YOUR_API_TOKEN_HERE}建议和其他信息
此服务器最适合与能够访问终端的 MCP 客户端或 Git **(Cursor、Windsurf)**结合使用。建议将此 MCP 与其他 MCP 一起使用,因为 railway-mcp 可以协调容器并无缝简化您的部署流程。
推荐与以下 MCP 服务器结合使用
对于克劳德
开箱即用,Claude 没有终端访问权限,因此它无法触发部署,因为它无法获取最新的提交。
启动不同的服务并对其进行监控是 Claude 的最佳用例。
对于光标
与 GitHub MCP 一起使用或已在 GitHub 上设置存储库并在您的机器上本地克隆以利用与 railway-mcp 的完全集成。
当 Cursor 做出更改时,它可能会忘记将更改推送到 GitHub,从而导致它尝试部署 Railway 无法拉取的提交。
**解决方案:**始终在提示中询问或包含以下某处:
Have you pushed our changes to GitHub yet?
安全注意事项
Railway API 令牌可让您完全访问自己的帐户。请务必妥善保管。
当使用环境变量方法时,您的令牌存储在 Claude Desktop 配置文件中。
敏感变量值在显示时会被自动屏蔽。
所有 API 调用都使用 HTTPS 进行安全通信。
服务器的仅限内存的令牌存储意味着您的令牌永远不会写入配置文件之外的磁盘。
故障排除
如果您遇到问题:
令牌认证问题
确保您的 API 令牌有效并具有必要的权限
如果使用环境变量方法,请检查配置文件中的令牌格式是否正确
如果环境令牌不起作用,请尝试直接在 Claude 中使用
configure工具
服务器连接问题
检查您是否安装了最新版本的服务器
验证是否安装了 Node.js 18 或更高版本
更改配置后重新启动 Claude for Desktop
API 错误
验证您使用的项目、环境和服务 ID 是否正确
查看铁路状态页面,了解任何服务中断情况
Railway API 有速率限制 - 避免在短时间内发出过多请求
贡献
我们欢迎社区的贡献!请参阅我们的贡献指南,了解如何开始使用、开发指南和调试信息。
可用工具
验证
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- 部署新的数据库服务
设置新服务
列出项目以获取项目 ID
从模板创建新服务
添加环境变量
查看服务部署
管理环境变量
列出项目以查找您的项目 ID
列出变量以查看当前设置的内容
根据需要创建或更新变量
删除所有过时的变量
Available Tools
38 toolsconfigure_api_tokenA
[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
Inputs: token (required).
database_list_typesA
[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
Inputs: no named parameters.
deployment_listA
[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
Inputs: projectId (required), serviceId (required), environmentId (required), limit.
deployment_logsA
[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
Inputs: deploymentId (required), limit.
deployment_statusA
[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
Inputs: deploymentId (required).
deployment_triggerA
[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
Inputs: commitSha (required), projectId (required), serviceId (required), environmentId (required).
domain_checkA
[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
Inputs: domain (required).
domain_createA
[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
Inputs: serviceId (required), environmentId (required), domain, suffix, +1 more.
domain_deleteA
[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
Inputs: id (required).
domain_listA
[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
Inputs: projectId (required), serviceId (required), environmentId (required).
domain_updateA
[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
Inputs: id (required), targetPort (required).
list_service_variablesA
[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
Inputs: projectId (required), environmentId (required), serviceId.
project_createA
[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
Inputs: name (required), teamId.
project_deleteA
[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
Inputs: projectId (required).
project_environmentsC
List all environments in a project
Inputs: projectId (required).
project_infoA
[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
Inputs: projectId (required).
project_listA
[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
Inputs: no named parameters.
service_create_from_imageA
[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
Inputs: image (required), projectId (required), name.
service_create_from_repoA
[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
Inputs: repo (required), projectId (required), name.
service_deleteA
[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
Inputs: projectId (required), serviceId (required).
service_infoA
[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
Inputs: projectId (required), serviceId (required), environmentId (required).
service_listA
[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
Inputs: projectId (required).
service_restartA
[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
Inputs: serviceId (required), environmentId (required).
service_updateA
[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
Inputs: projectId (required), serviceId (required), environmentId (required), region, +6 more.
tcp_proxy_createA
[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
Inputs: serviceId (required), environmentId (required), applicationPort (required).
tcp_proxy_deleteA
[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
Inputs: proxyId (required).
tcp_proxy_listA
[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
Inputs: serviceId (required), environmentId (required).
template_deployA
[WORKFLOW] Deploy a new service from a template
⚡️ Best for: ✓ Starting new services from templates ✓ Quick service deployment ✓ Using pre-configured templates
⚠️ Not for: × Custom service configurations × GitHub repository deployments (use service_create_from_repo)
→ Prerequisites: template_list
→ Alternatives: service_create_from_repo, service_create_from_image, database_deploy
→ Next steps: service_info, variable_list
→ Related: service_update, deployment_trigger
Inputs: projectId (required), templateId (required), environmentId (required), teamId.
template_get_workflow_statusA
[API] Get the status of a workflow
⚡️ Best for: ✓ Checking workflow status
⚠️ Not for: × Creating new services
→ Next steps: service_info
→ Related: template_list, template_deploy
Inputs: workflowId (required).
template_listA
[API] List all available templates on Railway
⚡️ Best for: ✓ Discovering available templates ✓ Planning service deployments ✓ Finding template IDs and sources
⚠️ Not for: × Listing existing services × Getting service details
→ Alternatives: service_create_from_repo, service_create_from_image
→ Next steps: service_create_from_template
→ Related: database_list_types
Inputs: searchQuery.
variable_bulk_setA
[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
Inputs: projectId (required), variables (required), environmentId (required), serviceId.
variable_copyA
[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
Inputs: projectId (required), sourceEnvironmentId (required), targetEnvironmentId (required), overwrite, +1 more.
variable_deleteA
[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
Inputs: name (required), projectId (required), environmentId (required), serviceId.
variable_setA
[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
Inputs: name (required), value (required), projectId (required), environmentId (required), +1 more.
volume_createA
[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
Inputs: mountPath (required), projectId (required), serviceId (required), environmentId (required).
volume_deleteA
[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
Inputs: volumeId (required).
volume_listA
[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
Inputs: projectId (required).
volume_updateC
Update a volume's properties
Inputs: name (required), volumeId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 38 tools
Most tools have distinct purposes due to consistent naming, but there is some overlap among creation tools (e.g., service_create_from_image, service_create_from_repo, template_deploy) that could cause confusion. Descriptions help, but an agent might still misselect.
The majority follow a verb_noun pattern (e.g., project_create, service_list). However, some deviate like database_list_types (noun_verb_noun) and configure_api_token (verb with underscore). Overall consistent but with minor exceptions.
38 tools is excessive for typical MCP servers, which often have 10-20. While Railway is a broad platform, many tools are granular (e.g., separate tools for each CRUD operation on domains, TCP proxies, volumes) leading to an overwhelming surface.
The tool set covers most major operations for the Railway platform: projects, services, deployments, domains, variables, volumes, TCP proxies, templates. Minor gaps exist, such as no direct volume backup or database management beyond listing types and deployment.
Maintenance
Related MCP Connectors
Deploy apps from Claude Code or Cursor: hosting, Postgres, email, files. Vercel+Supabase in one.
- Eyevinn Open Source CloudDeprecatedio.osaas.mcp
Your AI Agent's Infrastructure Layer. Connect Claude, Copilot, Codex, or ChatGPT to 200+ managed open source services. Start databases, pipelines, and applications through natural language.
Deploy and run your apps by asking your AI: services, Postgres, logs, traces, rollbacks, costs.
Deploy static sites and connect custom domains from Claude, Cursor, or any MCP agent.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables management of Railway.app infrastructure through natural language, including deploying services from GitHub repos or Docker images, managing environment variables, monitoring deployments, and configuring networking and volumes.36MIT
- AlicenseAqualityDmaintenanceEnables management of Railway.app infrastructure through natural language, allowing users to deploy services, manage environment variables, monitor deployments, and configure projects directly from MCP clients like Claude.38MIT
- AlicenseAqualityDmaintenanceEnables AI systems like Claude and Cursor to directly manage Railway projects, deployments, services, environment variables, and monitor logs through natural language commands.9MIT
- FlicenseNot gradedqualityDmaintenanceA team-wide, remote MCP server that lets Claude operate Railway projects through natural language, with safety guardrails to prevent irreversible actions without human approval.-