MCP server
Agents that speak the Model Context Protocol can use Sparecycle with the same API keys and the same rules as the OpenAI-compatible API: the key's daily cap, the off switch, and results only for the key that submitted the job.
Connect
| Setting | Value |
|---|---|
| Endpoint | https://sparecycle.tech/v1/mcp |
| Also at | https://sparecycle.tech/api/v1/mcp |
| Transport | Streamable HTTP, stateless: one POST per message, JSON answers, no session, no SSE stream (GET answers 405) |
| Auth | Authorization: Bearer sck_… on every request; no key, or a disabled or deleted key, answers 401 |
| Protocol versions | 2026-07-28 (no handshake; server/discover) and 2025-11-25, 2025-06-18, 2025-03-26 (with initialize) |
Most clients take a server URL and request headers. A typical configuration:
{
"mcpServers": {
"sparecycle": {
"url": "https://sparecycle.tech/v1/mcp",
"headers": { "Authorization": "Bearer sck_…" }
}
}
}claude mcp add --transport http sparecycle https://sparecycle.tech/v1/mcp --header "Authorization: Bearer $SPARECYCLE_API_KEY"npx @modelcontextprotocol/inspector@2.16.0 --cli https://sparecycle.tech/v1/mcp --transport http \
--header "Authorization: Bearer $SPARECYCLE_API_KEY" --method tools/listKeep the key out of shared config files: use your client's secret or environment-variable support where it has one.
Tools
Exactly four tools. There is no tool to withdraw funds and none to create or change keys. A12: default, not yet confirmed
| Tool | Input | Output |
|---|---|---|
submit_job | kind (text | image), model (qwen2.5-1.5b | sd15), prompt; text: system, max_tokens; image: size, negative_prompt, steps, guidance, seed | job_id, status (queued), price_wei, receipt_url |
get_job_status | job_id | status, settled_at, charge_status, price_wei, receipt_url (this key's jobs only) |
get_job_result | job_id | text content, or image content (PNG, base64), then a second text block { "sparecycle": { "job_id", "status", "receipt_url" } }; before agreement, a note that it is not ready |
get_balance | none | the key's wallet: balance_wei, held_wei, available_wei, spend_limit_per_epoch_wei, pending_withdrawal; and the key: daily_cap_wei, spent_today_wei, next_reset_at |
Jobs are asynchronous: call submit_job, then get_job_status until it says agreed, then get_job_result. Limits and prices are the same as on the OpenAI-compatible API.
receipt_url is the job's receipt (GET /api/v1/jobs/<job_id>/receipt, read with the same key): both nodes' signed results, and once the epoch's charge is on-chain, the proof that ties the job to that charge. See Billing.
Errors
Problems with a job are tool errors (isError: true) whose text is JSON: { "error": { "code", "type", "message" } }, with the same codes as the OpenAI-compatible API. A job the two nodes did not agree on comes back from get_job_result as results_did_not_match, job_expired or content_rejected with type not_charged: nothing was charged for it. Another key's job is forbidden; a job over the key's cap for today is key_daily_cap_reached. When no two nodes with different owners can take the model now, submit_job fails with no_node_pair and nothing is queued, held or charged; try again later (Models shows live capacity).
A missing or bad key is an HTTP 401 with a JSON-RPC error. An unknown tool is JSON-RPC error -32602; the protocol's own errors (-32020 header mismatch, -32022 unsupported protocol version) follow the MCP specification.