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.
web: node dist/index.jsCreate 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=httpDon't set PORT yourself; Heroku sets it on every start.
Push to deploy
Push your code to Heroku's git remote:
git push heroku mainHeroku builds the app and starts one web dyno. Every later push to main deploys again.
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-valueChanging 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=2Stream the server's output, including startup errors, from the terminal:
heroku logs --tail