dag-studio-mcp
OfficialClick on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dag-studio-mcpSimulate data from a DAG where X causes M and M causes Y."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Tool | What it does |
| Backdoor paths, minimal sufficient adjustment sets, identifiability |
| Parse dagitty DSL (raw or R-wrapped) into the structured DAG model |
| R / Python analysis code for a DAG, plus a one-click DAG Studio URL |
| Detect adjustment for mediators, colliders, and descendants of exposure |
| Simulate data from a DAG under user-specified structural coefficients |
| Empirical bias of an adjustment strategy against the simulated truth |
| Classify effect-modifier structure (direct, indirect, proxy, common-cause, pure interaction) |
| Canonical teaching DAGs (confounding, M-bias, frontdoor, and others) |
| Run the full canonical validation suite and report engine version |
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.
Related MCP server: Dealership AI MCP Server
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):
https://dagstudio-mcp.blackswancausallabs.com/mcpAccess is token-gated during the trial period. Request a token at jdiazdecaro@blackswancausallabs.com. 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 mcp add --transport http dag-studio \
https://dagstudio-mcp.blackswancausallabs.com/mcp \
--header "Authorization: Bearer <your token>"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
npm install
npm test # full suite
npm run dev # stdio server via tsx
npm run worker:typecheck # worker bundle typecheck
npm run worker:deploy # deploy (stamps engine_version from git HEAD first)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.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceA server providing rigorous causal inference tools through the Model Context Protocol (MCP), offering 42 specialized causal analysis tools that cover modeling, effect estimation, attribution, root cause analysis, counterfactuals, and sensitivity analysis.Last updated4MIT
- Flicense-qualityDmaintenanceMCP server that enables AI agents to instantly understand, generate pattern-aware code, search across repos, and validate changes in the Dealership AI codebase.Last updated
- AlicenseAqualityAmaintenanceAn MCP server that gives AI agents full visibility and control over your Dagster instance, enabling autonomous monitoring, diagnosis, and remediation of data pipelines.Last updated1710MIT
- Alicense-qualityAmaintenanceMCP server that enables AI agents to run a deterministic orchestration loop with decomposition, subagent execution, and review feedback across multiple LLM backends.Last updated52MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Black-Swan-Causal-Labs/dagstudio-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server