Use Ghost Bakery from an AI assistant (MCP)
The Ghost Bakery MCP server lets an AI assistant do the whole job from a sentence such as "generate 500 Brazilian customers with a valid CPF as CSV": it looks up the field types, writes a recipe, checks it, shows you sample records, and only then generates, telling you the cost first.
It is a small program that runs on your machine and talks to the Ghost Bakery API with an API key you create. It has no access of its own: everything it can do is what the key allows, and the key's credit limit is a hard cap on what an assistant can spend.
1. Create a key for the assistant
In your account, open API keys and choose the AI agent (MCP) starting point. It selects the scopes an assistant needs, a short validity and a small credit limit. Review them, confirm with your password, and copy the key: it is shown once.
| Scope | What the assistant can do with it |
|---|---|
generate |
Check and preview recipes for free, and start generation jobs (spends credits). |
jobs:read |
Follow a job and get its download link. |
catalog:read |
Download reference datasets such as countries and given names (spends credits). |
recipes:read |
List and read your saved recipes. |
recipes:write |
Save and delete recipes. Not in the starting point: add it only if you want the assistant to keep recipes for you. |
Use a key just for this. When you no longer want it, revoke it in the same page and it stops working at once.
2. Install the server
Download ghostbakery-mcp for your system from the latest release (Linux and macOS on x86-64 and ARM64, Windows on x86-64). Check it against SHA256SUMS from the same release, rename it to ghostbakery-mcp (ghostbakery-mcp.exe on Windows), make it executable and put it on your PATH. It is a single static program with no dependencies.
sha256sum --check --ignore-missing SHA256SUMSThe server reads two environment variables:
| Variable | Meaning |
|---|---|
GHOSTBAKERY_API_KEY |
The key from step 1. Required. |
GHOSTBAKERY_API_URL |
The API address. Optional; defaults to https://api.ghostbakery.com. |
3. Add it to your assistant
Claude Code:
claude mcp add ghostbakery --env GHOSTBAKERY_API_KEY=grd_your_key -- ghostbakery-mcpClaude Desktop, Cursor and other clients take a JSON entry in their MCP settings:
{
"mcpServers": {
"ghostbakery": {
"command": "ghostbakery-mcp",
"env": { "GHOSTBAKERY_API_KEY": "grd_your_key" }
}
}
}Restart the assistant and ask it what Ghost Bakery tools it has.
What the assistant can do
| Tool | Does | Costs |
|---|---|---|
ghostbakery_get_reference |
Looks up field types, parameters, formats and limits. | Free |
ghostbakery_validate_recipe |
Checks a recipe and names the exact setting that is wrong. | Free |
ghostbakery_preview_recipe |
Shows 1 to 5 sample records. | Free |
ghostbakery_estimate_cost |
Prices a recipe. | Free |
ghostbakery_generate |
Runs the recipe as a job. | Credits |
ghostbakery_get_job |
Reports a job and, when done, the download link. | Free |
ghostbakery_list_catalog |
Lists the reference datasets you can download. | Free |
ghostbakery_export_catalog |
Downloads up to 1000 rows of a reference dataset. | 1 credit per row |
ghostbakery_list_recipes, ghostbakery_get_recipe |
Read your saved recipes. | Free |
ghostbakery_save_recipe, ghostbakery_delete_recipe |
Keep or remove a saved recipe. Deleting is permanent. | Free |
Working examples are also offered to the assistant as resources, so it can start from a recipe that is known to work.
How your credits are protected
- A ceiling on every purchase.
ghostbakery_generateandghostbakery_export_catalogrequire amax_cost. The server prices the request first and sends nothing if it costs more, so nothing is charged. - Nothing is charged twice. Each call carries an idempotency key made from the request, so an assistant that repeats a call, or a network retry, gets the first result back instead of paying again. To run the same recipe again on purpose, the assistant passes a new
request_id. - The key is the real limit. The credit limit and expiry you set on the key are enforced by the API, whatever the assistant does. A short validity and a small limit are a sensible default.
- Generated data is data. Samples and downloaded rows come back as structured data for the assistant to show you, not as instructions.
- The result never enters the conversation. A finished job gives a download link for you to open, not the file.
Troubleshooting
| You see | Cause and fix |
|---|---|
GHOSTBAKERY_API_KEY is not set |
The client did not pass the key. Check the env entry of the server in its settings. |
401 |
The key is wrong, revoked or expired. Create a new one. |
403 and a scope name |
The key lacks that scope. Create a key that has it. |
402 |
Not enough credits, or the key's credit limit is used up. Add credits, or create a key with a higher limit. |
429 |
The key made too many requests. Wait a few seconds; the message says so. |
The same operations are available directly over HTTP; see the API reference.