Order SMM services from a Node.js agent
A ready MCP client against a local OpenSMM node in plain Node.js: JSON-RPC on POST /mcp over the built-in fetch — no MCP SDK, no npm install, no keys, no money. The whole scenario: initialize → catalog → quote → order → replay by clientReference.
1. Start the node (about 2 minutes)
Node.js ≥ 22.18 is needed for both the node and the client.
git clone https://github.com/opensmm-protocol/mcp-server.git cd mcp-server npm ci npm run gateway
The node prints a line like gateway listening on http://localhost:8080 (REST /v0, MCP /mcp; provider: mock, mock catalog — not real supply) on stderr. Port taken? PORT=8081 npm run gateway. Other startup fixes: node startup failures.
2. Run the MCP client (a second terminal)
node examples/mcp-client.mjs http://127.0.0.1:8080 --client-reference my-first-order
node: http://127.0.0.1:8080 transport: MCP over Streamable HTTP (JSON-RPC on POST /mcp) catalog: MOCK — every service is marked synthetic: not real supply, no real money service: osmm_svc_tg_members_std — Telegram Channel Members — Standard quote: osmm_quote_... — 0.241200 USDC for 100 (mock rate) order: osmm_order_... — REQUIRES_PAYMENT, clientReference "my-first-order" replay: osmm_order_... — same orderId, no second order created done: MCP client OK
Options: [base-url] (default http://127.0.0.1:8080), --client-reference <ref> (default examples-demo-<random>), --quote <quote-id> to reuse a quote printed by another run, --help.
3. One clientReference — one orderId on any transport
A quote is consumed once. To continue an order from another transport, pass the quote and the same clientReference — for example, from the Python REST client to this MCP client.
python3 examples/rest-client.py http://127.0.0.1:8080 --client-reference my-first-order node examples/mcp-client.mjs http://127.0.0.1:8080 --client-reference my-first-order --quote osmm_quote_...
REST: order: osmm_order_... - REQUIRES_PAYMENT, clientReference "my-first-order" MCP: quote: osmm_quote_... (reused) MCP: order: osmm_order_... — REQUIRES_PAYMENT, clientReference "my-first-order"
The MCP client's order: line repeats the orderId from the REST run: one clientReference gives one order on any transport — REST and MCP return the same objects.
4. What the client actually calls
initialize— the MCP handshake (JSON-RPC onPOST /mcp, the node is stateless); the node's answer declares its capabilities.search_services— reads the catalog; on a mock node every service issynthetic: true, and the example refuses to continue unless the service is marked as a mock.get_quote— needsserviceId,quantity,link. A quote is consumed once; every order needs its own.create_order— needsquoteId,link,clientReference. The order staysREQUIRES_PAYMENT— nothing is paid or executed.create_orderagain with the sameclientReference— the replay returns the stored order instead of creating a second one.
The REST equivalents of the same operations: GET /v0/capabilities, GET /v0/services, POST /v0/quotes, POST /v0/orders — the Python REST client.
5. Guard against a live provider
- The client takes the first service from the node's answer — it invents no IDs — and stops at once unless it is marked
synthetic: true. - The error message:
refusing to place a demo order: ... is not marked synthetic. This example orders only on the mock catalog — see examples/README.md. - This guards against a node with a live provider attached: the demo order never reaches real supply.
Honest limits
- This page retells examples/README.md in the mcp-server repo; the exact script output and options are there.
- The scenario for all stacks at once: docs/AGENT_QUICKSTART.md.
- The catalog is a mock (
synthetic: true): no real services, prices or orders here; the rate in the example is a test one, nothing is paid. - Other stacks: the agent quickstart, the Python REST client, ordering from Claude Desktop, ordering from Cursor.
Next: your own node
The example runs on a local node. To be counted in the census, run a node and report its address.
The step-by-step guide, verification and reporting your node are on the “Run a node” page.