Repository avatar
Other Tools
v1.0.0
active

metaworkbench-mcp

io.github.007-cloud-star/metaworkbench-mcp

Sample size, forest & funnel plots, RoB 2, PRISMA 2020, GRADE tables — local meta-analysis tools.

Documentation

Meta Workbench — MCP server (+ MCP Apps UI)

DOI

The six Meta Workbench web tools (https://007-cloud-star.github.io/metaworkbench/) are also an MCP server, applying Claude MCP Apps: the forest_plot tool is bound to an MCP Apps UI resource that renders an interactive forest plot inside Claude; hosts without MCP Apps support get the identical plot as SVG text plus structured numbers, so nothing depends on the UI.

Install from npm: npx -y metaworkbench-mcp (see "Register the server" below).

mcp-name: io.github.007-cloud-star/metaworkbench-mcp

What was built

metaworkbench-mcp/
├── server.mjs            # MCP server (stdio) — official @modelcontextprotocol/sdk
├── lib/
│   ├── sampleSize.mjs    # ported from sample-size-calculator (verbatim cores)
│   ├── forest.mjs        # ported from forest-plot-generator (DL pooling + SVG)
│   ├── rob.mjs           # ported from rob-traffic-light-generator (RoB 2 + SVG)
│   ├── prisma.mjs        # ported from prisma-flow-diagram-generator (SVG)
│   ├── funnel.mjs        # funnel plot + Egger's / Begg's tests (SVG)
│   └── grade.mjs         # GRADE summary-of-findings table (HTML)
├── app/
│   └── forest-plot.html  # MCP Apps UI resource (ui://metaworkbench/forest-plot)
└── test/
    ├── selftest.mjs      # stdio end-to-end test (drives the real server)
    ├── py_check.py       # independent numpy/scipy reference computations
    └── validate_svg.py   # XML well-formedness check for the SVG outputs

Tools exposed:

ToolInputReturns
sample_sizedesign (means / proportions / noninferiority) + the usual α, power, ratio, attritionper-group n, total, attrition-adjusted recruitment target (text + structured)
forest_plotstudies [{name, effect, ciLower, ciUpper}], measure OR/RR/MD/SMD, modelfixed-effect + DerSimonian–Laird pooling, Q / I² / τ², forest-plot SVG; MCP Apps UI in supporting hosts
rob_traffic_lightstudies with 5 RoB 2 domain judgements (+ optional N, overall override), weighted flagrobvis-style traffic-light SVG + summary bar SVG; overall per the RoB 2 rule, 2+-domain "some concerns" flagged †
prisma_diagramidentification/screening counts (+ exclusion reasons)PRISMA 2020 flow diagram SVG; derived counts computed for you
funnel_plotstudies [{name, effect, ciLower, ciUpper}], measure OR/RR/MD/SMDfunnel-plot SVG + Egger's regression and Begg's rank tests for publication bias
grade_sof_tableoutcome rows (relative effect, baseline risk, participants, studies, certainty, downgrade reasons)GRADE summary-of-findings HTML table with absolute effects per 1,000 and certainty ratings

MCP Apps wiring (per the extension spec, io.modelcontextprotocol/ui):

  • the server declares the extension capability with MIME type text/html;profile=mcp-app;
  • forest_plot is registered with _meta.ui.resourceUri = "ui://metaworkbench/forest-plot" (the legacy _meta["ui/resourceUri"] key is populated too, by the ext-apps SDK);
  • the HTML is served via resources/read with a restrictive CSP (no external domains) and implements the app bridge: it sends ui/initialize, then renders each ui/notifications/tool-result's structuredContent with its own renderer. Open app/forest-plot.html?demo=1 in a browser to preview it with the web tool's demo dataset.

Register the server

Claude Desktop (macOS/Windows) — add to claude_desktop_config.json (Settings → Developer → Edit Config):

{
  "mcpServers": {
    "metaworkbench": {
      "command": "npx",
      "args": ["-y", "metaworkbench-mcp"]
    }
  }
}

Then restart Claude Desktop. (npx downloads the package and its dependencies — @modelcontextprotocol/sdk, @modelcontextprotocol/ext-apps, zod — on first run.)

Claude Code:

claude mcp add metaworkbench -- npx -y metaworkbench-mcp

claude.ai — custom connectors on claude.ai require a remote MCP server reachable over HTTPS; a local stdio server like this one cannot be pasted in directly. Use it through Claude Desktop (same account), or deploy this server behind an HTTPS/streamable-HTTP endpoint later if a web-side connector is wanted.

Test results

npm test ( = node test/selftest.mjs) drives the server over stdio — initialize, tools/list, tools/call for all six tools, resources/list + resources/read — and cross-checks the numbers against an independent numpy/scipy implementation (test/py_check.py); all SVG outputs are parsed as XML to confirm they are valid, well-formed SVG.

Result: 93/93 checks passed (2026-12-03). Highlights:

  • Sample size, textbook cases: means Δ=5, σ=10, 80% power → 63/group; proportions 20% vs 10% → 199/group (444 total after 10% attrition); non-inferiority binary case → 1706/group. All identical to scipy.
  • DL pooling, 4-study toy set: fixed OR 0.8153 [0.6736, 0.9868], random-effects OR 0.8118 [0.6409, 1.0283], Q = 4.446, I² = 32.5%, τ² = 0.01889 — every value matches the scipy implementation to ≤1e-9 relative error (Q p-value to 1e-6). The web tool's 6-study demo dataset also matches (DL OR 0.8020, I² = 46.2%).
  • RoB 2 rules verified: any High → overall High; two "some concerns" → Some + † flag; override honoured; weighted summary engages when N is supplied.
  • PRISMA derived counts verified: 1500 identified → 1175 screened → 125 sought → 110 assessed.
  • MCP Apps: initialize shows the server declaring the UI extension; forest_plot's _meta carries the resource URI; resources/read returns the app HTML with the correct MIME type.
  • Funnel plot: Egger's / Begg's tests match the scipy reference on symmetric and asymmetric datasets (asymmetric set: Egger intercept 1.581, p ≈ 1.6e-8).
  • GRADE SoF: absolute effects per 1,000 cross-checked against an independent Python implementation of the GRADE Handbook formulas to 1e-9 (RR, OR and HR rows), all four certainty levels rendered with ⊕ symbols and lettered downgrade footnotes.
NPM
metaworkbench-mcp
Install Command
npm install metaworkbench-mcp
Runtime: npx