Read the contract
The documentation site’s Ask AI / MCP features search documentation. To execute product tools, connect to
https://api.pre.dev/mcp using the product MCP setup.
Select an interface
Both official SDKs are named
predev-api. Python imports use from predev_api import PredevAPI; Node imports use import { PredevAPI } from 'predev-api'. The Python SDK uses blocking HTTP calls, including its server-side async submission methods.
Keep names distinct
Pass existing context as text describing the codebase. It is not an ID that automatically loads another project.
Handle work that takes time
- For REST specifications, submit with
async: true, savespecId, and poll the status endpoint at a bounded interval, such as every five seconds. - Stop polling specifications on
completedorfailed. On success, consumecodingAgentSpecMarkdownorcodingAgentSpecJson; use the human variants for review and estimates. - For browser work, always send a
tasksarray. Save the returnedid, then poll or stream the existing run. - Browser batch status is lowercase (
processing,completed,failed). Individual task statuses are uppercase. A completed batch can contain failed tasks; inspect each task’sstatusanderror. - Use batch
statusto detect completion. Results may containPENDING/RUNNINGentries ornullslots. Do not infer completion from array length or thecompletedcount alone. - Request
includeEvents=truewhen you need evidence or debugging. Timelines can contain large screenshots; omit them for routine polling.
Submit deliberately
- Browser tasks can interact with external sites. State the action and success condition clearly, and use the task’s
outputJSON Schema when your code depends on a specific data shape. - Check queue capacity before submitting a large batch. The default 1,000-task request ceiling and your account’s in-flight limit are different limits.
- REST browser submissions accept
Idempotency-Keyfor retries within 24 hours. Use one key per logical submission. This is a lookup, not an atomic guarantee for simultaneous first submissions. This option is not exposed by the current MCP tool or SDK method signatures. - A timeout or disconnected stream does not prove the task stopped. Retrieve the existing run before submitting work again. Stream EOF is not a success signal.
- Handle HTTP errors and stream
errorframes. Errors and retries explains billing, queue, and rate-limit responses. - Some MCP tools return text without
structuredContent, and some specification failures return text withoutisError. Read the tool result and confirm specification status withget_spec.

