
DAG Studio WebMCP
io.github.Black-Swan-Causal-LabsPublished by GitHub account Black-Swan-Causal-Labsv1.0.0Updated Oct 24, 2026
Read and edit a live DAG Studio canvas through its predefined WebMCP tools.
The publisher's own server: DAG Studio MCP
Overview
Reads and edits a live DAG Studio causal graph canvas through structured tools, with analysis, code generation and simulation.
- What you can do
- Read the live causal graph: nodes, roles, positions, directed edges, exposure and outcome.
- Add or remove nodes and directed edges, with cycles, self-loops and duplicates rejected.
- Analyze the graph: open backdoor paths, minimal sufficient adjustment sets, identifiability and diagnostics, and check a proposed adjustment set.
- Generate R/dagitty or Python/NetworkX code for the current graph.
- Run a linear Gaussian SEM simulation on the live graph and return bounded summaries, correlations, effect estimates and a short data preview.
- When to use it
- Useful when a researcher is working in DAG Studio and wants an assistant to inspect or propose changes to the same causal graph, check adjustment sets, or produce analysis code and simulation results, while keeping every change visible and undoable.
- Requirements
- A remote MCP bridge endpoint over streamable HTTP, plus a required bearer token sent in the Authorization header. The token is copied from the studio after selecting Connect MCP and enabling a connection, and expires in two hours; the studio page must stay open. Native WebMCP use needs a WebMCP-capable browser.
Installation
In SourceWeft
- Open DAG Studio WebMCP 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/io.github.Black-Swan-Causal-Labs%2Fdag-studio-webmcp/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-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.
Source: README.md at commit ed7aa63
Tools
0Version history
1- v1.0.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

DAG Studio MCP
com.blackswancausallabsOfficial publisher
Remote MCP server for causal DAG analysis: build and validate directed acyclic graphs, find adjustment sets, and simulate bias.

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.

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.