Order SMM services from OpenAI Agents SDK
There is no ready-made example for OpenAI Agents SDK in the mcp-server repo yet — no invented code or tool wrappers here. An OpenSMM node exposes the tools search_services, get_quote and create_order over MCP on POST /mcp; this page honestly points to the nearest working example — the SDK-free MCP client in examples/ and docs/AGENT_QUICKSTART.md. Everything runs on the mock catalog: every service is marked synthetic: true, orders stay REQUIRES_PAYMENT and are never paid — no key, account or money needed.
1. Start a node (about 2 minutes)
You need Node.js ≥ 22.18. Start a node with the mock catalog — it serves REST /v0 and MCP /mcp.
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. Check from another terminal: curl -s http://127.0.0.1:8080/v0/services | head -30 — every service has "synthetic": true. Port taken? PORT=8081 npm run gateway. Other startup issues: node startup failures.
2. How to wire the MCP server
examples/README.md ships a ready HTTP MCP server config block. It is documented as working with any MCP client; how to wrap MCP tools in the OpenAI Agents SDK is in that SDK's docs, not in this repo.
{
"mcpServers": {
"opensmm": {
"url": "http://127.0.0.1:8080/mcp"
}
}
}
The config matches mcp.json in the repo root: server io.github.opensmm-protocol/mcp-server, package @opensmm/mcp-server, MCP protocol 2025-06-18. The stdio npm run mcp block is in examples/README.md.
3. Nearest working example: an SDK-free MCP client
To see the whole scenario without the OpenAI Agents SDK, run the ready examples/mcp-client.mjs — it speaks JSON-RPC directly to POST /mcp: initialize → search_services → get_quote → create_order twice. No dependencies, no MCP SDK, no keys, no money.
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
The order: and replay: lines are the same orderId: one clientReference yields one order on any transport. Full walkthrough: docs/AGENT_QUICKSTART.md.
4. What the agent actually called
initialize— the client negotiates MCP protocol2025-06-18.search_services— reads the catalog; every entry carriessynthetic: true. The examples refuse to continue if a service is not marked mock.get_quote— price one service for quantity 100 and the linkhttps://t.me/opensmm_example. A quote is consumed once, so each order needs its own.create_order— an unpaid order. Over REST this is HTTP 402 with the order body; nothing is paid, nothing executes.create_orderagain with the sameclientReference— the replay returns the stored order instead of creating a second one.
REST equivalents: GET /v0/services, POST /v0/quotes, POST /v0/orders, poll with GET /v0/orders/:id.
If something looks wrong
is not marked synthetic— the node is not on its mock catalog; stop, do not order. Restart it without a provider configured.ECONNREFUSED— the node from step 1 is not running or uses another port.IDEMPOTENCY_CONFLICT— thatclientReferencealready belongs to an order made from a different quote; pass the original via--quoteor use a new reference.- HTTP 402 on
POST /v0/ordersis expected, not a failure.
Honest limits
- There is no dedicated ready example for OpenAI Agents SDK in the repo: how to wrap the MCP tools in the SDK is in the SDK docs, not on this page.
- This page retells examples/README.md and docs/AGENT_QUICKSTART.md; the working MCP client and steps are there.
- The catalog is a mock (
synthetic: true): no real services, prices or orders here; the rate in the example is a test rate, payment does not go through. - Other stacks: agent quickstart, a LangChain-style agent, ordering from Claude Code.
Next: your own node
The example runs on the local mock 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.