# DAG Studio MCP

An MCP server for causal DAG analysis: it finds backdoor paths, adjustment sets, and simulated bias when you need to test an identification strategy.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: Black-Swan-Causal-Labs
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Black-Swan-Causal-Labs/dagstudio-mcp
- Updated: 2026-09-28
- HTML: https://affpapa.org/en/nevibecode/mcp/dag-studio-mcp

## What it 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.

## Requirements
- Remote server: `https://dagstudio-mcp.blackswancausallabs.com/mcp`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http dag-studio-mcp https://dagstudio-mcp.blackswancausallabs.com/mcp
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add dag-studio-mcp --url https://dagstudio-mcp.blackswancausallabs.com/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "dag-studio-mcp": {
            "url": "https://dagstudio-mcp.blackswancausallabs.com/mcp"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "dag-studio-mcp": {
            "type": "http",
            "url": "https://dagstudio-mcp.blackswancausallabs.com/mcp"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http dag-studio-mcp https://dagstudio-mcp.blackswancausallabs.com/mcp
```

## When to use it
- 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
- Use `analyze_dag` to inspect this causal graph and find its backdoor paths.
- Parse this dagitty definition with `parse_dagitty`, then create Python analysis code with `generate_code`.
- Simulate data from these structural coefficients and measure the adjustment bias with `simulate_data` and `compute_bias`.

## Similar
- [Zotero MCP](https://affpapa.org/en/nevibecode/mcp/zotero-mcp.md) — MCP server · ★ 5585
- [arxiv-mcp-server](https://affpapa.org/en/nevibecode/mcp/arxiv-mcp-server.md) — MCP server · ★ 3235
- [PaperBanana](https://affpapa.org/en/nevibecode/mcp/paperbanana.md) — MCP server · ★ 2418
- [MATLAB MCP Server](https://affpapa.org/en/nevibecode/mcp/matlab-mcp-server.md) — MCP server · ★ 1723
- [Hex Research](https://affpapa.org/en/nevibecode/mcp/hex-research.md) — MCP server · ★ 584
- [DocsAgent — Zotero, Obsidian & Apple Notes MCP Server](https://affpapa.org/en/nevibecode/mcp/docsagent-zotero-obsidian-apple-notes-mcp-server.md) — MCP server · ★ 578

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
