Skip to content

Railway

Deploy your xmcp application to Railway.

For the complete documentation index, see llms.txt. Markdown variants of every page are available by appending .md to the URL.

Railway can run your xmcp server as a Node.js service, exposing your tools over Streamable HTTP.

Start with an existing standalone xmcp project or create one with pnpm create xmcp-app@latest, choosing HTTP transport. The HTTP transport example demonstrates the server and build scripts used here.

Configure your server

Set the HTTP host to 0.0.0.0 so Railway can reach your server:

xmcp.config.ts

Keep your existing tools and other configuration. The default HTTP port is 3001 and the default MCP endpoint is /mcp.

Ensure your package.json includes these scripts and Node.js version, then commit your project and lockfile to GitHub:

package.json

The build requires the @xmcp-dev/compiler development dependency included by the scaffolder. Install development dependencies during the build.

Deploy from GitHub

  1. Create a project at railway.com/new, select Deploy from GitHub repo, and choose your repository.
  2. In the service's Variables, set PORT to 3001 and add any environment variables your tools need. This matches xmcp's default HTTP port. If you configure a different http.port, use that value for PORT and rebuild; the HTTP port is compiled into the server.
  3. In Settings, use pnpm run build as the build command and node dist/http.js as the start command. Railway detects Node.js and installs dependencies using your lockfile. For a project using npm, use npm run build instead.
  4. Set the healthcheck path to /health, xmcp's built-in health endpoint, and deploy the service.
  5. Under Settings → Networking, select Generate Domain. If prompted for a target port, use the same value as PORT.

Your MCP endpoint is https://<your-domain>/mcp. If you customized http.endpoint, use that path instead. Add this URL to an MCP client to list and call your tools.

You can also check that the server is running with:

Learn more in Railway's Node.js deployment guide and healthcheck documentation.

On this page

One framework to rule them all