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
| Tool | Auth | Purpose |
|---|---|---|
predict_next_prompt | bearer | Predict the human's reply to an agent prompt; returns top-K candidates with calibrated confidence and an auto/escalated decision. |
predict_continuation | bearer | Personalized 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_feedback | bearer | Close the prediction loop — report accepted / edited / rejected so Platt calibration and fact decay learn from the outcome. |
start_session / stop_session | bearer | Open / close a recording session; start_session returns a fresh session_id (emits session.started / session.stopped). |
record_agent_prompt / record_agent_response | bearer | Push 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 tool | Server endpoint |
|---|---|
predict_next_prompt | POST /api/predictions/predict/ |
predict_continuation | POST /api/predictions/continuation/ |
submit_feedback | POST /api/predictions/<id>/feedback/ |
start_session / stop_session / record_agent_prompt / record_agent_response | POST /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_TOKENonce at start-up; every tool call uses that token. - http: multi-tenant. The server reads the per-request
Authorization: Bearer <jwt>(or falls back toCLONE_API_TOKENif 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 ….