DAG Studio MCP — Claude Code MCP server: what it does
An MCP server for causal DAG analysis: it finds backdoor paths, adjustment sets, and simulated bias when you need to test an identification strategy.
claude mcp add --transport http dag-studio-mcp https://dagstudio-mcp.blackswancausallabs.com/mcpWhat DAG Studio MCP does
DAG Studio MCP gives an AI agent access to a causal-analysis engine. Its tools parse dagitty syntax, inspect backdoor paths, find minimal sufficient adjustment sets, and flag adjustment for mediators, colliders, or exposure descendants. Other tools produce R or Python analysis code, simulate data from structural coefficients, and measure empirical bias against the simulated truth.
The server also provides canonical teaching DAGs, effect-modification classification, and a full engine validation run. Responses include an engine version, a concordance attestation, severity-coded diagnostics, and method references. Validation compares the engine with Pearl’s theory, dagitty, DAG Studio results, and simulated bias checks. The hosted endpoint runs as a Cloudflare Worker and is token-gated during the trial period, so requests need a token.
For local work, the repository uses npm install, npm test, and npm run dev; the server is built on the TypeScript MCP SDK. The remote endpoint can be added to Claude Code, Codex, Cursor, GitHub Copilot, or Gemini CLI. The project is licensed under Apache-2.0.
What it helps with
- trace backdoor paths in a causal DAG
- choose a minimal adjustment set
- flag mediator and collider overadjustment
- simulate data from structural coefficients
- measure bias from an adjustment strategy
Example prompts for the agent
- Use
analyze_dagto inspect this causal graph and find its backdoor paths. - Parse this dagitty definition with
parse_dagitty, then create Python analysis code withgenerate_code. - Simulate data from these structural coefficients and measure the adjustment bias with
simulate_dataandcompute_bias.
How to install DAG Studio MCP
Platform CLI: remote server
claude mcp add --transport http dag-studio-mcp https://dagstudio-mcp.blackswancausallabs.com/mcpPlatform CLI: remote server
codex mcp add dag-studio-mcp --url https://dagstudio-mcp.blackswancausallabs.com/mcpConfig file
{
"mcpServers": {
"dag-studio-mcp": {
"url": "https://dagstudio-mcp.blackswancausallabs.com/mcp"
}
}
}Config file
{
"servers": {
"dag-studio-mcp": {
"type": "http",
"url": "https://dagstudio-mcp.blackswancausallabs.com/mcp"
}
}
}Platform CLI: remote server
gemini mcp add -t http dag-studio-mcp https://dagstudio-mcp.blackswancausallabs.com/mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about DAG Studio MCP
How do I install DAG Studio MCP in Claude Code?
Run claude mcp add --transport http dag-studio-mcp https://dagstudio-mcp.blackswancausallabs.com/mcp. The hosted endpoint also requires a token.
What does DAG Studio MCP do?
It lets an agent construct and inspect causal DAGs, identify adjustment sets, check overadjustment, simulate data, and generate R or Python code. Its analysis responses include validation and diagnostic details.
Does the hosted server require a token?
Yes. Access is token-gated during the trial period. Clients can send the token as a bearer header or through the ?token= query parameter.