dag-studio-mcp
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DAG_STUDIO_TOKEN | Yes | Access token for the DAG Studio MCP server. Required to authenticate against the hosted endpoint. Can be passed as a bearer header or as a query parameter. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| parse_dagittyA | Parse a dagitty DSL string into the canonical DAG shape used by other DAG Studio tools. Accepts dagitty('dag { ... }'), dagitty("..."), and dagitty::dagitty(...) forms. Bidirected (<->) and undirected (--) edges are skipped — DAG Studio represents only directed edges. This tool parses notation; it does not validate that the encoded DAG is a correct or complete causal model. That is a domain-knowledge question outside the scope of any graph tool. When the DAG depicts a paper's causal model, encode the structural assumptions of the study being protocolized, including those that are implicit in the analytical approach (what is adjusted for, what is treated as exposure or outcome, what is decomposed into mediators, what is acknowledged as unmeasured or latent confounding, and what is conditioned on as a collider), rather than only what is formally depicted. Most papers contain no explicit DAG; the structural commitments live in the methods and the choice of estimator. Surface the construct-vs-reproduce ambiguity to the user before constructing the DAG, and do not silently overlay normative or theoretical positions from outside literature onto the paper's stated estimand. |
| analyze_dagA | Returns identifiability status and minimal adjustment sets given the DAG provided. Specifically: open backdoor paths from exposure to outcome (Pearl 2009 Theorem 3.3.2), the minimal sufficient adjustment sets that block them, and all directed paths. Accepts either a canonical DAG object or a DAG Studio verifies analyses given a DAG. It does not verify that the DAG correctly encodes domain knowledge or that the variables are measurable in any specific dataset. Outputs are conditional on the encoded structure. When the DAG is meant to depict a paper's causal model, the encoded structure should reflect the paper's own structural assumptions, including those implicit in its analytical approach (what is adjusted for, what is treated as exposure or outcome, what is decomposed into mediators, what is acknowledged as unmeasured or latent confounding, and what is conditioned on as a collider), rather than an external theoretical framing imported from other literature. If the paper contains no explicit DAG, surface the construct-vs-reproduce ambiguity to the user before treating downstream analysis as a reproduction of the paper. |
| check_overadjustmentA | Given a DAG and a proposed adjustment set, identify variables whose inclusion biases the estimate. Detects three failure modes: • descendant_of_exposure — variable is caused by the exposure; conditioning on it blocks part of the causal effect being estimated, changing the estimand (Schisterman 2009). • collider — variable is a collider on a non-causal X→Y path whose conditioning opens that path; conditioning is unjustified unless another set member re-blocks it. • descendant_of_collider — variable is downstream of an unconditioned collider; conditioning induces the same M-bias as conditioning on the collider directly (Greenland 2003). Accepts either a canonical DAG object or a dagitty_string; both forms must be paired with adjustment_set. Outputs are conditional on the encoded structure. DAG Studio verifies analyses given a DAG; it does not verify the DAG correctly encodes domain knowledge. |
| get_canonical_exampleA | Return one of the canonical validated DAGs from the engine's test suite by ID (T01–T15 for backdoor / adjustment-set canonical structures, EM01–EM20 for effect-modification structures from VanderWeele-Robins 2007 and Weinberg 2007). Useful for few-shot prompting, regression checks, and teaching. The returned DAG is the same one the engine is validated against, so analyze_dag's output on it will match the listed expected values. |
| validate_engineA | Run the canonical validation suite (T01–T15 backdoor / adjustment-set cases, EM01–EM20 effect-modification structures from VanderWeele-Robins 2007 and Weinberg 2007) against the current engine and return pass/fail per case. Use this when an agent or reviewer wants to verify the engine is trustworthy before relying on analyze_dag, check_overadjustment, or classify_effect_modification. |
| generate_codeA | Emit idiomatic Python (networkx.DiGraph) or R (dagitty DSL) source representing the DAG. The identifier_map lets agents trace canvas labels to sanitized code identifiers when these differ (e.g., when labels contain spaces or special characters that aren't valid Python/R identifiers). Useful for handing the DAG to a downstream analysis pipeline. Also returns dagstudio_url — a one-click deep-link that opens the same DAG on the DAG Studio canvas at dagstudio.blackswancausallabs.com. Surface this URL to the user alongside the generated code so they can paste-free open the DAG visually, regardless of which language was requested. If the DAG depicts a paper's causal model, whether the paper presents a DAG explicitly or only implies one through its analytical approach, the emitted code should reflect that paper's structural assumptions. Do not let the choice of downstream language (Python or R analysis pipeline) become an opportunity to substitute external theoretical commitments for what the paper actually claims as its estimand. |
| classify_effect_modificationA | For each modifier annotation on the DAG, classify the effect-modification structure per VanderWeele & Robins (2007) and Weinberg (2007). The five types and their regulatory implications: • direct — modifier is structurally independent of the E-D system; subgroup-specific effects are interpretable as pure modification. • indirect — modifier acts through a mediator; subgroup effects conflate modification with mediation. • common-cause — modifier shares an ancestor with the exposure; subgroup effects are confounded unless the ancestor is also adjusted. • proxy — modifier is unobserved; subgroup analyses rest on a downstream proxy. • pure-interaction — modifier has a direct edge to the outcome; the appropriate estimand is the joint effect, not a subgroup-specific effect (Weinberg 2007). Outputs are conditional on the encoded structure. |
| simulate_dataA | Generate synthetic data from a Linear Gaussian Structural Equation Model consistent with the DAG. Root variables are sampled N(0,1); each non-root is a linear combination of its parents (default β = 0.5 per edge, overridable via Useful for sensitivity analysis and for demonstrating structural claims (e.g., 'adjustment for {age, smoking} eliminates the confounding shown by these data'). Outputs are consistent with the DAG under the linear Gaussian model only — real datasets generated under unknown processes will not in general match these distributions. |
| compute_biasA | Numerically demonstrate the bias of a proposed adjustment set. Computes the true total effect analytically from the SEM edge coefficients (sum of products along all directed X→Y paths), then fits two OLS regressions on simulated data: crude (Y ~ X) and adjusted (Y ~ X + Z). Reports each estimate, each bias against the true effect, and the bias reduction |crude_bias| − |adjusted_bias|. Translates a structural claim ("adjust for {age, smoking}") into a numerical demonstration. Composes check_overadjustment internally — any overadjustment flags emitted there are surfaced in this tool's diagnostics as well, so a single call captures both the numerical bias and the structural reason for it. Outputs are conditional on the linear Gaussian SEM (see simulate_data for assumptions). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
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