Skip to main content
Railway is the most direct hosted fit for a production Redop server. You can run the Bun process as a normal long-lived web service.

Prerequisites

  • a Redop app that uses the HTTP transport
  • a start command that runs your server with Bun
  • environment variables configured in Railway

Minimal server shape

import { Redop } from "redop";

new Redop({
  name: "redop-mcp",
  version: "0.1.0",
})
  .tool("ping", {
    description: "Health check tool",
    handler: () => ({ ok: true }),
  })
  .listen({
    port: Number(process.env.PORT ?? 3000),
    hostname: "0.0.0.0",
  });

Runtime settings

  • listen on process.env.PORT
  • bind to 0.0.0.0
  • keep secrets in Railway service variables
  • configure the health check path as /mcp/health

Deploy steps

  1. Push your Redop app to GitHub.
  2. Create a new Railway project and connect the repo.
  3. Set the service root if your app lives in a workspace or subdirectory.
  4. Add your runtime variables in the service’s Variables tab.
  5. Set or confirm the start command that runs the Bun server.
Example start command:
bun run src/index.ts
If you build first, use a start command that runs the built server instead.

Verify the deployment

Once Railway assigns a public domain, check:
curl https://your-service.up.railway.app/mcp/health
You should receive an HTTP 200 response.

Redop note

Railway injects PORT for public services, so Redop should use that value instead of a fixed port.

Common mistake

Do not bind to localhost. Railway expects your app to listen on 0.0.0.0:$PORT.

Next