See it as a diagram
Everything below, as a diagram you can edit. Describe yours and see it in seconds.
No account needed · Editable canvas, not a picture
The request shape, and the two headers that decide whether it works
Post JSON-RPC to https://datadef.io/mcp. Two headers matter beyond the credential. Content-Type must be application/json, and Accept must list both application/json and text/event-stream, because the streamable HTTP transport may answer either way and a client that accepts only one of them gets rejected before the tool runs.
Never use GET from a script. A GET without an event-stream Accept header is treated as a human or a crawler and returns an HTML page describing the server, which is useful in a browser and useless in a pipeline that expected JSON. Protocol traffic is POST.
There is no session to establish first. The server is stateless, so a single POST carries a complete call. Store the key as a repository or pipeline secret and pass it as a bearer header; keys are created and revoked on the MCP and integrations page, and a revoked key stops working immediately.
curl -sS --fail-with-body https://datadef.io/mcp \
-H "Authorization: Bearer $DATADEF_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "repo_status",
"arguments": { "project_id": "'"$DATADEF_PROJECT_ID"'" }
}
}'What actually belongs in a pipeline
Freshness reporting belongs there. repo_status returns the provider, the repository, the branch or tag tracked, the commit reflected, whether daily sync is on, and a plain-language freshness line. A job that reads it and fails or warns when the diagram lags the branch turns documentation staleness into something a pull request can see, which is the whole argument for docs checks in CI.
A refresh after a significant merge belongs there too, with a caveat. repo_refresh regenerates the diagram from the repository, which replaces manual canvas edits, so it is right for projects whose diagram is generated and wrong for ones a human has tuned. Refreshes share a bucket of ten per ten minutes per account, so a matrix job across many projects needs to pace itself.
Generation usually does not belong there. create_diagram spends a credit, takes up to a few minutes, and produces something a person should look at. A pipeline that regenerates a diagram on every push accumulates near-duplicates nobody opens. The exception is a one-off bootstrap job for a new repository.
Two things that make CI usage safe to leave running
Access is rechecked per request rather than trusted from issue time. A key minted while the plan was active stops authenticating once the plan lapses, without anyone revoking it, and the rejection carries a specific explanation rather than the generic challenge that would send an automated client into a pointless re-authorization loop.
Every call is attributed. The agent activity list in Datadef settings records one row per tool call: the credential label, the tool name, the status, the duration, and a short argument excerpt capped at 140 characters. Full prompts are never stored. Giving CI its own key with its own label makes pipeline traffic separable from human traffic at a glance.
The last thing worth saying is that most teams need less of this than they expect. Connected repositories on GitHub, GitLab or Azure DevOps already resync daily on the server side, regenerating both the diagram and its architecture document, and a commit that changes nothing structural does not redraw anything: the sync hashes the parsed structure, the Terraform draw plan or the assembled corpus, and skips generation outright when that fingerprint matches the previous run. A job that fires repo_refresh after a docs-only merge therefore spends a slot from the ten-per-ten-minutes bucket to accomplish nothing. CI is for the gap between a merge and the next scheduled run, not for the schedule itself.
Health checks need no secret
FAQ
Can I call an MCP server from a CI pipeline with plain curl?
Which headers does the request need?
Why does a GET to the endpoint return HTML?
What happens to a CI key when the plan lapses?
Should CI regenerate the diagram on every push?
Can a monitoring job check the server without a credential?