Deploying the MCP to the Cloud (Heroku)
Heroku supports MCP servers out of the box, there is support for stdio and http transports. HTTP transport, as you guessed, is just a regular web application so you can use a web process type in the Procfile.
web: node dist/index.js httpAnd for the stdio transport, you can use a mcp process type in the Procfile.
mcp: node dist/index.js stdioThe mcp process type is a special process type that will allow using the MCP within an Heroku Agent using the Heroku Managed Inference and Agents add-on.
So, before deploying, let's create a Procfile file in the root of the project.
web: node dist/index.js http
mcp: node dist/index.js stdioAnd then we can deploy the MCP Server to the Cloud using Heroku.
WARNING
❗️ Make sure you have initialized this project as a git repository and run heroku git:remote -a <username>-mcp-task-manager to setup the remote repository.
git add .
git commit -m "Deploying the MCP Server to the Cloud"
git push heroku mainOnce deployed let's scale our web process to 1 instance.
heroku ps:scale web=1TIP
💡If there is a problem with the deployment, you can check the logs by running: heroku logs --tail
Let's test the remote MCP Server with the inspector by running:
npx @modelcontextprotocol/inspector --transport http --server-url https://<app-name-id>.herokuapp.com/mcpNow that our MCP Server is deployed, let's integrate it with your favorite AI tool.