Deploying an OpenSMM node: from source and Docker Compose

Deploying an OpenSMM node

Run a node from source or with Docker Compose, check it and expose it to the public behind a proxy.

1. From source

A node is one process: REST /v0 and MCP /mcp on one port (default 8080). You need Node.js ≥ 22.18. No keys and no external services: the node boots on the built-in mock catalog.

bash
git clone https://github.com/opensmm-protocol/mcp-server.git
cd mcp-server
npm ci
PORT=8080 OPENSMM_STATE_FILE=./opensmm-state.json npm run gateway

State (orders, metrics, self-registered nodes) lives in a single JSON snapshot; with OPENSMM_STATE_FILE on a volume the node survives restarts. Without it the state is in memory only.

2. Docker Compose

The image is built locally from the checkout: there is no public image and no npm package. Compose mounts the opensmm-data volume for state and binds the port to loopback.

bash
docker compose up --build -d
docker compose ps   # STATUS column shows "healthy"

The healthcheck polls GET /v0/services inside the container, so healthy means “ready to take an order”. Without Compose: docker build -t opensmm-gateway . and docker run -d --name opensmm -p 127.0.0.1:8080:8080 -v opensmm-data:/data opensmm-gateway.

3. Check the node

Process liveness is /health; the full check (catalog and MCP initialize) runs the same two probes the census uses.

bash
curl -s http://127.0.0.1:8080/health
npm run verify:node -- http://127.0.0.1:8080

Exit code 0 means the census would count the node. The node definition and the census: docs/NODES.md.

4. A public address: TLS and safety

The node has no TLS and no authentication of its own, so expose it only behind a proxy.

  • keep the port on loopback only; inbound is 80/443 through a reverse proxy (for example Caddy: reverse_proxy 127.0.0.1:8080);
  • OPENSMM_TRUST_PROXY=1 only when the proxy overwrites x-forwarded-for;
  • keep state on a persistent volume; the state file holds provider credentials, mode 0600, back it up like a secret;
  • leave OPENSMM_ALLOW_PRIVATE_ENDPOINTS unset — it is the dev SSRF escape hatch.

Without a permanent domain a free Cloudflare quick tunnel is enough to test (cloudflared tunnel --url http://127.0.0.1:8080), but its URL is temporary. Full details: docs/DEPLOY.md.

Honest limits

  1. The npm package and a public image are not published: the node is built from a repository checkout.
  2. A local node serves a mock catalog (synthetic: true), not real supply.
  3. A live provider is connected through OPENSMM_REST_V1_*, a separate step.

Next step: run your own node

A node is a single process serving REST /v0 and MCP /mcp on one port. You need Node.js ≥ 22.18.

Run your own node

The step-by-step guide, node verification and reporting your node live on the “Run a node” page.