@opichi/server-railway
v1.0.2
Published
MCP server for Railway CLI integration
Maintainers
Readme
Railway MCP Server
A Model Context Protocol (MCP) server that provides a standardized interface for Large Language Models (LLMs) to interact with the Railway Command Line Interface (CLI).
Features
- Complete Railway CLI Integration: Supports all Railway CLI commands as MCP tools
- Authentication Management: Handles Railway login/logout and user authentication
- State Management: Maintains project and environment context
- Error Handling: Provides structured error messages and clear feedback
- Easy Installation: Available as an NPM package, runnable via npx
Installation
Prerequisites
- Node.js 18.0.0 or higher
- Railway CLI installed and available in your system's PATH
Install Railway CLI
# Install Railway CLI if not already installed
npm install -g @railway/cliInstall MCP Server
# Run directly with npx (recommended)
npx @opichi/server-railway
# Or install globally
npm install -g @opichi/server-railwayConfiguration
VS Code with MCP Extension
Add the following to your VS Code settings.json:
{
"mcpServers": {
"railway": {
"command": "npx",
"args": [
"-y",
"@opichi/server-railway"
],
"disabled": false
}
}
}Cursor IDE
Add to your Cursor configuration:
{
"mcpServers": {
"railway": {
"command": "npx",
"args": [
"-y",
"@opichi/server-railway"
]
}
}
}Supported Commands
Core Management
railway_login- Authenticate with Railwayrailway_logout- Log out of Railway accountrailway_whoami- Display current user inforailway_list- List all Railway projectsrailway_link- Connect directory to Railway projectrailway_unlink- Disconnect from Railway projectrailway_init- Create new Railway projectrailway_delete- Delete a projectrailway_docs- Open Railway documentationrailway_version- Get Railway CLI versionrailway_help- Get help for specific commands
Deployment & Services
railway_up- Deploy code to Railwayrailway_down- Remove recent deploymentrailway_logs- Show deployment logsrailway_add- Add plugin to projectrailway_connect- Connect to database shellrailway_domain- Manage custom domainsrailway_deploy- Deploy template to project
Environment & Variables
railway_environment- Manage environmentsrailway_variables- Work with environment variables
Local Development
railway_run- Run command with Railway variablesrailway_shell- Open shell with Railway variablesrailway_status- View project statusrailway_open- Open project in Railway dashboardrailway_completion- Generate shell completion scripts
Usage Example
Once configured in your MCP-compatible client, you can use natural language to interact with Railway:
"Login to Railway and show me my projects"
"Create a new Railway project called 'my-app'"
"Deploy the current directory to Railway"
"Show me the logs for my latest deployment"
"Set the environment variable DATABASE_URL to my production database"Error Handling
The server provides clear error messages when:
- Railway CLI is not installed or not found in PATH
- Authentication is required but user is not logged in
- Commands fail due to invalid arguments or Railway API issues
- Network connectivity problems
Development
Setup
git clone <repository-url>
cd railway-mcp-server
npm installBuild
npm run buildDevelopment Mode
npm run devTesting
npm testContributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues and questions:
- Check the Railway CLI documentation
- Open an issue on GitHub
- Review the MCP specification at Model Context Protocol
