1. Get a key
Keys start with
fc_live_
and belong to one workspace. The secret is shown once; send it as a bearer token on every request.
- Sign up at /signup and a workspace is created with your account.
- In the dashboard, open API keys and create a key. Name it after the agent that will hold it.
- Store the secret where the agent reads its environment.
Running forecraft yourself? The seed prints a demo key, once:
npm install
npm run seed # prints a demo key once: fc_live_…
npm start # http://localhost:3000
Then put the URL and the key where your tools can read them:
export FORECRAFT_URL=http://localhost:3000
export FORECRAFT_API_KEY=fc_live_…
2. Read the contract
- /llms.txt — the whole product in one text file, written for you.
- /openapi.json — every endpoint, request and response, as OpenAPI.
- /docs/for-agents — the exact curl sequence: create, preview, publish, submit, list, export.
- /docs/definitions — the form definition: schema, ui, rules, appearance.
- /docs/mcp — the MCP server: install, tools, resources.
-
GET /api/v1/vocabulary— the themes, accents and layouts a definition may name.
3. Connect over MCP
Add the server to your host's
.mcp.json
(Claude Code reads it from the project root). It speaks stdio and wraps the same REST API.
{
"mcpServers": {
"forecraft": {
"command": "node",
"args": ["packages/mcp/index.mjs"],
"env": {
"FORECRAFT_URL": "http://localhost:3000",
"FORECRAFT_API_KEY": "fc_live_…"
}
}
}
}
| Tool | What it does |
|---|---|
forecraft_create_form
|
Create a form from a definition. |
forecraft_update_form
|
Replace the draft definition, status, limit or slug. |
forecraft_get_form
|
Read one form, its definition and its public URL. |
forecraft_list_forms
|
List the workspace's forms. |
forecraft_preview_form
|
Render the form and audit it: HTML, findings, rules. |
forecraft_publish_form
|
Snapshot the draft as a version; the public URL serves it. |
forecraft_list_submissions
|
Read answers, filtered by text, version or date. |
forecraft_get_submission
|
Read one submission. |
The resource
forecraft://form/{id}
returns a form's definition.
4. Or call the API
A first call, to check the key:
curl -s "$FORECRAFT_URL/api/v1/forms" \
-H "Authorization: Bearer $FORECRAFT_API_KEY"
It answers
{ "items": [] }
for a new workspace. Then create a form:
curl -s "$FORECRAFT_URL/api/v1/forms" \
-H "Authorization: Bearer $FORECRAFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"definition": {
"schema": {
"title": "Beta waitlist",
"type": "object",
"properties": {
"email": { "type": "string", "format": "email" },
"plan": { "type": "string", "enum": ["Solo", "Team"] }
},
"required": ["email", "plan"]
},
"appearance": { "theme": "aurora" }
}
}'
Next: the full curl sequence — preview, publish, submit, list and export.
5. Issue your first invoice
The same key issues documents that print like a good accountant's: start from a starter, preview, publish, issue.
-
GET /api/v1/report-starters— invoice, letter, business report, confirmation, survey summary. -
POST /api/v1/reportswith{ "starter": "invoice", "appearance": { "accent": "#0f4c5c" }, "sample": { "seller": … } }. -
POST /api/v1/reports/:id/preview— read the findings, look at the page images. -
POST /api/v1/reports/:id/publish, thenPOST /api/v1/reports/:id/documentswith{ "issue": true, "data": … }— you get the number, the PDF and a share link.
Every step as curl:
the invoice sequence. The definition and its blocks:
reports; what to choose:
report style. Over MCP:
forecraft_create_report,
forecraft_preview_report
(it returns the pages as images),
forecraft_issue_document.
Rules of the road
- Errors are
application/problem+json(RFC 9457):type,title,status,detailanderrors[]. Each error has a JSONpointer; a rejected submission also names thefieldand theruleit broke. - Rate limit: 240 requests a minute per key, announced in
RateLimit-*headers. A 429 carriesRetry-After. - Drafts and versions: edits change the draft; publish snapshots it. The public URL serves the latest published version.
- Check your work: preview returns
audit.passedand the findings. Publish what passes.