MCP Client Guide

Claude Code MCP server for diagrams: the command, the scope, the 36 tools

By the engineer who builds Datadef, from client work on data platforms · Reviewed August 21, 2026

Claude Code can already read your repository. Connecting Datadef over MCP gives it somewhere to put the answer: a real canvas in your workspace, not a Mermaid block in the transcript. The registration is one command, the interesting decision is which scope you register it in, and the difference between a personal setup and a team one is a single flag.

7 min readFor Claude Code users who want the diagram tools available in every session and shared with the repo

See it as a diagram

Everything below, as a diagram you can edit. Describe yours and see it in seconds.

165/20003 credits left
Try:

No account needed · Editable canvas, not a picture

The command, and the flag that decides everything

Create an API key on the MCP and integrations page in Datadef settings. The key is displayed once at creation and cannot be read back later, only revoked and replaced. Then register the server from your terminal and restart Claude Code.

The transport flag is mandatory. Without it, claude mcp add treats the URL as a stdio command and tries to execute it as a binary. Nothing fails loudly; the server simply never appears, which is why most reports of a broken MCP server are a missing flag.

Datadef is a remote Streamable HTTP server, so Claude Code talks to it directly over HTTP and no local bridge process is involved. Inside a session, /mcp lists the connected servers and their tool counts; a healthy Datadef entry reports 36 tools.

claude mcp add --transport http datadef https://datadef.io/mcp \
  --header "Authorization: Bearer dd_live_YOUR_KEY"

# then restart Claude Code and, inside a session:
/mcp

Register it once for the whole repository

The default registration is local: this project, your machine, invisible to anyone else. Adding --scope user makes the server available in every project you open. Adding --scope project writes a .mcp.json at the repository root, which you commit, and every teammate who pulls the repo is offered the same server.

Do not commit the key itself. Claude Code expands environment variables inside .mcp.json, including in the headers field, so the committed file can reference a variable each person sets in their own shell. That is not only hygiene: a Datadef key is tied to one account, and every diagram a tool call creates lands in that account, so a shared key would pile the whole team's diagrams into one person's workspace.

Datadef records who did what per credential. The agent activity list in settings shows one row per tool call with the credential label, the tool name, the status, and the duration, so a team registration stays auditable without anyone reading prompts. Argument excerpts are capped at 140 characters and full prompts are never stored.

// .mcp.json at the repository root, safe to commit
{
  "mcpServers": {
    "datadef": {
      "type": "http",
      "url": "https://datadef.io/mcp",
      "headers": { "Authorization": "Bearer ${DATADEF_API_KEY}" }
    }
  }
}

What the session can do once it is connected

Nine tools work on whole diagrams: create_diagram generates one from a description, create_blank_diagram opens an empty canvas for the agent to build itself, list_diagrams and get_diagram read the workspace, edit_diagram applies a plain-language change, export_diagram renders PNG or JPEG, repo_status and repo_refresh drive repository sync, and get_design_guide returns the design standard.

Twenty-seven canvas tools carry the prefix canvas_ and do the fine work: adding and updating nodes, connecting and relabelling edges, grouping into zones, setting table columns, drawing column-level lineage, aligning and laying out, and validating the result. canvas_validate_canvas and canvas_measure_canvas matter more than they sound, because size and overlap are exactly what a text-only model cannot judge about its own output.

Timing is worth knowing before you script anything around it. create_diagram waits about 35 seconds and returns a finished diagram when generation lands inside that window. When it does not, you get a diagram_id straight away and the agent is told to call get_diagram after roughly 60 seconds, polling every 30. A tool call can run for up to five minutes in total.

One rule saves the same explanation every session

A line in CLAUDE.md naming the project id that holds the architecture diagram, and saying that structural changes go through edit_diagram rather than a fresh generation, is the cheapest way to make the loop repeatable. See agent workflows for architecture docs.

When the tools are missing, check the server before the config

The handshake and the listings on the Datadef endpoint are anonymous. initialize, ping, tools/list, prompts/list and resources/list answer with no credentials at all; only tools/call requires authentication. That gives you a one-line test that separates a server problem from a client problem, runnable before a key exists.

If the listing comes back and the session still shows nothing, the cause is local: the transport flag, a client that was not restarted, or a scope that put the entry somewhere this project does not read. If tool calls fail while listings work, the credential is the suspect. A rejected key that is genuinely valid but attached to a lapsed plan gets a specific answer rather than the generic challenge, so the client says the subscription ended instead of sending you round a re-authorization loop that could never work.

curl -s https://datadef.io/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

FAQ

What command adds the Datadef MCP server to Claude Code?

claude mcp add --transport http datadef https://datadef.io/mcp --header "Authorization: Bearer YOUR_KEY", then restart Claude Code. The --transport http part is required; without it the CLI treats the URL as a local command and the server never registers. Create the key first on the MCP and integrations page in Datadef settings: it is displayed once at creation and can afterwards only be revoked and replaced, never read back.

How do I share the server with my team instead of just my machine?

Register it with --scope project, which writes a .mcp.json at the repository root that you commit. Teammates who pull the repo are offered the same server. Reference the key through an environment variable in the headers field rather than inlining it, because Claude Code expands environment variables in that file and a Datadef key belongs to one account.

How many tools does the server expose to a Claude Code session?

36. Nine operate on whole diagrams, including create_diagram, edit_diagram, export_diagram, repo_status and repo_refresh, and 27 are canvas tools prefixed canvas_ for nodes, edges, zones, columns, lineage, layout and validation. Running /mcp inside a session shows the count for each connected server.

Can I check the server is up without creating an API key first?

Yes. The protocol handshake and the listings are anonymous on this endpoint, so a plain POST asking for tools/list returns the full tool surface with no credentials. Only tools/call requires a key, which makes the listing a clean way to tell a server problem from a client configuration problem.

Does Claude Code send my source code to the diagram server?

No. The agent reads the repository locally and sends only the structure it decided to draw: node labels, zone names, edges, and column names when lineage is requested. No tool in the server accepts source files. For a diagram built from code without an agent in the middle, connect the repository to Datadef directly, which reads it read-only from GitHub, GitLab or Azure DevOps.