
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)
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:
| Tool | Input | Returns |
|---|---|---|
sample_size | design (means / proportions / noninferiority) + the usual α, power, ratio, attrition | per-group n, total, attrition-adjusted recruitment target (text + structured) |
forest_plot | studies [{name, effect, ciLower, ciUpper}], measure OR/RR/MD/SMD, model | fixed-effect + DerSimonian–Laird pooling, Q / I² / τ², forest-plot SVG; MCP Apps UI in supporting hosts |
rob_traffic_light | studies with 5 RoB 2 domain judgements (+ optional N, overall override), weighted flag | robvis-style traffic-light SVG + summary bar SVG; overall per the RoB 2 rule, 2+-domain "some concerns" flagged † |
prisma_diagram | identification/screening counts (+ exclusion reasons) | PRISMA 2020 flow diagram SVG; derived counts computed for you |
funnel_plot | studies [{name, effect, ciLower, ciUpper}], measure OR/RR/MD/SMD | funnel-plot SVG + Egger's regression and Begg's rank tests for publication bias |
grade_sof_table | outcome 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_plotis 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/readwith a restrictive CSP (no external domains) and implements the app bridge: it sendsui/initialize, then renders eachui/notifications/tool-result'sstructuredContentwith its own renderer. Openapp/forest-plot.html?demo=1in 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:
initializeshows the server declaring the UI extension;forest_plot's_metacarries the resource URI;resources/readreturns 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.
metaworkbench-mcpnpm install metaworkbench-mcp