
DAG Studio WebMCP
io.github.Black-Swan-Causal-Labs由 GitHub 账号 Black-Swan-Causal-Labs 发布v1.0.0更新于 Oct 24, 2026
Read and edit a live DAG Studio canvas through its predefined WebMCP tools.
发布方自己的服务:DAG Studio MCP
概览
通过结构化工具读取并编辑 DAG Studio 中实时运行的因果图,并提供分析、代码生成与模拟功能。
- 可以做什么
- 读取实时因果图:节点、角色、位置、有向边、暴露与结局。
- 添加或删除节点与有向边,自环、重复边和成环边会被拒绝。
- 分析图结构:开放后门路径、最小充分调整集、可识别性与诊断,并校验给定的调整集。
- 为当前图生成 R/dagitty 或 Python/NetworkX 代码。
- 对实时图运行线性高斯 SEM 模拟,返回有界摘要、相关性、效应估计和少量数据预览。
- 适用场景
- 适合研究者正在 DAG Studio 中工作、希望助手读取或提议修改同一张因果图、检查调整集,或生成分析代码与模拟结果的场景,且所有改动都可见、可撤销。
- 运行要求
- 需要基于 streamable HTTP 的远程 MCP 桥接端点,以及放在 Authorization 请求头中的必需 bearer 令牌。令牌需在工作室中选择 Connect MCP 并启用连接后复制,两小时后过期,且页面需保持打开。原生 WebMCP 使用需支持 WebMCP 的浏览器。
安装
在 SourceWeft 中
- 打开 控制台中的 DAG Studio WebMCP,将其添加到工作区。
- 连接 Authorization token 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.Black-Swan-Causal-Labs%2Fdag-studio-webmcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。
{
"mcpServers": {
"dag-studio-webmcp": {
"type": "http",
"url": "https://dag-studio-webmcp-bridge.jdiazdecaro.workers.dev/mcp",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}README
DAG Studio WebMCP
A human–AI causal DAG workspace for the OpenAI 2026 WebMCP Challenge.
The AI proposes. The researcher decides. The engine verifies.
Live HTTPS sandbox · Original DAG Studio · Apache 2.0 License
The problem
Causal directed acyclic graphs encode scientific assumptions: which variables cause which, what is measured or latent, and which paths may bias an effect estimate. Those decisions require domain expertise and scientific accountability. A general-purpose agent can help a researcher inspect and edit a graph, but visual browser automation is slow, ambiguous, and disconnected from the application's causal semantics.
DAG Studio WebMCP turns the existing DAG Studio interface into a shared workspace. A researcher can edit the canvas directly while an agent reads and updates that exact same graph through structured browser-native tools. Every agent mutation is visible and undoable. The causal engine checks the implications of the graph; neither the engine nor the agent claims to determine scientific truth.
Why WebMCP matters
Without WebMCP, an agent must infer node identities, edge directions, and analysis controls from pixels and DOM structure. With WebMCP, DAG Studio explicitly exposes safe, purpose-built operations such as add_node, add_edge, and analyze_current_dag.
This enables a two-way collaboration that was difficult before:
- The agent can read the live graph without scraping the interface.
- The agent can propose a precise, attributed change.
- The researcher immediately sees, moves, edits, accepts, or undoes it.
- Human canvas edits are immediately visible to the agent.
- The existing causal engine verifies backdoor paths and adjustment implications.
- The agent can simulate reproducible data under competing DAG hypotheses and compare their structural and statistical implications.
Live demonstration
Open the sandbox in ChatGPT's WebMCP-capable browser or Chrome with chrome://flags/#enable-webmcp-testing enabled. The header displays WebMCP connected when tools are available.
Suggested prompt:
Read the current DAG. Propose Smoking Status as a possible confounder, add it with arrows to Treatment and Outcome, then analyze the graph. Treat the additions as assumptions for my review and do not make any other changes.
The graph updates in place. Move the new node manually, then ask the agent to read the graph again to demonstrate that both participants share the same state.
WebMCP tools
The integration prefers the current document.modelContext API and includes a temporary navigator.modelContext fallback for hosts implementing an earlier WebMCP draft.
Architecture
index.htmlcontains the existing React DAG Studio interface.webmcp-tools.jsdefines and registers the nine tools through dependency-injected access to the canvas's state refs, mutation wrappers, and existing simulation engine.dag-engine.jsanddag-engine.d.tsare the existing DAG Studio causal engine and type declarations. The Challenge work calls this engine; it does not rewrite its causal algorithms.- The graph, analysis, undo history, and WebMCP operations remain client-side.
- The static build is hosted over HTTPS on Cloudflare Pages.
Human control and safety
Causal structure is an assertion, not a fact discovered by software. Tool descriptions and responses therefore frame mutations as proposals for researcher review. Agent changes:
- appear on the same canvas used for human editing;
- receive a visible agent-change notification;
- enter the same undo history as human changes;
- reject graph cycles and invalid node references; and
- return an explicit caveat that results depend on the encoded assumptions.
Examples and the wider interface
The inherited DAG Studio interface includes canonical structures for confounding, mediation, collider bias, and M-bias, along with:
- drag-and-drop DAG editing and typed variables;
- exposure and outcome designation;
- highlighted causal and backdoor paths;
- minimal adjustment guidance and structural-role diagnostics;
- R and Python code generation and code-to-canvas workflows;
- client-side data simulation; and
- image, PDF, PowerPoint, and code export.
What existed before August 25, 2026
The pre-Challenge baseline is the public Black-Swan-Causal-Labs/dag-studio application at commit 31cc431612ba18a8bce1ab0841a88a0bb8b815f3, dated July 8, 2026. It already contained the visual DAG editor, causal inference engine, educational examples, analysis panels, code console, simulation, export, and responsive UI.
The original application did not expose WebMCP tools, attribute agent graph edits, or test human/agent access to one shared graph state.
Built specifically for the WebMCP Challenge
The following work was added during the Challenge submission period after August 25, 2026:
- nine WebMCP tools, including reproducible simulation of the live DAG;
- direct wiring from those tools to the canvas's existing shared state;
- WebMCP connection diagnostics and current/earlier API compatibility;
- visible, undoable agent-change attribution;
- automated tests for tool registration, agent mutations, human-to-agent state visibility, edge/node removal, cycle rejection, engine analysis, adjustment checks, code generation, simulation reproducibility, bounded results, and input validation;
- an isolated HTTPS sandbox that does not alter production DAG Studio; and
- Challenge-specific documentation and demo instructions.
Run locally
Open the printed Vite URL. To expose native WebMCP in Chrome, enable chrome://flags/#enable-webmcp-testing and relaunch Chrome.
Test and build
The test command runs both the original DAG engine parity suite and the WebMCP/shared-state suite. The production build is a static dist/ directory suitable for any HTTPS static host.
Scientific basis
The causal engine implements d-separation and adjustment logic based on Pearl (2009), Greenland, Pearl & Robins (1999), and Textor et al. (2016). Effect-modification classification follows VanderWeele & Robins (2007) and Weinberg (2007). See the in-app About and Education sections for details.
Author and license
John D. Diaz-Decaro, PhD, MS · Black Swan Causal Labs
Apache License 2.0 © 2026 John D. Diaz-Decaro, Black Swan Causal Labs, LLC. See LICENSE.
The reused dag-engine.js and dag-engine.d.ts files originate in DAG Studio
and are shared with dagstudio-mcp.
All three projects distribute the engine under Apache License 2.0; the WebMCP
Challenge work calls the engine without rewriting its causal algorithms.
Remote MCP clients
An optional remote MCP bridge connects other MCP clients to the same live browser canvas. Open the app, select Connect MCP, and enable a temporary connection. Native WebMCP continues to work without pairing. Registry metadata is in server.json.
来源:README.md,提交 ed7aa63
工具
0版本历史
1- v1.0.0最新Sep 16, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Blackswancausallabs 集成

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

NHANES (design-correct survey analysis)
com.blackswancausallabs
一个本地 MCP 服务器,让助手按调查设计正确分析 NHANES 数据,自动处理权重、合并周期、置信区间与 NCHS 可靠性标记。

TARGET Checklist MCP
com.blackswancausallabs
按 TARGET 指南的 21 个条目,评估目标试验模拟研究的报告完整程度,输出逐条、附证据的清单矩阵。

ROBINS-I V2 MCP
com.blackswancausallabs
一个本地 MCP 服务器,对非随机随访或队列研究的某一结果执行确定性的 ROBINS-I V2 偏倚风险评估。

openFDA Regulatory Metadata
com.blackswancausallabs
一个本地 MCP 服务器,通过 openFDA API 将 FDA 申请编号和产品名称解析为药品、生物制品和医疗器械的监管元数据。