
DAG Studio MCP
com.blackswancausallabsPublished by blackswancausallabs.comOfficial publisherv0.1.0Updated Oct 25, 2026
Causal DAG analysis: backdoor paths, adjustment sets, bias simulation. Validated against dagitty.
Overview
Remote MCP server for causal DAG analysis: build and validate directed acyclic graphs, find adjustment sets, and simulate bias.
- What you can do
- Analyze DAGs for backdoor paths, minimal sufficient adjustment sets and identifiability, and check for overadjustment on mediators, colliders and descendants of exposure. Parse dagitty DSL (raw or R-wrapped) into a structured DAG model. Generate R or Python analysis code for a DAG along with a DAG Studio link. Simulate data under specified structural coefficients and compute empirical bias of an adjustment strategy. Classify effect-modification structure and fetch canonical teaching DAGs. Run the canonical validation suite and report the engine version.
- When to use it
- Useful for epidemiology, causal-inference and real-world-evidence work where an assistant must reason about confounding, choose adjustment sets, or sanity-check a DAG before analysis. Also suited to teaching confounding, M-bias and frontdoor examples.
- Requirements
- A remote Streamable HTTP endpoint; no local install. A trial bearer token is required, sent in the Authorization header or appended as a token query parameter; request one by email from the provider. Network access to the hosted endpoint.
Installation
In SourceWeft
- Open DAG Studio MCP in the dashboard and add it to a workspace.
- Connect Authorization token credentials. They are stored privately and never shown on public pages.
- Enable the server for the chats that should use its tools.
Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.
Use with an agent
Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.
Read https://sourceweft.com/mcp/com.blackswancausallabs%2Fdagstudio-mcp/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.Other MCP clients
Add this to your client's mcpServers config.
{
"mcpServers": {
"dag-studio": {
"type": "http",
"url": "https://dagstudio-mcp.blackswancausallabs.com/mcp",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}README
dag-studio-mcp
Model Context Protocol (MCP) server for the DAG Studio causal-inference engine. It lets AI agents construct, analyze, and validate causal directed acyclic graphs (DAGs) using the same engine that powers the DAG Studio canvas.
Built and maintained by Black Swan Causal Labs. Listed in the RWE MCP Registry.
Tools
Every analytical response carries an engine_version stamp, a concordance attestation, a diagnostics block with severity-coded flags, and citations to the underlying methods literature.
Validation
The engine is validated four ways for coherence: against Pearl (2009) theory, against the reference implementation dagitty (Textor et al. 2016), against DAG Studio's own analytical results, and empirically via compute_bias on simulated data.
- 35 canonical cases: T01 to T15 (structural identification) and EM01 to EM20 (effect modification), runnable live via
validate_engine. - A release-gate concordance check runs the engine head-to-head against dagitty (vendored at upstream commit
7a65777) and stamps the attestation surfaced in tool responses. - 93 unit and integration tests across the engine bindings, the tool layer, and the auth gate.
Hosted endpoint
The server runs as a Cloudflare Worker (Streamable HTTP):
Access is token-gated during the trial period. Request a token at [email protected]. Tokens are accepted either as a bearer header or as a ?token= query parameter (the query form exists for clients whose connector UI cannot set custom headers, such as the Claude.ai web connector).
Claude Code:
Claude.ai web: add a custom connector pointed at https://dagstudio-mcp.blackswancausallabs.com/mcp?token=<your token>.
Repository layout
dag-engine.js/dag-engine.d.ts: the analytical engine, a pure ESM module with no runtime dependenciessrc/tools/: one file per tool, each exporting{ InputSchema, OutputSchema, descriptor, handler }src/worker/: Cloudflare Worker transport and the token gate (auth.ts)src/index.ts: stdio entry point for local useci/: release-gate concordance harness against vendored dagittytests/: unit and integration tests (npm test)MCP_REQUIREMENTS.md: the v1 specificationFDA_GUIDANCE_ALIGNMENT.md: mapping of DAG Studio capabilities onto FDA draft RWE guidance protocol elements
The engine is developed alongside the DAG Studio canvas app and the vendored copy here is synced at release time. This repository is self-contained: clone it, npm install, and everything builds and tests without further setup.
Development
For interactive inspection: npx @modelcontextprotocol/inspector.
Protocol status
Built on @modelcontextprotocol/sdk (TypeScript). Current against the finalized MCP specification revision 2025-11-25. Migration to the 2026-07-28 revision is planned once stable SDK support ships.
License
Apache License 2.0 (see LICENSE).
Exception: ci/dagitty-src/ contains the dagitty reference engine (GPL-2.0, Textor et al.), vendored at upstream commit 7a65777 solely as a release-time CI fixture for the concordance check. It retains its own license, is excluded from the published npm package, and is not part of the deployed worker bundle.
Source: README.md at commit 97f3693
Tools
0Version history
1- v0.1.0LatestSep 16, 2026
Score
85% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 daysRequired25 pts
- Auth declaredRequired10 pts
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Other Blackswancausallabs integrations

NHANES (design-correct survey analysis)
com.blackswancausallabs
A local MCP server that lets an assistant run design-correct NHANES survey analyses, with proper weights, pooled cycles, confidence intervals and NCHS flags.

DAG Studio WebMCP
Published by GitHub account Black-Swan-Causal-Labs
Reads and edits a live DAG Studio causal graph canvas through structured tools, with analysis, code generation and simulation.

TARGET Checklist MCP
com.blackswancausallabs
Scores how completely a target trial emulation manuscript reports the 21 TARGET guideline items, producing an item-by-item, evidence-linked checklist.

ROBINS-I V2 MCP
com.blackswancausallabs
A local MCP server that runs a deterministic ROBINS-I V2 risk-of-bias assessment for one result of a non-randomized follow-up or cohort study.

openFDA Regulatory Metadata
com.blackswancausallabs
A local MCP server that resolves FDA application numbers and product names to regulatory metadata for drugs, biologics and medical devices via the openFDA API.