Skip to main content

MCP Server reference

This is the tool-by-tool reference for the Clone MCP server. The server is a thin wrapper over the REST API documented under API Reference; for the install / transport story see Apps → MCP.

Tool index

ToolAuthPurpose
predict_next_promptbearerPredict the human's reply to an agent prompt; returns top-K candidates with calibrated confidence and an auto/escalated decision.
predict_continuationbearerPersonalized loop-termination decision for ralph-style self-correcting agents — returns should_continue: bool + calibrated confidence so the plugin can stop when the user would already be satisfied.
submit_feedbackbearerClose the prediction loop — report accepted / edited / rejected so Platt calibration and fact decay learn from the outcome.
start_session / stop_sessionbearerOpen / close a recording session; start_session returns a fresh session_id (emits session.started / session.stopped).
record_agent_prompt / record_agent_responsebearerPush agent.prompt / agent.response events so the User Model has the conversational substrate for future predictions.

Calling pattern

Every tool is a thin pass-through to a Django endpoint:

MCP toolServer endpoint
predict_next_promptPOST /api/predictions/predict/
predict_continuationPOST /api/predictions/continuation/
submit_feedbackPOST /api/predictions/<id>/feedback/
start_session / stop_session / record_agent_prompt / record_agent_responsePOST /api/recording/events/

Errors propagate as MCP tool errors with the upstream HTTP status visible in the message — for example, a 503 from the prediction LLM-key path arrives at the client as network error talking to https://api.clone.is/api/predictions/predict/: ….

Auth modes (recap)

  • stdio: single-tenant. The server reads CLONE_API_TOKEN once at start-up; every tool call uses that token.
  • http: multi-tenant. The server reads the per-request Authorization: Bearer <jwt> (or falls back to CLONE_API_TOKEN if set) and forwards it upstream so one MCP instance can serve many users.

Token format detection is automatic — tokens that start with clone_ are sent as X-Clone-API-Key; anything else is treated as a JWT and sent as Authorization: Bearer ….