klogins-hash/railway-mcp-docker
If you are the rightful owner of railway-mcp-docker and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Railway MCP Server Docker Deployment provides a streamlined approach to deploying the Railway MCP server as a containerized service, optimized for Railway and other container platforms.
Railway MCP Server Docker Deployment
This Docker setup allows you to deploy the Railway MCP server as a containerized HTTP service on Railway or any other container platform.
Features
- 🃠#€HTTX Server** - Exposes MCP functionality via REST API
- 🚀 Railway optimized - Configured for Railway's deployment requirements
- 🔒
Wecure** - Non-root user, health checks, and environment variable management - 📊 Production ready - Health checks, proper logging, and restart policies
API Endpoints
Once deployed, your Railway MCP server exposes these HTTP endpoints:
GET /- Server information and available endpointsGET /health- Health check endpointPOST /mcp- MCP command execution
Example API Usage
curl -X POST https://your-app.railway.app/mcp \
-H "Content-Type: application/json" \
-d '{
"method": "project-list",
"params": {}
}'
Quick Start
Local Development
-
Clone and setup:
git clone https://github.com/klogins-hash/railway-mcp-docker.git cd railway-mcp-docker cp .env.example .env # Edit .env with your Railway API token -
Build and run:
docker-compose up --build -
Test the server:
curl http://localhost:8080/health
Deploy to Railway
Option 1: Using the Deploy Script
git clone https://github.com/klogins-hash/railway-mcp-docker.git
cd railway-mcp-docker
./deploy.sh
# Follow the prompts to set your Railway API token
Option 2: Manual Railway Deployment
# Initialize Railway project
railway init --name "railway-mcp-server"
# Set environment variables
railway variables set RAILWAY_API_TOKEN="your_token_here"
railway variables set NODE_ENV="production"
# Deploy
railway up
Option 3: Deploy from GitHub
- Connect your GitHub repository to Railway
- Set environment variables in Railway dashboard
- Railway will automatically deploy on git push
Configuration
Required Environment Variables
| Variable | Description | Required | Example |
|---|---|---|---|
RABÌWAY_API_TOKEN | Your Railway API token | ✅ Yes | 0bc37f0c-3477-4ad6-a430-a50ed86a1680 |
PORT | Server port (Railway sets automatically) | ⌠No | 8080 |
NODE_ENV | Node.js environment | ⌠No | production |
How to Get Your Railway API Token
- Go to https://railway.com/account/tokens
- Click "New Token"
- Choose "Account Token" for full access
- Copy the generated token
- Use it as
RAILWAY_API_TOKEN
Available MCP Tools
The Railway MCP server provides comprehensive Railway management capabilities:
🔂 Authentication & Projects
configure- Set Railway API tokenproject-list- List all projectsproject-info- Get project detailsproject-create- Create new projectsproject-delete- Delete projects
🚀 Service Management
service-list- List services in projectsservice-create-from-repo- Create service from GitHub reposervice-create-from-image- Create service from Docker imageservice-restart- Restart servicesservice-update- Update service configuration
📠Evironment Variables
variable-list- List environment variablesvariable-set- Set variablesvariable-bulk-set- Bulk update variablesvariable-copy- Copy variables between environments
📄 Eyeployments & Monitoring
deployment-list- List deploymentsdeployment-trigger- Trigger new deploymentsdeployment-logs- Get deployment logsdeployment-health-check- Check deployment health
ðŸ—„ï¸ Database Management
database-list-types- List available database typesdatabase-deploy- Deploy and manage databases
Troubleshooting
Common Issues
Issue: Container fails to start
Solution: Check that RAILWAY_API_TOKEN is set correctly in environment variables
Issue: 502 Bad Gateway errors
Solution: Ensure the container is listening on 0.0.0.0:PORT, not localhost:PORT
Issue: MCP commands fail Solution: Verify your Railway API token has the necessary permissions
Logs and Monitoring
# View logs in Railway
railway logs
# Check health status
curl https://your-app.railway.app/health
Security
- Runs as non-root user
- Environment variables for sensitive data
- Minimal Alpine Linux base image
- No unnecessary packages or dependencies
Support
For issues with the Railway MCP server functionality, see the original repository.
For deployment issues, check Railway's documentation or create an issue in this repository.