@pipeworx/mcp-civic 0.1.0
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/LICENSE +21 -0
- package/README.md +154 -0
- package/bin/cli.js +17 -0
- package/package.json +32 -0
- package/server.json +18 -0
- package/src/index.ts +1074 -0
- package/src/server.ts +45 -0
- package/tsconfig.json +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mojibake Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# @pipeworx/civic
|
|
2
|
+
|
|
3
|
+
Expert-curated clinical interpretation of cancer variants from CIViC — which
|
|
4
|
+
somatic alterations are clinically actionable, in which disease, with which
|
|
5
|
+
therapy, and the graded published evidence behind each claim.
|
|
6
|
+
|
|
7
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1679+ live data sources.
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
- `civic_search_genes(query, limit?)` — cancer genes and fusions by name, with
|
|
12
|
+
variant / evidence / assertion counts and the CIViC feature id.
|
|
13
|
+
- `civic_gene_variants(gene, variant_name?, limit?)` — the curated variants of a
|
|
14
|
+
gene, with associated diseases and therapies.
|
|
15
|
+
- `civic_variant_evidence(molecular_profile | variant_id, evidence_type?, disease?, therapy?, limit?)`
|
|
16
|
+
— individual evidence items with type, level A-E, direction, significance,
|
|
17
|
+
1-5 star rating and the PubMed/ASCO source.
|
|
18
|
+
- `civic_assertions(molecular_profile? | disease? | therapy?, limit?)` — the
|
|
19
|
+
AMP/ASCO/CAP-tiered rollups, with FDA companion-test and regulatory-approval
|
|
20
|
+
flags, ACMG codes and NCCN guideline.
|
|
21
|
+
|
|
22
|
+
## Auth
|
|
23
|
+
|
|
24
|
+
Keyless. Public GraphQL endpoint; CIViC's content is CC0.
|
|
25
|
+
|
|
26
|
+
## Data sources
|
|
27
|
+
|
|
28
|
+
- <https://civicdb.org/api/graphql> — POST, `{query, variables}`.
|
|
29
|
+
|
|
30
|
+
Things that will otherwise cost you an afternoon:
|
|
31
|
+
|
|
32
|
+
- **An explicitly null variable is a FILTER, not an absent filter — and it
|
|
33
|
+
returns HTTP 200.** Measured 2026-09-17: `evidenceItems(molecularProfileName:
|
|
34
|
+
"BRAF V600E")` reports 249 matches; adding `variantId: null` reports **0**,
|
|
35
|
+
`diseaseName: null` reports 245, `therapyName: null` reports 313. Unset
|
|
36
|
+
filters must be omitted from the variables map entirely. `omitNulls()` in
|
|
37
|
+
`src/index.ts` exists for exactly this and removing it produces a silent zero.
|
|
38
|
+
- **`browseVariants.totalCount` and `browseFeatures.totalCount` ignore their own
|
|
39
|
+
filter arguments.** `browseVariants(featureName: "BRAF")` and an unfiltered
|
|
40
|
+
`browseVariants` both report 5029, the whole catalogue. `evidenceItems` and
|
|
41
|
+
`assertions` DO filter their totalCount. This pack only reports the count for
|
|
42
|
+
the two that mean it.
|
|
43
|
+
- **`description` on the `BrowseFeature` type 500s the entire query.** It is in
|
|
44
|
+
the schema and it is not callable. The gene summary lives on the `Gene` type,
|
|
45
|
+
which is why `civic_search_genes` makes a second call.
|
|
46
|
+
- **`genes` takes `entrezSymbols`/`entrezIds`, not `name`.** Free-text gene
|
|
47
|
+
search is `browseFeatures(featureName:)` (substring, unranked — this pack
|
|
48
|
+
re-ranks exact matches first) or `featureTypeahead(queryTerm:)`.
|
|
49
|
+
- Evidence and assertion `status` can be `SUBMITTED` as well as `ACCEPTED`;
|
|
50
|
+
a submitted item has not been through CIViC review yet.
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"mcpServers": {
|
|
59
|
+
"civic": {
|
|
60
|
+
"url": "https://gateway.pipeworx.io/civic/mcp"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### What this endpoint actually serves
|
|
67
|
+
|
|
68
|
+
`tools/list` at `https://gateway.pipeworx.io/civic/mcp` returns the tools in the table
|
|
69
|
+
above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
|
|
70
|
+
`discover_tools`, `search_within`, `remember`/`recall` and the rest of the
|
|
71
|
+
gateway-wide set. So the tool count you see is larger than this table: a
|
|
72
|
+
single-pack endpoint currently lists roughly 30 shared tools alongside the
|
|
73
|
+
pack's own. The connection's `initialize` response states its exact scope, and
|
|
74
|
+
is the authoritative answer for a given day.
|
|
75
|
+
|
|
76
|
+
This is deliberate, not multiplexing by accident. The meta-tools are what let a
|
|
77
|
+
scoped connection answer a question this pack does not cover — via
|
|
78
|
+
`ask_pipeworx`, which routes across the whole catalog — without you adding a
|
|
79
|
+
second MCP server. There is currently no way to mount a pack endpoint without
|
|
80
|
+
them; if the extra schemas cost you more context than the routing is worth,
|
|
81
|
+
connect to the full gateway once rather than to several pack endpoints.
|
|
82
|
+
|
|
83
|
+
Or connect to the full Pipeworx gateway to get every pack's tools listed
|
|
84
|
+
directly, instead of just this one's:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"mcpServers": {
|
|
89
|
+
"pipeworx": {
|
|
90
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Both URLs reach the same gateway and the same 1679+ data sources. The
|
|
97
|
+
only difference is which pack's tools are listed **directly**; `ask_pipeworx`
|
|
98
|
+
reaches all of them from either one.
|
|
99
|
+
|
|
100
|
+
## No MCP client? Call it over HTTP
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
curl -X POST https://gateway.pipeworx.io/v1/tools/civic_search_genes \
|
|
104
|
+
-H 'Content-Type: application/json' \
|
|
105
|
+
-d '{"query":"BRAF","limit":5}'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/civic_search_genes`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
|
|
109
|
+
|
|
110
|
+
## Standalone (no gateway account)
|
|
111
|
+
|
|
112
|
+
This package also runs as a local stdio MCP server — no Pipeworx account, no
|
|
113
|
+
gateway round-trip:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"mcpServers": {
|
|
118
|
+
"civic": {
|
|
119
|
+
"command": "npx",
|
|
120
|
+
"args": ["-y", "@pipeworx/mcp-civic"]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Or run it directly to confirm it starts:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npx -y @pipeworx/mcp-civic
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
|
|
133
|
+
for **only** this pack's tools — none of the shared meta-tools the gateway
|
|
134
|
+
connection above adds. Same source, same tools, no ask_pipeworx routing.
|
|
135
|
+
|
|
136
|
+
## Using with ask_pipeworx
|
|
137
|
+
|
|
138
|
+
Instead of calling tools directly, you can ask questions in plain English —
|
|
139
|
+
this works on the pack endpoint above as well as on the full gateway:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
ask_pipeworx({ question: "your question about Civic data" })
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
146
|
+
|
|
147
|
+
## More
|
|
148
|
+
|
|
149
|
+
- [Docs and guides](https://pipeworx.io/docs)
|
|
150
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
//
|
|
3
|
+
// Entry point for `npx @pipeworx/mcp-<slug>`.
|
|
4
|
+
//
|
|
5
|
+
// Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
|
|
6
|
+
// tsx sidesteps every extensionless-import / bare-JSON-import edge case a
|
|
7
|
+
// per-pack tsc build would have to solve one pack at a time). This file
|
|
8
|
+
// registers tsx's ESM loader programmatically, then hands off to src/server.ts,
|
|
9
|
+
// which wraps the pack's {tools, callTool} export in a stdio MCP server.
|
|
10
|
+
//
|
|
11
|
+
// Copied verbatim into every published pack repo by scripts/publish-pack.sh —
|
|
12
|
+
// edit this file, not a per-pack copy.
|
|
13
|
+
import { register } from 'tsx/esm/api';
|
|
14
|
+
|
|
15
|
+
register();
|
|
16
|
+
|
|
17
|
+
await import('../src/server.ts');
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-civic",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CIViC — Clinical Interpretation of Variants in Cancer.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"mcp-civic": "bin/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "civic"],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/pipeworx-io/mcp-civic.git"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"typecheck": "tsc --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
22
|
+
"tsx": "^4.19.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"@cloudflare/workers-types": "^4.20260405.1"
|
|
27
|
+
},
|
|
28
|
+
"pipeworx": {
|
|
29
|
+
"sourceHash": "v1-ad48a207126f5b01153eb26d3decaf8fc1d694495c8c00c5e1589d1b95b7eca8",
|
|
30
|
+
"sourceCommit": "839ab210d969ef7f822cd747ea516f6bb49e9231"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/civic",
|
|
4
|
+
"title": "Civic",
|
|
5
|
+
"description": "CIViC — Clinical Interpretation of Variants in Cancer.",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/civic",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-civic",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/civic/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|