DAG Studio MCP

com.blackswancausallabs由 blackswancausallabs.com 发布官方发布者v0.1.0更新于 Oct 25, 2026

Causal DAG analysis: backdoor paths, adjustment sets, bias simulation. Validated against dagitty.

已验证Streamable HTTP可网页运行数据与分析AI 与机器学习

概览

AI 生成的概览

用于因果 DAG 分析的远程 MCP 服务器:构建并验证有向无环图、寻找调整集、模拟偏倚。

可以做什么
分析 DAG 的后门路径、最小充分调整集与可识别性,并检查对中介变量、对撞变量及暴露后代的过度调整。将 dagitty DSL(原始或 R 包装形式)解析为结构化 DAG 模型。为 DAG 生成 R 或 Python 分析代码及 DAG Studio 链接。按指定的结构系数模拟数据,并计算某种调整策略的经验偏倚。判定效应修饰结构,并获取经典教学 DAG。运行标准验证套件并报告引擎版本。
适用场景
适合流行病学、因果推断与真实世界证据工作,让助手在分析前梳理混杂、选择调整集或检查 DAG。也适合讲解混杂、M 偏倚和前门准则等教学示例。
运行要求
远程 Streamable HTTP 端点,无需本地安装。需要试用 bearer 令牌,通过 Authorization 请求头或 token 查询参数传递;需向提供方邮件申请。需要能访问该托管端点的网络。
安装前请注意
试用期内访问受令牌限制,令牌属于机密;使用查询参数形式会把令牌放进 URL,可能被记录或分享。服务器由第三方托管,DAG 结构与模拟输入会发送给该提供方。模拟与偏倚结果是基于模型的估计,并非真实经验数据。

安装

在 SourceWeft 中

  1. 打开 控制台中的 DAG Studio MCP,将其添加到工作区。
  2. 连接 Authorization token 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/com.blackswancausallabs%2Fdagstudio-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "dag-studio": {
      "type": "http",
      "url": "https://dagstudio-mcp.blackswancausallabs.com/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

dag-studio-mcp

[CI] [License: Apache 2.0]

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

ToolWhat it does
analyze_dagBackdoor paths, minimal sufficient adjustment sets, identifiability
parse_dagittyParse dagitty DSL (raw or R-wrapped) into the structured DAG model
generate_codeR / Python analysis code for a DAG, plus a one-click DAG Studio URL
check_overadjustmentDetect adjustment for mediators, colliders, and descendants of exposure
simulate_dataSimulate data from a DAG under user-specified structural coefficients
compute_biasEmpirical bias of an adjustment strategy against the simulated truth
classify_effect_modificationClassify effect-modifier structure (direct, indirect, proxy, common-cause, pure interaction)
get_canonical_exampleCanonical teaching DAGs (confounding, M-bias, frontdoor, and others)
validate_engineRun 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.

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/mcp

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:

sh
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 dependencies
  • src/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 use
  • ci/: release-gate concordance harness against vendored dagitty
  • tests/: unit and integration tests (npm test)
  • MCP_REQUIREMENTS.md: the v1 specification
  • FDA_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

sh
npm installnpm test                  # full suitenpm run dev               # stdio server via tsxnpm run worker:typecheck  # worker bundle typechecknpm 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.

来源:README.md,提交 97f3693

工具

0
该服务器需要 API 密钥等凭据,因此 SourceWeft 无法在没有凭据的情况下读取其工具,也未收录。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Blackswancausallabs 集成