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 整合