railway-sandbox-mcp
Provides tools for creating and managing Railway Sandboxes, including running commands, reading and writing files, listing files, taking checkpoints, and destroying sandboxes as isolated development/execution environments.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@railway-sandbox-mcpcreate a sandbox and runpython3 --version"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
railway-sandbox-mcp
A small MCP bridge that lets ChatGPT drive Railway Sandboxes as an isolated development/execution environment.
Architecture
Both long-running Railway services are deployed from this GitHub repository through Railway's GitHub integration:
Railway service | GitHub branch | Railway root directory | Config-as-code file | Purpose |
|
|
|
| Node MCP server backed by the Railway Sandbox SDK |
|
|
|
| OpenAI Secure MCP Tunnel client |
The tunnel-client Dockerfile inherits the official ghcr.io/openai/tunnel-client:latest image and only wraps its entrypoint so the upstream health/readiness server binds to Railway's injected PORT. Railway owns the deployment lifecycle while OpenAI remains the upstream image provider.
ChatGPT
|
v
OpenAI Secure MCP Tunnel
^
| outbound HTTPS
|
tunnel-client (Railway)
|
| Railway private network
v
sandbox-mcp:8080/mcp (Railway)
|
v
Railway Sandbox SDK
|
v
Ephemeral isolated Linux sandboxes with outbound InternetNeither Railway service needs a public domain.
Related MCP server: Railway MCP Server
Config as code
Deployment behavior is committed to this repository:
/railway.jsondefines the MCP service builder, watch paths, start command, health check, and restart policy./tunnel-client/railway.jsondefines the tunnel-client Docker build, watch paths, readiness check, and restart policy./tunnel-client/Dockerfileselects the official OpenAI tunnel-client image and adapts its health listener to Railway's injectedPORT./.github/workflows/ci.ymlvalidates the Node service and Railway config files and builds the tunnel-client image on pushes and pull requests.
Railway configuration committed in code overrides equivalent dashboard build/deploy values for each deployment.
One-time Railway service wiring
Source association, trigger branch, and the custom config-file path are Railway service metadata rather than fields inside railway.json, so configure these once in Railway:
sandbox-mcp
Source repository:
erwinkn/railway-sandbox-mcpBranch:
mainRoot directory:
/Config file path:
/railway.jsonGitHub autodeploy: enabled
Wait for CI: enabled
tunnel-client
Source repository:
erwinkn/railway-sandbox-mcpBranch:
mainRoot directory:
/tunnel-clientConfig file path:
/tunnel-client/railway.jsonGitHub autodeploy: enabled
Wait for CI: enabled
No custom start command; inherit the repository Dockerfile entrypoint
The service-specific watch paths mean MCP-only changes do not rebuild the tunnel client, and tunnel-only changes do not rebuild the MCP server.
Required environment variables
sandbox-mcp
RAILWAY_API_TOKEN: Railway API token with access to the environment where Sandboxes are enabled.RAILWAY_ENVIRONMENT_ID: injected automatically by Railway.
tunnel-client
MCP_SERVER_URL=http://sandbox-mcp.railway.internal:8080/mcpCONTROL_PLANE_TUNNEL_ID=tunnel_...CONTROL_PLANE_API_KEY=...: restricted OpenAI runtime key with Tunnel Read + Use permissions.LOG_LEVEL=infoLOG_FORMAT=json
tunnel-client exposes /healthz, /readyz, and /metrics on Railway's injected port. Railway uses /readyz as the deployment health check, so a successful tunnel-client deployment verifies both tunnel startup and downstream MCP readiness.
Deployment flow
A push to main runs GitHub Actions. With Railway's Wait for CI enabled, Railway waits for CI to pass, then autodeploys only the services whose watch patterns match the changed files.
MCP tools
sandbox_createsandbox_listsandbox_getsandbox_execsandbox_read_filesandbox_list_filessandbox_write_filesandbox_write_filessandbox_checkpointsandbox_destroy
This server cannot be deployed
Maintenance
Related MCP Connectors
Develop, manage, and debug Railway projects, services, and deployments from within agents.
A persistent Linux computer for your AI: what it installs and writes survives the session.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
- mcp-serverOAuthai.cdbx
Build Apps and run code in 30 languages — sandboxed, with persistent sessions for agent loops.
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceEnables spawning ephemeral Linux sandbox containers using Docker and executing commands through an interactive TTY interface. Supports collaborative terminal sessions where both AI clients and humans can simultaneously interact with the same container.27MIT- AlicenseAqualityDmaintenanceEnables AI systems like Claude and Cursor to directly manage Railway projects, deployments, services, environment variables, and monitor logs through natural language commands.910 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to operate a persistent Linux sandbox in the cloud, running commands, managing files, using Git, and publishing artifacts through a Streamable HTTP MCP endpoint.-
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to securely inspect and administer a Linux VPS over Streamable HTTP, with OAuth protection, workspace file tools, and optional root command execution.MIT