SporeLabs Improve API + MCP

The loop is included for every funded account — there is no plan and nothing to subscribe to. Customers and agents never submit a train job, pick a tier, or babysit a run: they apply a specialization for a work pattern, and SporeLabs designs the data, trains, evaluates, and routes to it. Train jobs still exist internally — they are platform-owned and do not debit the customer's wallet.

Inference, eval runs, and agent runs burn wallet dollars; the loop itself (including training runs) is free. See SPORELABS_SPECIFICATION.md §7.

Auth

Base URL (prod): https://sporelabs.dev/api. The drop-in API is same-origin at https://sporelabs.dev/v1.

The loop, endpoint by endpoint

Method Path Notes
GET /v1/improve Loop state, capabilities, counters
POST /v1/improve/settings { auto_apply } — cut over without asking
POST /v1/improve/refresh One full pass: audit → propose → advance → evaluate → offer agents. Optional bounded focus string steers toward matching patterns/tools; transient, never bypasses the prove-gate
GET /v1/improve/logs Loop run history
POST /v1/improve/audit Audit only, { window_days? }
GET /v1/improve/audit/export Raw audit events (call features only — never prompt text)
DELETE /v1/improve/audit Delete events + imported datasets
GET /v1/changes What we changed and what it saved (spec §5.0.1)
POST /v1/changes/{change_id}/done · /dismiss Resolve a change record
GET /v1/savings Unified money + suggestions + proof briefing
GET /v1/patterns · /v1/patterns/{id} Work patterns; detail includes eval runs
GET /v1/specializations Status + cutover_pass_rate_pct (the bar a model must clear)
POST /v1/specializations/propose Propose where a finetune pays for itself
POST /v1/specializations/{id}/apply We train it; the route stays in shadow
POST /v1/specializations/{id}/reject Not worth it
POST /v1/specializations/{id}/evaluate Score against saved cases
POST /v1/specializations/{id}/cutover Serve it, once eval passed
GET /v1/router · PATCH Routes + fallback; PATCH sets default_model
PATCH /v1/router/routes/{pattern_id} { mode: live\|shadow\|off, model?, fallback_model?, pinned? }
GET /v1/eval/continuous Pass rates, tool-call trends, savings vs frontier (assumptions included)
GET/POST /v1/datasets List / import your rows (encrypted; capped share of the training mix)
GET/DELETE /v1/datasets/{id} Export or delete
GET /v1/agent-proposals Agents worth hosting, from patterns
POST /v1/agent-proposals/propose Propose an agent from intent
POST /v1/agent-proposals/{id}/accept · /decline Accept creates the hosted agent

Read-only train visibility remains at GET /v1/jobs and GET /v1/jobs/{id} for support; specialization status already reflects training, so clients should prefer /v1/specializations.

Typical agent session

curl -sS -X POST "$API/v1/improve/refresh" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{}'
# → patterns, new_specializations, evaluated, new_agent_proposals

curl -sS -X POST "$API/v1/specializations/$SPEC/apply" \
  -H "Authorization: Bearer $TOKEN"
# → status: training. Route is shadow until eval clears the bar, then cutover.

MCP (Claude Code / Cursor)

Full MCP parity with the dashboard is launch-critical, and tests/test_mcp_parity.py fails the build if the portal gains an endpoint the MCP server lacks. Package: packages/mcp (@edgeflow/mcp — the package name may lag SporeLabs branding).

Agents talk only to the SporeLabs Accounts API (same routes as the portal). No separate train vendor, no GPU dashboard, no infra credentials.

cd packages/mcp && pnpm install && pnpm build

Cursor — merge packages/mcp/cursor.mcp.json into ~/.cursor/mcp.json (fix the absolute path).

Claude Code:

claude mcp add edgeflow -- node /ABS/PATH/packages/mcp/dist/index.js

Then edgeflow_login → paste the code from /agent.htmledgeflow_whoami.

Tools: edgeflow_login, edgeflow_whoami, edgeflow_api_keys, edgeflow_wallet, edgeflow_topup, edgeflow_billing_portal, edgeflow_billing_controls, edgeflow_usage, edgeflow_improve, edgeflow_improve_settings, edgeflow_improve_refresh, edgeflow_improve_logs, edgeflow_changes, edgeflow_change_resolve, edgeflow_savings, edgeflow_patterns, edgeflow_specializations, edgeflow_propose_specializations, edgeflow_specialize, edgeflow_router, edgeflow_eval_continuous, edgeflow_eval_cases, edgeflow_eval_run, edgeflow_datasets, edgeflow_import_dataset, edgeflow_dataset, edgeflow_audit_data, edgeflow_agent_proposals, edgeflow_propose_agents, edgeflow_agent_proposal, edgeflow_list_agents, edgeflow_create_agent, edgeflow_run_agent.

There is deliberately no train tool, no tier list, no subscribe/cancel tool, and no embed-key tool.

See packages/mcp/README.md in the repo.


Operator only (internal train worker)

Not for customers or MCP users. Specializations dispatch platform-owned jobs through the same worker. Wire the private train webhook after deploying the GPU worker; set Lambda env EDGEFLOW_TRAIN_WEBHOOK_URL + EDGEFLOW_TRAIN_WEBHOOK_SECRET via GitHub production secrets, then ./scripts/ci/deploy-production.sh accounts-api.