Skip to content
Alpha: see what works today →
Menu

cascade-mcp, the MCP server

This page is the package's README with each tool's row read from the server's own tool definitions. The package is packages/mcp.

An MCP server on stdio over a folder of Cascade pods, for Claude Desktop, VS Code or any MCP client to start. It offers the tools of cascade-runtime/tools: those that read, to every client, and those that propose a write (propose_entry, propose_judgment, propose_retraction) only to a client that declares at initialisation that it can show the person a question (MCP elicitation). Each call to one of those asks the person, and writes only if they say yes to that call: a no, a dismissed question or no answer writes nothing. A write the person said yes to records that a model proposed it and that the person said yes. It never opens an encrypted pod.

Install it with the cascade-runtime tarball of the same build, both in one npm install (cascade-mcp names the runtime by that build's version, which no registry holds), then run it in that folder:

npm install <cascade-runtime tarball> <cascade-mcp tarball>
npx --no-install cascade-mcp --pods <folder>

--no-install keeps npx from fetching whatever npm's registry calls cascade-mcp.

<folder> holds the pods, one folder each, as an app keeps them (pods/ in a starter app). The reference tables the folder holds (.tables/) are used as they are; --check-tables checks their feeds for newer tables, a network call, when the first pod opens, and turns on reference_table_checks.

The tools

Each tool answers in one block of JSON text. A call whose input the rules refuse fails with an error that says why, and any other failure with a fixed message and the reason in the server's log. A proposal the pod's rules refuse is an answer, not an error: { written: false, refused }, with the reason.

list_pods

The names of the pods there are.

Offered to
every client; it only reads
Inputs
None.

find_changes

What changed in a person's lab results after a medication started or stopped, strongest first: a medication with no start of use is placed on the day its prescription was written, and each finding says which date it used. States what changed, never why.

Offered to
every client; it only reads
Inputs
  • pod string, required: The pod's name, one of those list_pods gives.
  • medication string, optional: An RxNorm code (bare or an IRI) or the medication's name.
  • test string, optional: A LOINC code, bare or an IRI.
  • limit integer, at least 1, at most 20, optional: At most this many findings; 5 if left out.

finding_rows

The lab rows behind a finding, by the key find_changes gave it.

Offered to
every client; it only reads
Inputs
  • pod string, required: The pod's name, one of those list_pods gives.
  • key string, required: A finding's key.

lab_series

One test's results over time: day, number and unit, with what was left out counted.

Offered to
every client; it only reads
Inputs
  • pod string, required: The pod's name, one of those list_pods gives.
  • test string, required: A LOINC code, bare or an IRI.

timeline

Each medication with the day its use started, the day its prescription was written and the day it ended, each where the pod states it, placed by its start, else by the day it was written.

Offered to
every client; it only reads
Inputs
  • pod string, required: The pod's name, one of those list_pods gives.

ask

A pod's records by the name of a question, as rows, each naming its entry and the records, documents and hospitals it came from: its allergies with their reactions and severity, conditions (active, or all with each ruled out or resolved one and when it ended), medications (active, or all with when each started and stopped) with each source's own status, lab results with their flags and reference ranges, immunizations, procedures, the text a source wrote for a lab result, procedure or medication, genetic variants, the person it is about with each source's date of birth, gender and death, where an entry came from, or which entries need review and why. With format compact and no question, the whole pod in one read, a page of at most 24000 characters at a time: pod/My active allergies, pod/My condition history, pod/My medication history, pod/My lab results, pod/My immunizations, pod/My procedures, pod/My genetic variants, pod/My reports, notes and documents, pod/The person this pod is about, entry/What needs review, each view's rows tab-separated with its count, each entry by a short handle that can be cited as its entry, each source by a short name its legend explains. It leaves out pod/My active conditions and pod/My active medications, whose entries are all in the history beside them, and when each record arrived; entry/Where it came from with entries gives an entry's records and documents. A record the pod leaves out of every view (entered in error at its source, an allergy its source refutes, a record about no one known to be the person, or one a judgment sets aside) is in no question's answer.

Offered to
every client; it only reads
Inputs
  • pod string, required: The pod's name, one of those list_pods gives.
  • question string, one of pod/My active allergies, pod/My active conditions, pod/My condition history, pod/My active medications, pod/My medication history, pod/My lab results, pod/My immunizations, pod/My procedures, pod/My genetic variants, pod/My reports, notes and documents, pod/The person this pod is about, entry/Where it came from, entry/What needs review, optional: The question's name; with format compact, left out for every view at once.
  • format string, one of rows, compact, optional: rows (the default): the question's rows as JSON; compact: its views' rows as tab-separated text, a page at a time.
  • limit integer, at least 1, at most 500, optional: For rows, at most this many; 50 if left out. The answer says how many there are.
  • offset integer, at least 0, optional: Where the answer starts: for rows, the row; for compact, the row over every view in order, as the last page's next gives it.
  • entries array of string, optional: Only these entries' rows: each an entry's IRI or its handle.

reference_table_checks

What the pod's records and the reference tables say together, as rows naming their entries and the table row each cites: each variant report that differs from ClinVar's classification today, and each pair of active medications in two entries whose codes share an ingredient. Each check says whether a series it reads (ClinVar, product ingredients) is held and which versions; held false means nothing was checked. With held true, notChecked lists the entries it could not check and why (a variant ClinVar has no row for or whose gene it does not cover, a medication with no code or none an ingredients row maps); an entry in neither rows nor notChecked was checked and nothing found. Without the tables (cascade-mcp started without --check-tables) it says they are off and gives no rows.

Offered to
every client; it only reads
Inputs
  • pod string, required: The pod's name, one of those list_pods gives.

propose_entry

Proposes adding an entry to a pod: one or more records the person has told you of, as Turtle. Each draft is <urn:cascade:output-0>, <urn:cascade:output-1> and so on, typed with its class (for example cascade:ProblemOrDiagnosis or cascade:AllergyOrIntolerance), and has a version <urn:cascade:output-0-version> that is a prov:specializationOf it and states what is entered (cascade:conditionName, cascade:clinicalStatus, cascade:allergenName and so on) and cascade:patient, the person the pod is about. It asks the person, through the client, to say yes to this one call, and writes nothing without it: the answer is { written: true, id }, or { written: false, said } when they said no, dismissed the question or left it unanswered, or { written: false, refused } when the pod's rules refuse it. The pod records that you proposed it and that the person said yes, so give no author, session or time.

Offered to
only a client that declares it can show the person a question; it needs the person's yes to each call, and a no, a dismissed question or no answer writes nothing
Inputs
  • pod string, required: The pod's name, one of those list_pods gives.
  • turtle string, required: The entry's drafts and their versions, as Turtle with its prefixes declared.

propose_judgment

Proposes a judgment of records the pod holds, in the person's name: that records are the same thing, different things, or entered in error. A record is named by its IRI, as ask's rows give it (a row names its entry, and entry/Where it came from gives its records). It asks the person, through the client, to say yes to this one call, and writes nothing without it: the answer is { written: true, id }, or { written: false, said } when they said no, dismissed the question or left it unanswered, or { written: false, refused } when the pod's rules refuse it. The pod records that you proposed it and that the person said yes, so give no author, session or time.

Offered to
only a client that declares it can show the person a question; it needs the person's yes to each call, and a no, a dismissed question or no answer writes nothing
Inputs
  • pod string, required: The pod's name, one of those list_pods gives.
  • verdict string, one of same, different, erroneous, required: same: the records are one thing; different: they are not, although they may look alike; erroneous: the record was entered in error.
  • members array of string, required: The records' IRIs: at least two for same and different, one for erroneous.

propose_retraction

Proposes retracting a judgment of the person's, which sets aside what it said. The judgment is named by its IRI. It asks the person, through the client, to say yes to this one call, and writes nothing without it: the answer is { written: true, id }, or { written: false, said } when they said no, dismissed the question or left it unanswered, or { written: false, refused } when the pod's rules refuse it. The pod records that you proposed it and that the person said yes, so give no author, session or time.

Offered to
only a client that declares it can show the person a question; it needs the person's yes to each call, and a no, a dismissed question or no answer writes nothing
Inputs
  • pod string, required: The pod's name, one of those list_pods gives.
  • judgment string, required: The IRI of the judgment to retract.

Every row names the entry it is about, so an answer can cite it.

A hosted client sends what the tools return to its provider

A pod made from a person's own records is theirs to decide about: use a model that runs on their machine, or leave that pod out.

Claude Desktop. Open Settings, Developer, Edit Config, and add the server to claude_desktop_config.json, with the absolute paths of the folder cascade-mcp is installed in and of the pods (forward slashes work on Windows too), then quit Claude Desktop and start it again:

{
  "mcpServers": {
    "cascade": {
      "command": "node",
      "args": [
        "C:/path/to/installed/node_modules/cascade-mcp/dist/src/cli.js",
        "--pods",
        "C:/path/to/pods"
      ]
    }
  }
}