MCPHub
Back to blog
DockerTutorial1 min read

Self-Host MCPHub with Docker

Run MCPHub locally, connect an upstream server, and verify your first tool call through the gateway.

MMCPHub team

This walkthrough uses Docker to run a local MCPHub instance and verify a tool call from an MCP client.

1. Start the gateway

With Docker running, run these commands from a directory where you can keep the gateway’s data:

mkdir -p data
docker run -d --name mcphub -p 127.0.0.1:3000:3000 -v "$(pwd)/data:/app/data" samanhappy/mcphub
docker logs mcphub

Open http://localhost:3000. On first launch, sign in as admin using the generated password shown in the container logs and change it in the dashboard. The port binding keeps this instance local. Keep the data directory when replacing the container.

2. Add an upstream server

In the dashboard, choose Add Server, name it fetch, select stdio, set the command to uvx, and add mcp-server-fetch as its argument. Save and check that the server connects. For an existing remote server, choose its transport and use its documented endpoint and credentials instead.

3. Connect a client and verify the result

In a client that supports Streamable HTTP, such as Cursor, add http://localhost:3000/mcp. If gateway authentication is enabled, configure the required credentials in the client. Refresh its tool list and ask it to fetch https://example.com. Check that the fetch tool appears and returns page content. If it is missing, check the upstream connection in the dashboard and inspect docker logs mcphub.

For shared deployments, set access policies before publishing the gateway endpoint, serve it over HTTPS, and pin a versioned image for repeatable upgrades. See the official quickstart for configuration details or learn how gateway routing works.