Heroku

Deploy your MCP server with git push

Heroku builds and runs your app from a git push. Its Node.js buildpack installs your dependencies and runs npm run build, which compiles the server and bundles the widgets. Heroku then starts the process named web in your Procfile. You don't need a Dockerfile, and the app gets HTTPS on a *.herokuapp.com address.

Clients connect to https://<your-app>.herokuapp.com/mcp.

Before you start

You need a Heroku account, the Heroku CLI signed in with heroku login, and your project committed to a git repository.

Deploy

Add a Procfile

The Procfile tells Heroku how to start the server. Start the compiled server directly with node, not with npm start. The start script rebuilds the project on every start and runs the server on port 3000, while Heroku assigns a different port through the PORT variable, which the server reads automatically.

Procfile
web: node dist/index.js

Create the app and set its configuration

Create the app, then set the variables the server reads:

heroku create my-mcp-server

heroku config:set NODE_ENV=production HOST=0.0.0.0 MCP_TRANSPORT_TYPE=http

Don't set PORT yourself; Heroku sets it on every start.

Push to deploy

Push your code to Heroku's git remote:

git push heroku main

Heroku builds the app and starts one web dyno. Every later push to main deploys again.

Check that it's running

Call the health endpoint:

curl https://my-mcp-server.herokuapp.com/mcp/health

Secrets

Heroku config vars are encrypted at rest and exposed to your server as environment variables. Set secrets the same way as other configuration, and never commit them:

heroku config:set JWT_SECRET=your-secret-value

Changing a config var restarts the app, so the server picks up the new value immediately.

Scaling and logs

Run more dynos to handle more traffic, or a larger dyno type for more memory:

heroku ps:scale web=2

Stream the server's output, including startup errors, from the terminal:

heroku logs --tail

Next steps

On this page