heor-agent-mcp 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -5
- package/dist/models/psa.d.ts.map +1 -1
- package/dist/models/psa.js +17 -14
- package/dist/models/psa.js.map +1 -1
- package/dist/providers/direct/niceTa.d.ts.map +1 -1
- package/dist/providers/direct/niceTa.js +1 -1
- package/dist/providers/direct/niceTa.js.map +1 -1
- package/dist/server.js +186 -59
- package/dist/server.js.map +1 -1
- package/dist/tools/costEffectivenessModel.js +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ Multi-state Markov model (default) or Partitioned Survival Analysis (oncology),
|
|
|
79
79
|
- **OWSA** — one-way sensitivity analysis with tornado summary
|
|
80
80
|
- **CEAC** — cost-effectiveness acceptability curve
|
|
81
81
|
- **EVPI** — expected value of perfect information
|
|
82
|
-
- **WTP assessment** — verdict against NHS (£
|
|
82
|
+
- **WTP assessment** — verdict against NHS (£25–35K/QALY, updated April 2026), US payer ($100–150K), societal thresholds
|
|
83
83
|
|
|
84
84
|
**Example call:**
|
|
85
85
|
```json
|
|
@@ -257,11 +257,57 @@ HEOR_API_KEY=...
|
|
|
257
257
|
|
|
258
258
|
---
|
|
259
259
|
|
|
260
|
+
## Web UI
|
|
261
|
+
|
|
262
|
+
A companion chat interface is available at:
|
|
263
|
+
|
|
264
|
+
**https://web-michael-ns-projects.vercel.app**
|
|
265
|
+
|
|
266
|
+
- Chat with Claude Opus 4.6 + all 7 HEOR tools
|
|
267
|
+
- **BYOK (Bring Your Own Key)** — paste your Anthropic API key in the settings; it stays in your browser's localStorage and is never stored on our servers
|
|
268
|
+
- Markdown rendering with styled tables, tool call cards with live progress timers
|
|
269
|
+
- Example prompts for common HEOR workflows
|
|
270
|
+
|
|
271
|
+
The web UI calls the hosted MCP server on Railway for tool execution. No setup required — just add your API key and start querying.
|
|
272
|
+
|
|
273
|
+
### Self-hosting the web UI
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
cd web
|
|
277
|
+
npm install
|
|
278
|
+
echo "ANTHROPIC_API_KEY=sk-ant-..." > .env.local # optional server-side fallback
|
|
279
|
+
npm run dev -- -p 3456
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Set `MCP_SERVER_URL` to point to your own MCP server instance (default: the public Railway deployment).
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## HTTP Transport
|
|
287
|
+
|
|
288
|
+
The server supports both **stdio** (default, for local MCP clients) and **Streamable HTTP** (for hosted deployment).
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Stdio mode (default — for Claude Code, Claude Desktop)
|
|
292
|
+
npx heor-agent-mcp
|
|
293
|
+
|
|
294
|
+
# HTTP mode — for hosted deployment, Smithery, web UI backend
|
|
295
|
+
npx heor-agent-mcp --http # port 8787
|
|
296
|
+
MCP_HTTP_PORT=3000 npx heor-agent-mcp # custom port
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
HTTP endpoints:
|
|
300
|
+
- `POST/GET/DELETE /mcp` — MCP Streamable HTTP protocol
|
|
301
|
+
- `GET /health` — health check
|
|
302
|
+
- `GET /.well-known/mcp/server-card.json` — Smithery discovery
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
260
306
|
## Development
|
|
261
307
|
|
|
262
308
|
```bash
|
|
263
|
-
git clone https://github.com/neptun2000/
|
|
264
|
-
cd
|
|
309
|
+
git clone https://github.com/neptun2000/heor-agent-mcp
|
|
310
|
+
cd heor-agent-mcp
|
|
265
311
|
npm install
|
|
266
312
|
npm test # 244 tests across 66 suites
|
|
267
313
|
npm run build # Compile TypeScript to dist/
|
|
@@ -316,8 +362,21 @@ MIT — see [LICENSE](./LICENSE).
|
|
|
316
362
|
|
|
317
363
|
---
|
|
318
364
|
|
|
365
|
+
## Distribution
|
|
366
|
+
|
|
367
|
+
| Channel | How to use | Who pays |
|
|
368
|
+
|---------|-----------|----------|
|
|
369
|
+
| **npm** | `npx heor-agent-mcp` | User's Claude subscription |
|
|
370
|
+
| **Smithery** | [smithery.ai/servers/neptun2000-70zu/heor-agent-mcp](https://smithery.ai/servers/neptun2000-70zu/heor-agent-mcp) | User's Claude subscription |
|
|
371
|
+
| **Web UI** | [web-michael-ns-projects.vercel.app](https://web-michael-ns-projects.vercel.app) | User's own Anthropic API key (BYOK) |
|
|
372
|
+
| **Hosted MCP** | `https://heor-agent-mcp-production.up.railway.app` | Free (tool execution only) |
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
319
376
|
## Links
|
|
320
377
|
|
|
321
378
|
- **npm:** https://www.npmjs.com/package/heor-agent-mcp
|
|
322
|
-
- **GitHub:** https://github.com/neptun2000/
|
|
323
|
-
- **
|
|
379
|
+
- **GitHub:** https://github.com/neptun2000/heor-agent-mcp
|
|
380
|
+
- **Smithery:** https://smithery.ai/servers/neptun2000-70zu/heor-agent-mcp
|
|
381
|
+
- **Web UI:** https://web-michael-ns-projects.vercel.app
|
|
382
|
+
- **Issues:** https://github.com/neptun2000/heor-agent-mcp/issues
|
package/dist/models/psa.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psa.d.ts","sourceRoot":"","sources":["../../src/models/psa.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"psa.d.ts","sourceRoot":"","sources":["../../src/models/psa.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAO3D,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;AAE1C,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,aAAa,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,IAAI,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,YAAY,EAAE,CAAC;CAChC;AAiCD;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CA8InD"}
|
package/dist/models/psa.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Probabilistic Sensitivity Analysis (PSA) using Monte Carlo simulation.
|
|
3
3
|
*/
|
|
4
4
|
import { betaSample, gammaSample, createSeededRng } from "./distributions.js";
|
|
5
|
-
import { runMarkovAndComputeICER } from "./modelUtils.js";
|
|
5
|
+
import { runMarkovAndComputeICER, } from "./modelUtils.js";
|
|
6
6
|
const WTP_THRESHOLDS_PSA = {
|
|
7
|
-
nhs_low:
|
|
8
|
-
nhs_high:
|
|
7
|
+
nhs_low: 25000,
|
|
8
|
+
nhs_high: 35000,
|
|
9
9
|
us_payer_low: 100000,
|
|
10
10
|
us_payer_mid: 150000,
|
|
11
11
|
societal: 50000,
|
|
@@ -43,19 +43,19 @@ export function runPSA(params) {
|
|
|
43
43
|
...params.base_params,
|
|
44
44
|
clinical_inputs: {
|
|
45
45
|
...params.base_params.clinical_inputs,
|
|
46
|
-
efficacy_delta: perturbBeta(Math.max(0.001, Math.min(0.999, params.base_params.clinical_inputs.efficacy_delta)), 0.
|
|
46
|
+
efficacy_delta: perturbBeta(Math.max(0.001, Math.min(0.999, params.base_params.clinical_inputs.efficacy_delta)), 0.1, rng),
|
|
47
47
|
mortality_reduction: params.base_params.clinical_inputs.mortality_reduction !== undefined
|
|
48
|
-
? perturbBeta(Math.max(0.001, Math.min(0.999, params.base_params.clinical_inputs.mortality_reduction)), 0.
|
|
48
|
+
? perturbBeta(Math.max(0.001, Math.min(0.999, params.base_params.clinical_inputs.mortality_reduction)), 0.1, rng)
|
|
49
49
|
: undefined,
|
|
50
50
|
},
|
|
51
51
|
cost_inputs: {
|
|
52
|
-
drug_cost_annual: perturbGamma(params.base_params.cost_inputs.drug_cost_annual, 0.
|
|
53
|
-
comparator_cost_annual: perturbGamma(params.base_params.cost_inputs.comparator_cost_annual, 0.
|
|
52
|
+
drug_cost_annual: perturbGamma(params.base_params.cost_inputs.drug_cost_annual, 0.2, rng),
|
|
53
|
+
comparator_cost_annual: perturbGamma(params.base_params.cost_inputs.comparator_cost_annual, 0.2, rng),
|
|
54
54
|
admin_cost: params.base_params.cost_inputs.admin_cost !== undefined
|
|
55
|
-
? perturbGamma(params.base_params.cost_inputs.admin_cost, 0.
|
|
55
|
+
? perturbGamma(params.base_params.cost_inputs.admin_cost, 0.2, rng)
|
|
56
56
|
: undefined,
|
|
57
57
|
ae_cost: params.base_params.cost_inputs.ae_cost !== undefined
|
|
58
|
-
? perturbGamma(params.base_params.cost_inputs.ae_cost, 0.
|
|
58
|
+
? perturbGamma(params.base_params.cost_inputs.ae_cost, 0.2, rng)
|
|
59
59
|
: undefined,
|
|
60
60
|
},
|
|
61
61
|
utility_inputs: params.base_params.utility_inputs
|
|
@@ -69,27 +69,30 @@ export function runPSA(params) {
|
|
|
69
69
|
iterations.push({ delta_cost, delta_qaly, icer });
|
|
70
70
|
}
|
|
71
71
|
// Compute statistics
|
|
72
|
-
const finiteICERs = iterations
|
|
72
|
+
const finiteICERs = iterations
|
|
73
|
+
.map((it) => it.icer)
|
|
74
|
+
.filter((ic) => isFinite(ic));
|
|
73
75
|
const sortedICERs = [...finiteICERs].sort((a, b) => a - b);
|
|
74
76
|
const mean_icer = finiteICERs.length > 0
|
|
75
77
|
? finiteICERs.reduce((a, b) => a + b, 0) / finiteICERs.length
|
|
76
78
|
: Infinity;
|
|
77
79
|
const ci_icer_lower = sortedICERs.length > 0
|
|
78
|
-
? sortedICERs[Math.floor(sortedICERs.length * 0.025)] ?? sortedICERs[0]
|
|
80
|
+
? (sortedICERs[Math.floor(sortedICERs.length * 0.025)] ?? sortedICERs[0])
|
|
79
81
|
: 0;
|
|
80
82
|
const ci_icer_upper = sortedICERs.length > 0
|
|
81
|
-
? sortedICERs[Math.floor(sortedICERs.length * 0.975)] ??
|
|
83
|
+
? (sortedICERs[Math.floor(sortedICERs.length * 0.975)] ??
|
|
84
|
+
sortedICERs[sortedICERs.length - 1])
|
|
82
85
|
: 0;
|
|
83
86
|
// Probability cost-effective at named thresholds
|
|
84
87
|
const prob_cost_effective = {};
|
|
85
88
|
for (const [name, wtp] of Object.entries(WTP_THRESHOLDS_PSA)) {
|
|
86
|
-
const n_ce = iterations.filter(it => wtp * it.delta_qaly - it.delta_cost > 0).length;
|
|
89
|
+
const n_ce = iterations.filter((it) => wtp * it.delta_qaly - it.delta_cost > 0).length;
|
|
87
90
|
prob_cost_effective[name] = n_ce / iterations.length;
|
|
88
91
|
}
|
|
89
92
|
// CEAC: WTP from $0 to $300,000 in $5,000 steps
|
|
90
93
|
const ceac = [];
|
|
91
94
|
for (let wtp = 0; wtp <= 300000; wtp += 5000) {
|
|
92
|
-
const n_ce = iterations.filter(it => wtp * it.delta_qaly - it.delta_cost > 0).length;
|
|
95
|
+
const n_ce = iterations.filter((it) => wtp * it.delta_qaly - it.delta_cost > 0).length;
|
|
93
96
|
ceac.push({ wtp, prob_ce: n_ce / iterations.length });
|
|
94
97
|
}
|
|
95
98
|
// EVPI: E[max_arm(NMB)] - max_arm(E[NMB])
|
package/dist/models/psa.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psa.js","sourceRoot":"","sources":["../../src/models/psa.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"psa.js","sourceRoot":"","sources":["../../src/models/psa.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAEL,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AA2BzB,MAAM,kBAAkB,GAA2B;IACjD,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF;;;GAGG;AACH,SAAS,WAAW,CAAC,KAAa,EAAE,EAAU,EAAE,GAAiB;IAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IACxC,4CAA4C;IAC5C,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACrD,OAAO,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAa,EAAE,EAAU,EAAE,GAAiB;IAChE,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG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AC,CAAC;IAEhD,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEhD,OAAO;QACL,UAAU;QACV,SAAS;QACT,aAAa;QACb,aAAa;QACb,mBAAmB;QACnB,IAAI;QACJ,IAAI;QACJ,cAAc;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"niceTa.d.ts","sourceRoot":"","sources":["../../../src/providers/direct/niceTa.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,wBAAsB,WAAW,
|
|
1
|
+
{"version":3,"file":"niceTa.d.ts","sourceRoot":"","sources":["../../../src/providers/direct/niceTa.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA6B7B"}
|
|
@@ -7,7 +7,7 @@ export async function fetchNiceTa(query, maxResults) {
|
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
title: `NICE Single Technology Appraisal Process Guide`,
|
|
10
|
-
abstract: `NICE's STA methodology guide PMG36 and process guide PMG19. Required reading for company submissions. Covers reference case, time horizon, discount rates (3.5%), perspective (NHS+PSS), ICER threshold (£
|
|
10
|
+
abstract: `NICE's STA methodology guide PMG36 and process guide PMG19. Required reading for company submissions. Covers reference case, time horizon, discount rates (3.5%), perspective (NHS+PSS), ICER threshold (£25–35K/QALY, updated April 2026), end-of-life criteria, and innovation rating.`,
|
|
11
11
|
url: "https://www.nice.org.uk/process/pmg36",
|
|
12
12
|
},
|
|
13
13
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"niceTa.js","sourceRoot":"","sources":["../../../src/providers/direct/niceTa.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,WAAW,
|
|
1
|
+
{"version":3,"file":"niceTa.js","sourceRoot":"","sources":["../../../src/providers/direct/niceTa.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAa,EACb,UAAkB;IAElB,MAAM,OAAO,GAAG;QACd;YACE,KAAK,EAAE,sCAAsC,KAAK,EAAE;YACpD,QAAQ,EAAE,oPAAoP,KAAK,yJAAyJ;YAC5Z,GAAG,EAAE,oCAAoC,kBAAkB,CAAC,KAAK,CAAC,wDAAwD;SAC3H;QACD;YACE,KAAK,EAAE,gDAAgD;YACvD,QAAQ,EAAE,0RAA0R;YACpS,GAAG,EAAE,uCAAuC;SAC7C;QACD;YACE,KAAK,EAAE,+BAA+B;YACtC,QAAQ,EAAE,wNAAwN;YAClO,GAAG,EAAE,0EAA0E;SAChF;KACF,CAAC;IAEF,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACjD,EAAE,EAAE,WAAW,CAAC,EAAE;QAClB,MAAM,EAAE,SAAkB;QAC1B,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,OAAO,EAAE,CAAC,0DAA0D,CAAC;QACrE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACzC,UAAU,EAAE,YAAY;QACxB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,GAAG,EAAE,CAAC,CAAC,GAAG;KACX,CAAC,CAAC,CAAC;AACN,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
4
5
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
6
|
import { handleLiteratureSearch, literatureSearchToolSchema, } from "./tools/literatureSearch.js";
|
|
6
7
|
import { handleCostEffectivenessModel, costEffectivenessModelToolSchema, } from "./tools/costEffectivenessModel.js";
|
|
@@ -9,70 +10,196 @@ import { handleKnowledgeSearch, knowledgeSearchToolSchema, } from "./tools/knowl
|
|
|
9
10
|
import { handleKnowledgeRead, knowledgeReadToolSchema, } from "./tools/knowledgeRead.js";
|
|
10
11
|
import { handleKnowledgeWrite, knowledgeWriteToolSchema, } from "./tools/knowledgeWrite.js";
|
|
11
12
|
import { handleProjectCreate, projectCreateToolSchema, } from "./tools/projectCreate.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
13
|
+
import { randomUUID } from "node:crypto";
|
|
14
|
+
import { createServer } from "node:http";
|
|
15
|
+
import { readFile } from "node:fs/promises";
|
|
16
|
+
import { join, dirname } from "node:path";
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
18
|
+
function createMcpServer() {
|
|
19
|
+
const server = new Server({ name: "heor-agent-mcp", version: "0.1.3" }, { capabilities: { tools: {} } });
|
|
20
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
21
|
+
tools: [
|
|
22
|
+
literatureSearchToolSchema,
|
|
23
|
+
costEffectivenessModelToolSchema,
|
|
24
|
+
htaDossierPrepToolSchema,
|
|
25
|
+
knowledgeSearchToolSchema,
|
|
26
|
+
knowledgeReadToolSchema,
|
|
27
|
+
knowledgeWriteToolSchema,
|
|
28
|
+
projectCreateToolSchema,
|
|
29
|
+
],
|
|
30
|
+
}));
|
|
31
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
32
|
+
const { name, arguments: args } = request.params;
|
|
33
|
+
try {
|
|
34
|
+
let result;
|
|
35
|
+
switch (name) {
|
|
36
|
+
case "literature_search":
|
|
37
|
+
result = await handleLiteratureSearch(args);
|
|
38
|
+
break;
|
|
39
|
+
case "cost_effectiveness_model":
|
|
40
|
+
result = await handleCostEffectivenessModel(args);
|
|
41
|
+
break;
|
|
42
|
+
case "hta_dossier_prep":
|
|
43
|
+
result = await handleHtaDossierPrep(args);
|
|
44
|
+
break;
|
|
45
|
+
case "knowledge_search":
|
|
46
|
+
result = await handleKnowledgeSearch(args);
|
|
47
|
+
break;
|
|
48
|
+
case "knowledge_read":
|
|
49
|
+
result = await handleKnowledgeRead(args);
|
|
50
|
+
break;
|
|
51
|
+
case "knowledge_write":
|
|
52
|
+
result = await handleKnowledgeWrite(args);
|
|
53
|
+
break;
|
|
54
|
+
case "project_create":
|
|
55
|
+
result = await handleProjectCreate(args);
|
|
56
|
+
break;
|
|
57
|
+
default:
|
|
58
|
+
return {
|
|
59
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
60
|
+
isError: true,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const content = typeof result.content === "string"
|
|
64
|
+
? result.content
|
|
65
|
+
: JSON.stringify(result.content, null, 2);
|
|
66
|
+
return {
|
|
67
|
+
content: [{ type: "text", text: content }],
|
|
68
|
+
};
|
|
55
69
|
}
|
|
56
|
-
|
|
57
|
-
?
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
async function main() {
|
|
70
|
+
catch (err) {
|
|
71
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
72
|
+
return {
|
|
73
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
74
|
+
isError: true,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return server;
|
|
79
|
+
}
|
|
80
|
+
// --- Stdio mode (default) ---
|
|
81
|
+
async function runStdio() {
|
|
82
|
+
const server = createMcpServer();
|
|
72
83
|
const transport = new StdioServerTransport();
|
|
73
84
|
await server.connect(transport);
|
|
74
85
|
console.error("HEORAgent MCP server running on stdio");
|
|
75
86
|
}
|
|
87
|
+
// --- HTTP mode (--http flag or MCP_HTTP_PORT env) ---
|
|
88
|
+
async function runHttp(port) {
|
|
89
|
+
const sessions = {};
|
|
90
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
91
|
+
const httpServer = createServer(async (req, res) => {
|
|
92
|
+
// CORS headers
|
|
93
|
+
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
94
|
+
res.setHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS");
|
|
95
|
+
res.setHeader("Access-Control-Allow-Headers", "Content-Type, mcp-session-id");
|
|
96
|
+
res.setHeader("Access-Control-Expose-Headers", "mcp-session-id");
|
|
97
|
+
if (req.method === "OPTIONS") {
|
|
98
|
+
res.writeHead(204);
|
|
99
|
+
res.end();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
// Serve server-card.json for Smithery discovery
|
|
103
|
+
if (req.method === "GET" &&
|
|
104
|
+
req.url === "/.well-known/mcp/server-card.json") {
|
|
105
|
+
try {
|
|
106
|
+
const cardPath = join(__dirname, "..", ".well-known", "mcp", "server-card.json");
|
|
107
|
+
const card = await readFile(cardPath, "utf-8");
|
|
108
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
109
|
+
res.end(card);
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
res.writeHead(404);
|
|
113
|
+
res.end("Not found");
|
|
114
|
+
}
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
// Health check
|
|
118
|
+
if (req.method === "GET" && req.url === "/health") {
|
|
119
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
120
|
+
res.end(JSON.stringify({ status: "ok", server: "heor-agent-mcp", version: "0.1.3" }));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
// MCP endpoint
|
|
124
|
+
if (req.url === "/mcp") {
|
|
125
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
126
|
+
if (req.method === "POST") {
|
|
127
|
+
// Parse body
|
|
128
|
+
const chunks = [];
|
|
129
|
+
for await (const chunk of req) {
|
|
130
|
+
chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
131
|
+
}
|
|
132
|
+
const body = JSON.parse(Buffer.concat(chunks).toString());
|
|
133
|
+
let transport;
|
|
134
|
+
if (sessionId && sessions[sessionId]) {
|
|
135
|
+
transport = sessions[sessionId];
|
|
136
|
+
}
|
|
137
|
+
else if (!sessionId && body?.method === "initialize") {
|
|
138
|
+
// New session
|
|
139
|
+
const server = createMcpServer();
|
|
140
|
+
transport = new StreamableHTTPServerTransport({
|
|
141
|
+
sessionIdGenerator: () => randomUUID(),
|
|
142
|
+
onsessioninitialized: (id) => {
|
|
143
|
+
sessions[id] = transport;
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
transport.onclose = () => {
|
|
147
|
+
const id = Object.entries(sessions).find(([, t]) => t === transport)?.[0];
|
|
148
|
+
if (id)
|
|
149
|
+
delete sessions[id];
|
|
150
|
+
};
|
|
151
|
+
await server.connect(transport);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
155
|
+
res.end(JSON.stringify({ error: "Invalid or missing session" }));
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
await transport.handleRequest(req, res, body);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (req.method === "GET") {
|
|
162
|
+
if (!sessionId || !sessions[sessionId]) {
|
|
163
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
164
|
+
res.end(JSON.stringify({ error: "Invalid session" }));
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
await sessions[sessionId].handleRequest(req, res);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (req.method === "DELETE") {
|
|
171
|
+
if (sessionId && sessions[sessionId]) {
|
|
172
|
+
await sessions[sessionId].close();
|
|
173
|
+
delete sessions[sessionId];
|
|
174
|
+
}
|
|
175
|
+
res.writeHead(200);
|
|
176
|
+
res.end();
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
res.writeHead(404);
|
|
181
|
+
res.end("Not found");
|
|
182
|
+
});
|
|
183
|
+
httpServer.listen(port, "0.0.0.0", () => {
|
|
184
|
+
console.error(`HEORAgent MCP server running on HTTP port ${port}`);
|
|
185
|
+
console.error(` MCP endpoint: http://localhost:${port}/mcp`);
|
|
186
|
+
console.error(` Health check: http://localhost:${port}/health`);
|
|
187
|
+
console.error(` Server card: http://localhost:${port}/.well-known/mcp/server-card.json`);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
// --- Entrypoint ---
|
|
191
|
+
async function main() {
|
|
192
|
+
const args = process.argv.slice(2);
|
|
193
|
+
const httpFlag = args.includes("--http");
|
|
194
|
+
const portEnv = process.env.MCP_HTTP_PORT;
|
|
195
|
+
if (httpFlag || portEnv) {
|
|
196
|
+
const port = parseInt(portEnv || "8787", 10);
|
|
197
|
+
await runHttp(port);
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
await runStdio();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
76
203
|
main().catch((err) => {
|
|
77
204
|
console.error("Fatal error:", err);
|
|
78
205
|
process.exit(1);
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AA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{ saveReport } from "../knowledge/index.js";
|
|
43
43
|
import { saveModelRun } from "../knowledge/index.js";
|
|
44
44
|
const WTP_THRESHOLDS = {
|
|
45
|
-
nhs: { low:
|
|
45
|
+
nhs: { low: 25000, high: 35000, currency: "GBP", symbol: "£" },
|
|
46
46
|
us_payer: { low: 100000, high: 150000, currency: "USD", symbol: "$" },
|
|
47
47
|
societal: { low: 50000, high: 100000, currency: "USD", symbol: "$" },
|
|
48
48
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heor-agent-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "mnaumov",
|
|
6
6
|
"engines": {
|
|
@@ -58,9 +58,11 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
60
60
|
"docx": "^9.6.1",
|
|
61
|
+
"express": "^5.2.1",
|
|
61
62
|
"zod": "^3.22.4"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
65
|
+
"@types/express": "^5.0.6",
|
|
64
66
|
"@types/jest": "^29.5.11",
|
|
65
67
|
"@types/node": "^20.11.0",
|
|
66
68
|
"jest": "^29.7.0",
|