@uphealth/mcp-server 1.1.4 → 1.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 CHANGED
@@ -1,103 +1,146 @@
1
- # Uphealth MCP Server (Track A A4)
1
+ # Uphealth Signal MCP server
2
2
 
3
3
  **The adaptive health-messaging engine for apps and agents** — federally-sourced, audience-safe. Not medical advice.
4
4
 
5
- Wraps the [`api.uphealth.us` cued-stream API](../docs/spec_track_a_a1_cued_stream_api.md) as agent-callable [Model Context Protocol](https://modelcontextprotocol.io/) tools. The agent can call `lookup_health_fact` with **zero setup no key** to get one already-public federal health fact, then configure a free `up_sandbox_…` key to drive an adaptive cued patient stream with the 4 keyed tools.
5
+ The Uphealth MCP server lets any [Model Context Protocol](https://modelcontextprotocol.io/) client Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, or your own agent look up federal health facts and drive a cued health-message stream as five tools (one needs no key). It wraps the [Signal API](https://uphealth.us/docs); the model never sees your raw HTTP layer.
6
6
 
7
- Locks captured in [`docs/spec_track_a_a4_mcp_server.md`](../docs/spec_track_a_a4_mcp_server.md):
7
+ **Try it with zero setup:** `lookup_health_fact` needs **no key** — one already-public federal fact per question. For the adaptive stream, **get a free sandbox key** (no credit card, no PHI, no BAA) at **https://uphealth.us/signup**, then pick an install method below.
8
8
 
9
- - **SDK** TypeScript via `@modelcontextprotocol/sdk` (flipped from Python at 2026-05-22 build-kickoff revalidation)
10
- - **Tool surface** — 5 tools: a **no-key** `lookup_health_fact` (one already-public federal fact per question, zero setup) + 4 keyed tools (`create_patient_stream` / `get_next_cued_message` / `read_stream_state` / `list_sandbox_topics`)
11
- - **Auth** — Bearer-token passthrough (MCP server is stateless thin proxy; Rails validates). `lookup_health_fact` is the sole exception — it needs no key; the per-tool policy still 401s every keyed tool without one.
12
- - **Corpus** — sandbox only at v1
13
- - **Hostname** — `mcp.uphealth.us` subdomain (Option A locked)
14
- - **Transport** — Streamable HTTP
9
+ ## The five tools
15
10
 
16
- ## Local dev
11
+ | Tool | Wraps | Key? | Does |
12
+ |---|---|---|---|
13
+ | `lookup_health_fact` | `GET /v1/public/health-fact` | **none** | One already-public federal fact for a question/topic + its source + an uphealth.me link |
14
+ | `create_patient_stream` | `POST /v1/signal/streams` | `up_…` | Start a stream from a template; returns the opening cue |
15
+ | `get_next_cued_message` | `POST /v1/signal/streams/:id/cue` | `up_…` | Submit the patient's response, get the next message |
16
+ | `read_stream_state` | `GET /v1/signal/streams/:id` | `up_…` | Read state + current cue without advancing |
17
+ | `list_sandbox_topics` | `GET /v1/signal/sandbox-topics` | `up_…` | List the five sandbox topics |
17
18
 
18
- ```bash
19
- nvm use # picks Node 22 from .nvmrc
20
- npm install
21
- cp .env.example .env
22
- npm run dev # tsx hot-reload of src/index.ts
23
- ```
19
+ **The one rule** (keyed tools): every cue after the first requires feedback on the prior one (the model passes the patient's `response_action`). The tool descriptions teach this, so a capable agent drives the loop correctly.
24
20
 
25
- The dev server listens on `:3001`. Point an MCP client at `http://localhost:3001/mcp` with `Authorization: Bearer <a valid up_sandbox_… token from api.uphealth.us>`.
21
+ ---
26
22
 
27
- ## Build + run (production)
23
+ ## Option A Local (stdio via `npx`) · recommended
28
24
 
29
- ```bash
30
- npm ci # full install — typescript (the compiler) is a devDependency
31
- npm run build # tsc → dist/
32
- node dist/index.js # systemd does this via bin/mcp-server-systemd.sh
25
+ No hosting, no URL. The client launches the server as a subprocess with your key in its environment.
26
+
27
+ ### Claude Desktop
28
+
29
+ `claude_desktop_config.json` (Settings → Developer → Edit Config):
30
+
31
+ ```json
32
+ {
33
+ "mcpServers": {
34
+ "uphealth": {
35
+ "command": "npx",
36
+ "args": ["-y", "@uphealth/mcp-server"],
37
+ "env": { "UPHEALTH_API_KEY": "up_sandbox_YOUR_KEY" }
38
+ }
39
+ }
40
+ }
33
41
  ```
34
42
 
35
- ## Tests
43
+ ### Cursor
36
44
 
37
- ```bash
38
- npm test # vitest run; mocks global fetch
45
+ `~/.cursor/mcp.json` (or a project's `.cursor/mcp.json`):
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "uphealth": {
51
+ "command": "npx",
52
+ "args": ["-y", "@uphealth/mcp-server"],
53
+ "env": { "UPHEALTH_API_KEY": "up_sandbox_YOUR_KEY" }
54
+ }
55
+ }
56
+ }
39
57
  ```
40
58
 
41
- ## Environment
59
+ ### VS Code (Copilot agent mode)
42
60
 
43
- See [`.env.example`](.env.example) for the full list. Required: `RAILS_API_BASE_URL`. Optional with defaults: `MCP_SERVER_PORT` (`3001`), `NODE_ENV` (`development`), `LOG_LEVEL` (`info`).
61
+ `.vscode/mcp.json`:
44
62
 
45
- ## Deployment (co-located on the `.us` droplet at `mcp.uphealth.us`)
63
+ ```json
64
+ {
65
+ "servers": {
66
+ "uphealth": {
67
+ "command": "npx",
68
+ "args": ["-y", "@uphealth/mcp-server"],
69
+ "env": { "UPHEALTH_API_KEY": "up_sandbox_YOUR_KEY" }
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### Claude Code (CLI)
76
+
77
+ ```bash
78
+ claude mcp add uphealth --env UPHEALTH_API_KEY=up_sandbox_YOUR_KEY -- npx -y @uphealth/mcp-server
79
+ ```
46
80
 
47
- Per spec §6.1 lock 2026-05-22, the MCP server runs as a Node process **co-located with Rails on the existing `.us` droplet** (`164.92.77.128`, $14/mo `s-1vcpu-2gb-amd`). No separate droplet — the MCP server is a thin Node proxy (< 50 MB RAM, no DB connection, no state) so resource pressure on Rails is negligible. The existing [`bin/deploy`](../bin/deploy) cron handles MCP rebuilds when files under `mcp-server/` change.
81
+ Any other stdio MCP client uses the same shape: command `npx`, args `["-y", "@uphealth/mcp-server"]`, env `UPHEALTH_API_KEY`.
48
82
 
49
- A separate companion droplet remains a v2 option if MCP traffic exceeds Rails on the shared droplet OR an enterprise buyer requires isolation. See spec §6.1 for the migration path.
83
+ ---
50
84
 
51
- ### One-time provisioning sequence
85
+ ## Option B — Remote (hosted Streamable HTTP)
52
86
 
53
- The provisioning steps live on the existing `.us` droplet (`164.92.77.128`). Eric does the DO panel step (#2 DNS); the rest run via SSH.
87
+ The server is also hosted at `https://mcp.uphealth.us/mcp`. Clients with native remote-MCP support add it directly with an `Authorization: Bearer` header. For clients that only speak stdio, bridge with `mcp-remote`:
54
88
 
55
- 1. **Install Node 22 LTS** (only step that adds new software; the `.us` droplet currently runs Ruby + Rails only). Install via the **NodeSource apt repo** so `node` + `npm` land at `/usr/bin/` on the system PATH:
56
- ```bash
57
- curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
58
- apt install -y nodejs # Node 22 + npm at /usr/bin/{node,npm}
59
- node --version # expect v22.x
60
- which node npm # expect /usr/bin/node /usr/bin/npm
61
- ```
62
- > A system-PATH install is required, not nvm: (a) the systemd unit's `ExecStart=/usr/bin/node` is an absolute path, and (b) the `bin/deploy` auto-rebuild hook gates on `command -v npm`, which the cron environment only resolves for a `/usr/bin` install. Plain `apt install nodejs` (without the NodeSource repo) ships an EOL Node on Ubuntu; nvm puts `node` under `~/.nvm` where neither the absolute `ExecStart` nor the cron PATH will find it.
63
- 2. **Add DNS** — Eric adds A record `mcp.uphealth.us → 164.92.77.128` via DO Networking → Domains → uphealth.us (same IP as the existing `uphealth.us` / `www.uphealth.us` / `api.uphealth.us` records; we're co-locating). Propagation typically minutes.
64
- 3. **Configure env** — copy [`mcp-server/.env.example`](.env.example) to `/root/uphealth-us/mcp-server/.env.production`; set `RAILS_API_BASE_URL=https://api.uphealth.us` and `NODE_ENV=production`. `chmod 600` since it's root-only.
65
- 4. **Initial build** — `cd /root/uphealth-us/mcp-server && npm ci && npm run build` (full install — `typescript` is a devDependency the build needs — then `tsc` → `dist/`; this is exactly what `bin/mcp-server-systemd.sh` runs on every subsequent deploy). Verify `dist/index.js` exists. Do NOT use `npm ci --omit=dev` here: it skips the compiler and the build silently fails (see the comment block in `bin/mcp-server-systemd.sh` documenting the `tsc@2.0.4` fall-through).
66
- 5. **Install systemd unit** — `cp /root/uphealth-us/config/systemd/uphealth-mcp-server.service /etc/systemd/system/` → `systemctl daemon-reload` → `systemctl enable --now uphealth-mcp-server` → `systemctl status uphealth-mcp-server` to verify "active (running)". Logs via `journalctl -u uphealth-mcp-server -f`.
67
- 6. **nginx vhost** — `cp /root/uphealth-us/mcp-server/ops/nginx-vhost.conf /etc/nginx/sites-available/uphealth-us-mcp` → `ln -s /etc/nginx/sites-available/uphealth-us-mcp /etc/nginx/sites-enabled/` → `nginx -t` (must pass) → `systemctl reload nginx`.
68
- 7. **Cert SAN extension** — `certbot --nginx --expand -d uphealth.us -d www.uphealth.us -d api.uphealth.us -d mcp.uphealth.us`. Existing cert at `/etc/letsencrypt/live/uphealth.us/` gains the new SAN; auto-renewal via the certbot timer continues.
69
- 8. **Auto-deploy cron is already running** on `/root/uphealth-us/bin/deploy` per the existing `.us` setup. The `bin/deploy` extension (PR #424) detects changes under `mcp-server/` and runs `bin/mcp-server-systemd.sh` automatically. No new cron entry needed.
89
+ ```json
90
+ {
91
+ "mcpServers": {
92
+ "uphealth": {
93
+ "command": "npx",
94
+ "args": [
95
+ "-y", "mcp-remote", "https://mcp.uphealth.us/mcp",
96
+ "--header", "Authorization: Bearer up_sandbox_YOUR_KEY"
97
+ ]
98
+ }
99
+ }
100
+ }
101
+ ```
70
102
 
71
- After step 8, subsequent pushes that touch `mcp-server/` trigger `npm ci && npm run build && systemctl restart uphealth-mcp-server` automatically (via `bin/mcp-server-systemd.sh`).
103
+ ---
72
104
 
73
- ### Smoke verification (post-deploy)
105
+ ## Verify
74
106
 
75
- Mirror the A1 PR C 6-step smoke against the MCP server using `@modelcontextprotocol/inspector`:
107
+ Use the MCP Inspector against either transport:
76
108
 
77
109
  ```bash
78
- npx @modelcontextprotocol/inspector \
79
- --transport streamable-http \
110
+ # local stdio
111
+ UPHEALTH_API_KEY=up_sandbox_YOUR_KEY npx @modelcontextprotocol/inspector npx -y @uphealth/mcp-server
112
+
113
+ # hosted
114
+ npx @modelcontextprotocol/inspector --transport streamable-http \
80
115
  --url https://mcp.uphealth.us/mcp \
81
- --header "Authorization: Bearer <up_sandbox_…>"
116
+ --header "Authorization: Bearer up_sandbox_YOUR_KEY"
82
117
  ```
83
118
 
84
- Then in the inspector UI:
119
+ Then call `create_patient_stream` with `template_id: "general_wellness_daily"`, and `get_next_cued_message` with a `response_action` (e.g. `did_it`).
120
+
121
+ ## Where it's published
85
122
 
86
- 1. `create_patient_stream` with `template_id: "general_wellness_daily"` → returns `stream_id` + `first_cue`
87
- 2. `get_next_cued_message` WITHOUT feedback → returns `isError: true` with the moat-explainer message
88
- 3. `get_next_cued_message` WITH valid feedback returns next cue
89
- 4. `get_next_cued_message` again with same `idempotency_key` + same feedback → returns the cached cue (idempotent)
90
- 5. `read_stream_state` returns current state + events_count
91
- 6. `list_sandbox_topics` returns 5 topic labels
123
+ | Surface | Coordinates |
124
+ |---|---|
125
+ | npm (this package) | [`@uphealth/mcp-server`](https://www.npmjs.com/package/@uphealth/mcp-server) stdio via `npx` |
126
+ | Official MCP registry | `us.uphealth/mcp` ([registry.modelcontextprotocol.io](https://registry.modelcontextprotocol.io/v0/servers?search=us.uphealth)) |
127
+ | Hosted remote | `https://mcp.uphealth.us/mcp` (Streamable HTTP) |
128
+ | SDKs | npm [`@uphealth/signal`](https://www.npmjs.com/package/@uphealth/signal) (Node/TS) · PyPI [`uphealth-signal`](https://pypi.org/project/uphealth-signal/) (Python) |
129
+ | Smithery | [`uphealth/signal`](https://smithery.ai/server/uphealth/signal) |
130
+ | Glama | Listed + claimed (ownership via `/.well-known/glama.json` on `mcp.uphealth.us` and the `uphealth.us` apex) |
131
+ | mcp.so | [`uphealth-signal`](https://mcp.so/server/uphealth-signal) |
92
132
 
93
- Pass criteria: all 6 steps green; the moat error in step 2 includes the phrase "structural, not a bug".
133
+ The npm package page shows the current version; third-party catalogs re-scan on their own schedule, so their displayed version can lag a release or two behind npm and the official registry.
94
134
 
95
- ## Registry submission (at A4 launch)
135
+ ## Notes
96
136
 
97
- Per [`docs/spec_track_a_a4_mcp_server.md`](../docs/spec_track_a_a4_mcp_server.md) §9 and [`future_roadmap.md`](../docs/future_roadmap.md) §3 A4 strategic context, submit at launch to:
137
+ - **Keep your key private.** Treat `UPHEALTH_API_KEY` like any secret; don't commit client configs containing a live key.
138
+ - **Display mode only** in the sandbox — no PHI, no BAA. Deliver mode is BAA-gated at the PMPM tier.
139
+ - **Discovery quota:** 50 cues / calendar month. Over the cap, tools return the `over_quota` result with an upgrade link.
98
140
 
99
- - Anthropic MCP registry
100
- - Claude Desktop MCP directory
101
- - Third-party catalogs (mcp.so, mcpservers.com if active at launch time)
141
+ ## Links
102
142
 
103
- Captures the 5-month MCP-positioning window. Don't defer.
143
+ - Docs: https://uphealth.us/docs
144
+ - MCP quickstart: https://uphealth.us/docs/mcp-quickstart
145
+ - OpenAPI: https://uphealth.us/openapi/signal-v1.yaml
146
+ - Get a key: https://uphealth.us/signup
package/dist/config.js CHANGED
@@ -18,6 +18,6 @@ export const config = {
18
18
  nodeEnv: optionalEnv("NODE_ENV", "development"),
19
19
  logLevel: optionalEnv("LOG_LEVEL", "info"),
20
20
  serverName: "uphealth-mcp",
21
- serverVersion: "1.1.4",
21
+ serverVersion: "1.1.5",
22
22
  };
23
23
  //# sourceMappingURL=config.js.map
package/dist/index.js CHANGED
@@ -42,6 +42,9 @@ function extractBearer(req) {
42
42
  }
43
43
  function startHttpServer() {
44
44
  const app = express();
45
+ // Don't advertise the framework — gratuitous fingerprinting on a public,
46
+ // internet-facing listener. Zero-dependency; no behavior change.
47
+ app.disable("x-powered-by");
45
48
  app.use(express.json({ limit: "1mb" }));
46
49
  // Health check (does NOT require auth; useful for nginx/load-balancer probes).
47
50
  app.get("/health", (_req, res) => {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,EAAE;AACF,SAAS;AACT,4EAA4E;AAC5E,EAAE;A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AAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,qEAAqE;YACrE,2DAA2D;YAC3D,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;YAClD,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;gBACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC7B,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAE5B,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;QAC3B,OAAO,CAAC,GAAG,CACT,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,aAAa,mBAAmB,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,eAAe,EAAE,CAC1G,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,QAAQ;AACR,eAAe,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- // Track A A4 / A5 (2026-06-14) — MCP `outputSchema` declarations for the 4 tools.
1
+ // Track A A4 / A5 (2026-06-14) — MCP `outputSchema` declarations for the 5 tools.
2
2
  //
3
3
  // Declaring outputSchema (+ returning `structuredContent`, see tool-result.ts)
4
4
  // lets MCP hosts validate and parse a tool's result reliably instead of
@@ -29,6 +29,25 @@ const CUE_SCHEMA = {
29
29
  source_quote: { type: "string" },
30
30
  receptivity: { type: "number", description: "Advisory receptivity in [0.0, 1.0]; 0.5 = neutral/new patient." },
31
31
  safety: { type: "object", additionalProperties: true, description: "PHI-free audience-safety verdict." },
32
+ arc: {
33
+ type: ["object", "null"],
34
+ description: "Where this cue sits in the template's curated arc, or null when the cue is not on a spine. " +
35
+ "source is 'spine' or 'corpus_continuation'; a corpus-continuation cue (past the arc's end) " +
36
+ "carries source only, with day/phase/seq/total null.",
37
+ properties: {
38
+ source: { type: "string", description: "spine | corpus_continuation" },
39
+ day: { type: ["integer", "null"], description: "The curated arc day of this message." },
40
+ phase: { type: ["string", "null"], description: "The curated arc phase, e.g. starting_dose / titrating / re_entry." },
41
+ seq: { type: ["integer", "null"], description: "1-based position of this message in the spine." },
42
+ total: { type: ["integer", "null"], description: "Total messages in the spine." },
43
+ },
44
+ additionalProperties: true,
45
+ },
46
+ day_of_stream: {
47
+ type: ["integer", "null"],
48
+ description: "Advisory 1-based wall-clock day the patient is on in this stream (anchored to enrollment). " +
49
+ "Null on legacy cues issued before day-of-stream tracking.",
50
+ },
32
51
  cued_at: { type: "string", description: "ISO 8601 timestamp." },
33
52
  },
34
53
  additionalProperties: true,
@@ -87,6 +106,12 @@ export const getNextCuedMessageOutputSchema = {
87
106
  state: { type: "string" },
88
107
  // CueResult fields:
89
108
  idempotent: { type: "boolean", description: "true when this is the cached result of a repeated idempotency_key." },
109
+ normalized_action: {
110
+ type: ["string", "null"],
111
+ description: "null when the submitted response_action was a recognized value; otherwise the acknowledge-class " +
112
+ "value the well-formed-but-unrecognized action was folded to (forward-compat tolerance). " +
113
+ "Always present on a cue result; absent on the exhausted-stream result.",
114
+ },
90
115
  next_cue: CUE_SCHEMA,
91
116
  // StreamExhausted fields (end-of-stream marker):
92
117
  sandbox_exhausted: { type: "boolean", description: "Present + true when the sandbox subset is exhausted; no next_cue then." },
@@ -1 +1 @@
1
- {"version":3,"file":"output-schemas.js","sourceRoot":"","sources":["../src/output-schemas.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,+EAA+E;AAC/E,wEAAwE;AACxE,uEAAuE;AACvE,2EAA2E;AAC3E,iDAAiD;AACjD,EAAE;AACF,uEAAuE;AACvE,2E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,EAAE,mBAAmB,EAAE;gBAC1D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8DAA8D,EAAE;gBACvG,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE;gBAChF,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;aACpF;YACD,oBAAoB,EAAE,IAAI;SAC3B;QACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;QACpE,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;QAClF,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yEAAyE;YACtF,oBAAoB,EAAE,IAAI;SAC3B;KACF;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,CAAC;CAC3D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uphealth/mcp-server",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "mcpName": "us.uphealth/mcp",
5
5
  "description": "Uphealth Signal — the adaptive health-messaging engine for apps and agents. Drive federally-sourced, audience-safe cued health-message streams from any MCP client — local stdio via npx, or the hosted mcp.uphealth.us endpoint. Not medical advice.",
6
6
  "license": "MIT",
@@ -19,7 +19,7 @@
19
19
  "bin": {
20
20
  "uphealth-mcp": "dist/stdio.js"
21
21
  },
22
- "files": ["dist", "README.md", "DISTRIBUTION.md", "LICENSE"],
22
+ "files": ["dist", "README.md", "LICENSE"],
23
23
  "engines": {
24
24
  "node": ">=22.0.0"
25
25
  },
package/DISTRIBUTION.md DELETED
@@ -1,130 +0,0 @@
1
- # Use Uphealth Signal from an AI agent (MCP)
2
-
3
- The Uphealth MCP server lets any [Model Context Protocol](https://modelcontextprotocol.io/) client — Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, or your own agent — look up federal health facts and drive a cued health-message stream as five tools (one needs no key). It wraps the [Signal API](https://uphealth.us/docs); the model never sees your raw HTTP layer.
4
-
5
- **Try it with zero setup:** `lookup_health_fact` needs **no key** — one already-public federal fact per question. For the adaptive stream, **get a free sandbox key** (no credit card, no PHI, no BAA) at **https://uphealth.us/signup**, then pick an install method below.
6
-
7
- ## The five tools
8
-
9
- | Tool | Wraps | Key? | Does |
10
- |---|---|---|---|
11
- | `lookup_health_fact` | `GET /v1/public/health-fact` | **none** | One already-public federal fact for a question/topic + its source + an uphealth.me link |
12
- | `create_patient_stream` | `POST /v1/signal/streams` | `up_…` | Start a stream from a template; returns the opening cue |
13
- | `get_next_cued_message` | `POST /v1/signal/streams/:id/cue` | `up_…` | Submit the patient's response, get the next message |
14
- | `read_stream_state` | `GET /v1/signal/streams/:id` | `up_…` | Read state + current cue without advancing |
15
- | `list_sandbox_topics` | `GET /v1/signal/sandbox-topics` | `up_…` | List the five sandbox topics |
16
-
17
- **The one rule** (keyed tools): every cue after the first requires feedback on the prior one (the model passes the patient's `response_action`). The tool descriptions teach this, so a capable agent drives the loop correctly.
18
-
19
- ---
20
-
21
- ## Option A — Local (stdio via `npx`) · recommended
22
-
23
- No hosting, no URL. The client launches the server as a subprocess with your key in its environment.
24
-
25
- ### Claude Desktop
26
-
27
- `claude_desktop_config.json` (Settings → Developer → Edit Config):
28
-
29
- ```json
30
- {
31
- "mcpServers": {
32
- "uphealth": {
33
- "command": "npx",
34
- "args": ["-y", "@uphealth/mcp-server"],
35
- "env": { "UPHEALTH_API_KEY": "up_sandbox_YOUR_KEY" }
36
- }
37
- }
38
- }
39
- ```
40
-
41
- ### Cursor
42
-
43
- `~/.cursor/mcp.json` (or a project's `.cursor/mcp.json`):
44
-
45
- ```json
46
- {
47
- "mcpServers": {
48
- "uphealth": {
49
- "command": "npx",
50
- "args": ["-y", "@uphealth/mcp-server"],
51
- "env": { "UPHEALTH_API_KEY": "up_sandbox_YOUR_KEY" }
52
- }
53
- }
54
- }
55
- ```
56
-
57
- ### VS Code (Copilot agent mode)
58
-
59
- `.vscode/mcp.json`:
60
-
61
- ```json
62
- {
63
- "servers": {
64
- "uphealth": {
65
- "command": "npx",
66
- "args": ["-y", "@uphealth/mcp-server"],
67
- "env": { "UPHEALTH_API_KEY": "up_sandbox_YOUR_KEY" }
68
- }
69
- }
70
- }
71
- ```
72
-
73
- ### Claude Code (CLI)
74
-
75
- ```bash
76
- claude mcp add uphealth --env UPHEALTH_API_KEY=up_sandbox_YOUR_KEY -- npx -y @uphealth/mcp-server
77
- ```
78
-
79
- Any other stdio MCP client uses the same shape: command `npx`, args `["-y", "@uphealth/mcp-server"]`, env `UPHEALTH_API_KEY`.
80
-
81
- ---
82
-
83
- ## Option B — Remote (hosted Streamable HTTP)
84
-
85
- The server is also hosted at `https://mcp.uphealth.us/mcp`. Clients with native remote-MCP support add it directly with an `Authorization: Bearer` header. For clients that only speak stdio, bridge with `mcp-remote`:
86
-
87
- ```json
88
- {
89
- "mcpServers": {
90
- "uphealth": {
91
- "command": "npx",
92
- "args": [
93
- "-y", "mcp-remote", "https://mcp.uphealth.us/mcp",
94
- "--header", "Authorization: Bearer up_sandbox_YOUR_KEY"
95
- ]
96
- }
97
- }
98
- }
99
- ```
100
-
101
- ---
102
-
103
- ## Verify
104
-
105
- Use the MCP Inspector against either transport:
106
-
107
- ```bash
108
- # local stdio
109
- UPHEALTH_API_KEY=up_sandbox_YOUR_KEY npx @modelcontextprotocol/inspector npx -y @uphealth/mcp-server
110
-
111
- # hosted
112
- npx @modelcontextprotocol/inspector --transport streamable-http \
113
- --url https://mcp.uphealth.us/mcp \
114
- --header "Authorization: Bearer up_sandbox_YOUR_KEY"
115
- ```
116
-
117
- Then call `create_patient_stream` with `template_id: "general_wellness_daily"`, and `get_next_cued_message` with a `response_action` (e.g. `did_it`).
118
-
119
- ## Notes
120
-
121
- - **Keep your key private.** Treat `UPHEALTH_API_KEY` like any secret; don't commit client configs containing a live key.
122
- - **Display mode only** in the sandbox — no PHI, no BAA. Deliver mode is BAA-gated at the PMPM tier.
123
- - **Discovery quota:** 50 cues / calendar month. Over the cap, tools return the `over_quota` result with an upgrade link.
124
-
125
- ## Links
126
-
127
- - Docs: https://uphealth.us/docs
128
- - OpenAPI: https://uphealth.us/openapi/signal-v1.yaml
129
- - SDKs: [`@uphealth/signal`](../sdks/typescript) (Node/TS) · [`uphealth-signal`](../sdks/python) (Python)
130
- - Get a key: https://uphealth.us/signup