railway-sandbox-mcp

railway-sandbox-mcp

Enables ChatGPT to create, manage, and execute commands in ephemeral isolated Linux sandboxes on Railway, with file operations and checkpointing.

Category
Visit Server

README

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
sandbox-mcp main / /railway.json Node MCP server backed by the Railway Sandbox SDK
tunnel-client main /tunnel-client /tunnel-client/railway.json 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 Internet

Neither Railway service needs a public domain.

Config as code

Deployment behavior is committed to this repository:

  • /railway.json defines the MCP service builder, watch paths, start command, health check, and restart policy.
  • /tunnel-client/railway.json defines the tunnel-client Docker build, watch paths, readiness check, and restart policy.
  • /tunnel-client/Dockerfile selects the official OpenAI tunnel-client image and adapts its health listener to Railway's injected PORT.
  • /.github/workflows/ci.yml validates 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-mcp
  • Branch: main
  • Root directory: /
  • Config file path: /railway.json
  • GitHub autodeploy: enabled
  • Wait for CI: enabled

tunnel-client

  • Source repository: erwinkn/railway-sandbox-mcp
  • Branch: main
  • Root directory: /tunnel-client
  • Config file path: /tunnel-client/railway.json
  • GitHub 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/mcp
  • CONTROL_PLANE_TUNNEL_ID=tunnel_...
  • CONTROL_PLANE_API_KEY=...: restricted OpenAI runtime key with Tunnel Read + Use permissions.
  • LOG_LEVEL=info
  • LOG_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_create
  • sandbox_list
  • sandbox_get
  • sandbox_exec
  • sandbox_read_file
  • sandbox_list_files
  • sandbox_write_file
  • sandbox_write_files
  • sandbox_checkpoint
  • sandbox_destroy

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured