metaworkbench-mcp
# Meta Workbench — MCP server (+ MCP Apps UI)
The four 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)
├── 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 |
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):
```json
{
"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**:
```bash
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 four tools, resources/list +
resources/read — and cross-checks the numbers against an independent
numpy/scipy implementation (`test/py_check.py`); all five SVG outputs are
parsed as XML to confirm they are valid, well-formed SVG.
**Result: 38/38 checks passed** (2026-11-11). 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.
TDQS
Scored across 4 tools
Each tool maps to a distinct stage of the systematic-review workflow: sample-size planning, effect-size pooling/forest plotting, risk-of-bias visualization, and PRISMA flow diagramming. There is no resource or action overlap, and the names alone tell an agent which one to pick.
All four tools use consistent snake_case noun-phrase naming (sample_size, forest_plot, rob_traffic_light, prisma_diagram). No mixing of verb styles or casing conventions occurs.
Four tools is a tight, well-scoped surface where every tool covers a clearly separate deliverable of a meta-analysis workbench. Nothing feels padded or redundant.
The core arc (plan sample size, appraise bias, synthesize with a forest plot, report flow) is covered, but common meta-analysis operations such as funnel plot/publication-bias tests, subgroup or sensitivity analysis, meta-regression, and a GRADE/summary-of-findings output are absent. Agents would have to fall back on other tools for these routine steps.