●─●─●AI ContextGraph::ai
← All guides
Setup

Setting up your MCP

The MCP server lets an AI agent work with your shared diagrams directly in a conversation — list them, read them, and make validated edits that sync back into the tool. Here is the one-time setup, using Claude as the example.

1

Generate an API token

Open your AccountPersonal API tokensGenerate token. Copy it now — it is shown only once. The token carries your account access, so treat it like a password.
2

Add the server to Claude Code

Run this once, pasting your token in place of ctxg_YOUR_TOKEN:
claude mcp add --transport http --scope user contextgraph \
  https://ctxgraphai.com/mcp \
  --header "Authorization: Bearer ctxg_YOUR_TOKEN"
3

Verify the connection

In Claude Code, run /mcp — you should see contextgraph listed as connected.
4

Other clients (Claude Desktop, Cursor)

Add this to the client's MCP config, replacing the token:
{
  "mcpServers": {
    "contextgraph": {
      "type": "http",
      "url": "https://ctxgraphai.com/mcp",
      "headers": { "Authorization": "Bearer ctxg_YOUR_TOKEN" }
    }
  }
}
5

Share a diagram so the agent can see it

The agent only sees diagrams you have Shared (Export ▾ → ⇡ Share). A diagram stays private and invisible to MCP until you Share it.
Verify it works

With the MCP server connected

claude "List my ContextGraph diagrams"
Get started free↓ DownloadsMore guides