mcp

v1.0.1
market.mtok/mcp Checked 3 days ago Published 4 months ago

Spot market for AI inference tokens.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_spot

Spot prices per model: the delivered OUTPUT-token rate (USD/MTok) from affirmed on-chain draws (last price, median, draw count).

selling_guide

Turnkey, executable steps to put a human's spare AI capacity on mtok.market via SELLER-HOSTED delivery — run YOUR OWN relay pointed at an upstream you control (a local Ollama/vLLM model, a subscription via a CLI bridge, or a provider key) and list a tier:direct offer; buyers pay you per chunk on-chain. Gotchas baked in. supply_type filters to one path.

ParameterTypeDescription
supply_typestringNarrow the guide to one supply path: "open-weight" (a local Ollama/vLLM model), "subscription" (a CLI bridge to a plan you pay for), or "provider-key" (an API key you hold). Omit for all three.

buying_guide

Turnkey, executable steps to get a human cheap AI tokens and run their prompts on mtok.market: bid (read routes[]) or read the book for a tier:direct offer, then draw paid chunks from the seller's relay (pay each draw on-chain through MtokDripLedger, POST <relayEndpoint>/chunk, the relay verifies DrawPaid and serves). You need a funded wallet on Base.

get_book

Open offers (asks) and bids for a model. sort=input|output ranks by that dimension.

ParameterTypeDescription
modelstringModel id as listed in the book, e.g. "llama-3.1-70b". Exact string match. Omit for every model.
sortstringRank by "input" (inputPricePerMTok) or "output" (outputPricePerMTok). Default output.

get_draws

The chain-derived draw tape: contract-paid draws indexed from MtokDripLedger events on Base. status=inProcess (DrawPaid with no terminal yet) | settled (closed by DrawAffirmed or DrawDisputed). This is the canonical delivered/receipt surface; the platform records nothing off-chain.

ParameterTypeDescription
limitintegerMax draws returned, newest first, 1..200. Default 50.
statusstring"inProcess" = DrawPaid with no terminal event yet; "settled" = closed by DrawAffirmed or DrawDisputed. Omit for both.

get_stats

Exchange fee model plus chain-derived volume: delivered volume + affirmed/disputed counts, all recomputable from MtokDripLedger events on Base (source:"chain").

register

Create an agent identity. Returns {agentId, apiKey}; send the apiKey as the x-api-key (or Authorization: Bearer) header on EVERY subsequent request to act as that agent — this transport is stateless, so it is not remembered between calls. Pass pubkey (Ed25519 SPKI PEM) if you will place signed non-custodial orders.

ParameterTypeDescription
name *stringDisplay name for the agent, free text, e.g. "my-ollama-seller". Not unique.
pubkeystringEd25519 public key as an SPKI PEM ("-----BEGIN PUBLIC KEY-----" ... ). Required later for signed orders; the SDK mints and publishes one for you.

get_me

Your agent state: open orders (offers + bids). Non-custodial — there is no platform wallet, grant, or credential vault in /me; money moves peer-to-peer on-chain, and your delivered draws are the on-chain tape (get_draws).

place_offer

List capacity for sale via SELLER-HOSTED delivery (tier:"direct" — the only advertised path). Set tier:"direct" + relayEndpoint (your relay's PUBLIC HTTPS url — a cloudflared tunnel gives one free) + settlementPubkey (your seller payout EVM address on Base) and NO credentialId: you run your own relay (mtok-relay or any conforming passthrough) pointed at an upstream you control, and buyers pay each draw on-chain through MtokDripLedger (canonical relay protocol: GET /api/guides/selling, notes.directTierProtocol). After every instance behind relayEndpoint is dual-stack, add requestHashScheme:…

ParameterTypeDescription
inputPricePerMToknumberAsk price for input tokens, USD per million tokens, positive, e.g. 0.20.
inputTokensintegerInput (prompt) tokens in the block, whole tokens, e.g. 1000000 for one MTok.
intentobjectPre-signed order intent (the SDK builds it). When present with sig the flat fields are ignored; the order comes from intent.params.
modelstringModel id as listed in the book, e.g. "llama-3.1-70b". Exact string match.
outputPricePerMToknumberAsk price for output tokens, USD per million tokens, positive, e.g. 0.80.
outputTokensintegerOutput (completion) tokens in the block, whole tokens, e.g. 500000.
payoutAddressstringWhere seller USDC lands. Canonical EVM address on Base: 0x + 40 hex, e.g. "0x1234567890abcdef1234567890abcdef12345678".
recurringbooleantrue to re-list the same block each time the window closes. Default false.
relayEndpointstringPublic HTTPS base url of your relay, e.g. "https://quiet-fox.trycloudflare.com". Buyers POST <relayEndpoint>/chunk.
requestHashSchemestringOptional signed rollout marker; set only when every relay instance behind relayEndpoint is dual-stack.
settlementPubkeystringSeller wallet the on-chain draw pays; for a direct offer the same wallet as payoutAddress. Canonical EVM address on Base: 0x + 40 hex, e.g. "0x1234567890abcdef1234567890abcdef12345678".
sigstringEd25519 signature over intent, base64url. Pair with intent.
startsInSecondsintegerDelay before the offer window opens, seconds, 0..604800. Default 0 (open now).
tierstringDelivery tier. "direct" (seller-hosted relay) is the only one advertised.
usableForSecondsintegerHow long buyers can draw against this offer once its window opens, seconds, 300..604800 (5 minutes to 7 days), e.g. 43200.

place_bid

Bid for a block. The bid response returns routes[] — the crossing SELLER-HOSTED offers (lowest price first), each {offerId, sellerId, relayEndpoint, settlementPubkey, requestHashScheme?, inputPricePerMTok, outputPricePerMTok, availableInputTokens, availableOutputTokens}. Pick a route and DRAW paid chunks from its relayEndpoint (pay each draw on-chain through MtokDripLedger using /api/config, POST <relayEndpoint>/chunk, then affirmDraw/disputeDraw on-chain — see buying_guide / drawFromSeller). priceOn=input|output ranks matches by one dimension. You ALWAYS need a funded wallet on Base (ther…

ParameterTypeDescription
inputTokensintegerInput (prompt) tokens in the block, whole tokens, e.g. 1000000 for one MTok.
intentobjectPre-signed order intent (the SDK builds it). When present with sig the flat fields are ignored; the order comes from intent.params.
maxInputPricePerMToknumberMost you will pay for input tokens, USD per million tokens, e.g. 0.25.
maxOutputPricePerMToknumberMost you will pay for output tokens, USD per million tokens, e.g. 1.00.
maxStartDelaySecondsintegerLongest you will wait for an offer window to open, seconds, 0..604800. Default 0 (open now only).
modelstringModel id as listed in the book, e.g. "llama-3.1-70b". Exact string match.
outputTokensintegerOutput (completion) tokens in the block, whole tokens, e.g. 500000.
priceOnstringRank crossing offers by "input" or "output" price alone. Omit to rank by the sum of both.
sigstringEd25519 signature over intent, base64url. Pair with intent.

cancel_order

Cancel one of your open orders. side: offer|bid.

ParameterTypeDescription
id *stringThe order id returned by place_offer / place_bid, also listed by get_me.
side *string"offer" or "bid": which book the order is on.

get_reputation

A seller's reputation: score, tier, recommendedMaxChunkUsd (the per-draw size a buyer should risk in the direct tier), plus a chain object {affirmed, disputed, deliveredUsd} folded from MtokDripLedger events (source:"chain").

ParameterTypeDescription
agentId *stringThe seller agent id, as returned by register and shown as sellerId on routes[] and book offers.

get_config

Chain config a SELLER-HOSTED buyer needs to build the on-chain draw payment: { feeAddress, feeBps, dustThresholdUsd, chainId, usdcAddress, dripContractAddress }. Pay each draw through the MtokDripLedger contract at dripContractAddress (payDraw), then affirmDraw/disputeDraw on-chain; the seller relay verifies the DrawPaid event before delivery.