molecule-mcp 0.1.1__tar.gz
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.
- molecule_mcp-0.1.1/LICENSE +209 -0
- molecule_mcp-0.1.1/PKG-INFO +151 -0
- molecule_mcp-0.1.1/README.md +137 -0
- molecule_mcp-0.1.1/pyproject.toml +38 -0
- molecule_mcp-0.1.1/pyproject.toml.orig +35 -0
- molecule_mcp-0.1.1/server.json +87 -0
- molecule_mcp-0.1.1/smithery.yaml +34 -0
- molecule_mcp-0.1.1/src/molecule_mcp/__init__.py +30 -0
- molecule_mcp-0.1.1/src/molecule_mcp/__main__.py +3 -0
- molecule_mcp-0.1.1/src/molecule_mcp/cli.py +219 -0
- molecule_mcp-0.1.1/src/molecule_mcp/doctor.py +90 -0
- molecule_mcp-0.1.1/src/molecule_mcp/integrity.py +299 -0
- molecule_mcp-0.1.1/src/molecule_mcp/purple.py +58 -0
- molecule_mcp-0.1.1/src/molecule_mcp/py.typed +0 -0
- molecule_mcp-0.1.1/src/molecule_mcp/remote.py +134 -0
- molecule_mcp-0.1.1/src/molecule_mcp/server.py +638 -0
- molecule_mcp-0.1.1/src/molecule_mcp/snapshot.py +226 -0
- molecule_mcp-0.1.1/src/molecule_mcp/transfer.py +255 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
203
|
+
|
|
204
|
+
Snapshot data terms
|
|
205
|
+
|
|
206
|
+
This Apache License applies to the distributed molecule-mcp client SDK, including the
|
|
207
|
+
stdio relay and local snapshot reader. The private hosted engine, index generation, and
|
|
208
|
+
service are outside this distribution. Snapshot data and service use are subject to
|
|
209
|
+
the terms at https://moleculelineage.com/data-terms/.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: molecule-mcp
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Molecule Lineage MCP stdio-to-HTTPS bridge, receipt verifier, and air-gapped snapshot reader
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Dist: duckdb>=1.4,<2 ; extra == 'parquet'
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Project-URL: Homepage, https://moleculelineage.com/console/
|
|
10
|
+
Project-URL: Documentation, https://moleculelineage.com/agent-onboarding/SKILL.md
|
|
11
|
+
Project-URL: Repository, https://github.com/writtenonwater99/molecule-lineage-public
|
|
12
|
+
Provides-Extra: parquet
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# molecule-mcp
|
|
16
|
+
|
|
17
|
+
<!-- mcp-name: com.moleculelineage/molecule -->
|
|
18
|
+
|
|
19
|
+
Query US drug records from published FDA, CMS, VA, and NLM files, cited to exact file and row (`source@edition/file:row`), with deterministic server-signed receipts (`mlin_rcpt_v1...`).
|
|
20
|
+
|
|
21
|
+
## Primary connection: Direct Streamable HTTP (zero install)
|
|
22
|
+
|
|
23
|
+
Connect directly to the stateless HTTPS endpoint with no local package required:
|
|
24
|
+
|
|
25
|
+
- **Endpoint:** `https://moleculelineage.com/api/mcp` (`POST` JSON-RPC 2.0; `GET` returns discovery JSON)
|
|
26
|
+
- **Server card:** `https://moleculelineage.com/api/mcp/server-card`
|
|
27
|
+
- **Tool guide & schemas:** `https://moleculelineage.com/agent-onboarding/SKILL.md`
|
|
28
|
+
- **Interactive playground & receipt checker:** [Molecule Console](https://moleculelineage.com/console/#playground)
|
|
29
|
+
|
|
30
|
+
Standard `.mcp.json` (`mcpServers` HTTP transport):
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"molecule": {
|
|
36
|
+
"type": "http",
|
|
37
|
+
"url": "https://moleculelineage.com/api/mcp"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Workspace `servers` JSON:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"servers": {
|
|
48
|
+
"molecule": {
|
|
49
|
+
"type": "http",
|
|
50
|
+
"url": "https://moleculelineage.com/api/mcp"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
TOML (`config.toml`):
|
|
57
|
+
|
|
58
|
+
```toml
|
|
59
|
+
[mcp_servers.molecule]
|
|
60
|
+
url = "https://moleculelineage.com/api/mcp"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Direct `curl` check (keyless):
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
curl -fsS https://moleculelineage.com/api/mcp \
|
|
67
|
+
-H "Content-Type: application/json" \
|
|
68
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"resolve_ndc","arguments":{"ndc":"00003-0894-21"}}}'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
For commercial access, attach `Authorization: Bearer mlin_lic_v1...` to each `POST`.
|
|
72
|
+
|
|
73
|
+
## Optional stdio-to-HTTPS bridge (`molecule-mcp`)
|
|
74
|
+
|
|
75
|
+
For MCP clients that only launch a local stdio process, install [uv](https://docs.astral.sh/uv/getting-started/installation/) and run `molecule-mcp` (or `molecule-mcp serve`). With zero local snapshot configured, `molecule-mcp` acts as a zero-dependency stdio-to-HTTPS bridge to `https://moleculelineage.com/api/mcp`, sending `User-Agent: molecule-client/1.0` and forwarding `MOLECULE_API_KEY` (or `MOLECULE_LICENSE_KEY` / `--api-key`) as `Authorization: Bearer ...` when set.
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"molecule": {
|
|
81
|
+
"command": "uvx",
|
|
82
|
+
"args": ["molecule-mcp"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`molecule-mcp serve --remote https://your-host.example/api/mcp` targets an alternate HTTPS endpoint.
|
|
89
|
+
|
|
90
|
+
## Live `/api/mcp` tools
|
|
91
|
+
|
|
92
|
+
| Tool | Access | Description |
|
|
93
|
+
| --- | --- | --- |
|
|
94
|
+
| `find_drug(query, limit?)` | Keyless (`5,000`-NDC starter subset; full catalog with key) | Search FDA ingredient and label (brand) names. Returns matching federal ingredient names with file-and-row citations. |
|
|
95
|
+
| `resolve_ndc(ndc)` | Keyless (`5,000`-NDC starter subset; full catalog with key) | Resolve a US package NDC (hyphenated 10-digit or 11-digit, always a string) to its FDA NDC Directory listing: package name, application number, and file-and-row citations. |
|
|
96
|
+
| `get_price_benchmark(ndc)` | Commercial (`data_feed` or `audit_advisor`) | Get the CMS retail NADAC per-unit benchmark for an NDC in the edition served, with citations. A pharmacy acquisition cost survey, not a patient price. |
|
|
97
|
+
| `get_equivalents(ndc)` | Commercial (`data_feed` or `audit_advisor`) | List the FDA Orange Book A-rated therapeutic equivalence entries for the product behind an NDC, with TE codes and citations. |
|
|
98
|
+
| `diagnose_ndc_cohort(ndcs, profile?)` | Commercial (`data_feed` or `audit_advisor`) | Assess question fit and benchmark availability for up to 12 de-identified NDCs in the edition served (NADAC match, VA FSS only, active FDA shortage, ambiguous 10-digit NDC). Profiles: `strict_federal@1` (default) and `amplified_discovery@1`. |
|
|
99
|
+
| `verify_receipt(receipt, payload?)` | Keyless (any Molecule receipt) | Check the cryptographic signature on a Molecule outcome receipt (`mlin_rcpt_v1...`) and, when `payload` is provided, confirm that its canonical SHA-256 digest matches the receipt. |
|
|
100
|
+
|
|
101
|
+
Pass NDCs as strings to preserve leading zeros. An unhyphenated 10-digit NDC can map to multiple 11-digit forms (`ambiguous_ndc10: true`); supply the hyphenated package code rather than guessing.
|
|
102
|
+
|
|
103
|
+
In keyless mode (`30` requests/minute per IP), `find_drug` and `resolve_ndc` search a `5,000`-NDC small-molecule starter subset (excluding FDA Purple Book biologics). A zero-hit response carries `index_scope: "starter_subset_5000_ndc"` and `scope_note` so callers never mistake a subset miss for a nonexistent drug.
|
|
104
|
+
|
|
105
|
+
## Catalog scope and plans (USD)
|
|
106
|
+
|
|
107
|
+
| Plan | Price | `/api/mcp` commercial tools | Scope |
|
|
108
|
+
| --- | --- | --- | --- |
|
|
109
|
+
| Keyless Lookup & Starter API | `$0` | No (`find_drug`, `resolve_ndc` starter subset + `verify_receipt`) | `83,000+` cited pages, eligible table CSVs, `500`-NDC audit sample, `25`-family screener preview, and keyless starter API (`30` req/min). |
|
|
110
|
+
| [Screener Pro](https://moleculelineage.com/screener/) | `$79/month` | No | Interactive cross-catalog screener, threshold filters, watchlists, and CSV export across `11,300+` exportable small-molecule versions plus view-only biologic browsing. |
|
|
111
|
+
| [Single Audit Pass](https://moleculelineage.com/audit/) | `$299` one-time (`30` days) | No | Single employer plan evaluation across `46,500+` NDCs, `850,000+` dated CMS NADAC intervals, and `1,150+` 12-quarter Part B J-code ASP rates, with cited CSV export and paginated Board PDF. |
|
|
112
|
+
| [Commercial Data Feed](https://moleculelineage.com/data/) | `$299/month` | Yes (all 6 tools) | Full-catalog signed `/api/mcp` lookups plus `38` zstd Parquet views, `2,500+` dated ingredient JSON documents, and `SHA256SUMS` manifests. |
|
|
113
|
+
| [Advisor Unlimited](https://moleculelineage.com/audit/) | `$599/month` | Yes (all 6 tools) | Multi-client advisory practice — unlimited client evaluations and white-label paginated Board PDFs across `46,500+` NDCs, plus all six signed `/api/mcp` tools. |
|
|
114
|
+
|
|
115
|
+
FDA Purple Book biologic rows are view-only on web pages and excluded from `/api/mcp` and bulk Parquet/API exports pending FDA reuse confirmation.
|
|
116
|
+
|
|
117
|
+
## Deterministic `mlin_rcpt_v1` receipt checking
|
|
118
|
+
|
|
119
|
+
Every `/api/mcp` response returns a deterministic `mlin_rcpt_v1.<digest>.<signature>` receipt covering `receipt_meta` (`tool`, `arguments`, `release_id`), the answer body, and any `commitment_hmac` inside the JSON, while leaving `receipt` and top-level `issued_at` outside the digest. Identical calls against the same release return byte-identical receipts.
|
|
120
|
+
|
|
121
|
+
Check canonical digest binding locally from the CLI or Python, or call keyless `verify_receipt(receipt, payload)` on `/api/mcp` to check both the digest and the server's HMAC signature:
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
molecule-mcp verify-receipt "mlin_rcpt_v1.<digest>.<signature>" --payload response.json
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
from molecule_mcp import verify_receipt
|
|
129
|
+
|
|
130
|
+
outcome = verify_receipt(response["receipt"], response)
|
|
131
|
+
assert outcome["digest_verified"] is True
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Air-gapped Commercial Data Feed snapshots
|
|
135
|
+
|
|
136
|
+
Commercial Data Feed subscribers (`$299/month`) can mirror checksummed Parquet views and ingredient JSON documents on a connected host, then serve them offline with `--snapshot-dir` (alias: `--api-dir`, or `MOLECULE_SNAPSHOT_DIR` / `MOLECULE_MCP_API_DIR`):
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
export MOLECULE_API_KEY="mlin_lic_v1..."
|
|
140
|
+
uvx molecule-mcp sync-commercial --dest ./snapshot
|
|
141
|
+
uvx molecule-mcp doctor --snapshot-dir ./snapshot
|
|
142
|
+
uvx --from 'molecule-mcp[parquet]' molecule-mcp serve --snapshot-dir ./snapshot
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The retired static starter tarball (`/data/molecule-mcp-starter.tar.gz`) is no longer distributed; use the keyless HTTPS endpoint (`molecule-mcp` or `https://moleculelineage.com/api/mcp`) for zero-install starter lookups.
|
|
146
|
+
|
|
147
|
+
Offline snapshot mode exposes `find_drug`, `resolve_ndc`, `get_equivalents`, `get_price(ndc, as_of?)`, `get_changes(id, since, until?)`, and `cite_fact(fact_table, fact_id)`. To opt into offline BLA lookups using your own local FDA Purple Book CSV, pass `--purple-csv /path/to/local.csv` alongside `--snapshot-dir`.
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
Apache-2.0 covers this client package (stdio-to-HTTPS bridge, receipt helper, and air-gapped snapshot reader). The hosted service runs the private engine and returns cited outcomes with signed receipts. [Data and service terms](https://moleculelineage.com/data-terms/)
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# molecule-mcp
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: com.moleculelineage/molecule -->
|
|
4
|
+
|
|
5
|
+
Query US drug records from published FDA, CMS, VA, and NLM files, cited to exact file and row (`source@edition/file:row`), with deterministic server-signed receipts (`mlin_rcpt_v1...`).
|
|
6
|
+
|
|
7
|
+
## Primary connection: Direct Streamable HTTP (zero install)
|
|
8
|
+
|
|
9
|
+
Connect directly to the stateless HTTPS endpoint with no local package required:
|
|
10
|
+
|
|
11
|
+
- **Endpoint:** `https://moleculelineage.com/api/mcp` (`POST` JSON-RPC 2.0; `GET` returns discovery JSON)
|
|
12
|
+
- **Server card:** `https://moleculelineage.com/api/mcp/server-card`
|
|
13
|
+
- **Tool guide & schemas:** `https://moleculelineage.com/agent-onboarding/SKILL.md`
|
|
14
|
+
- **Interactive playground & receipt checker:** [Molecule Console](https://moleculelineage.com/console/#playground)
|
|
15
|
+
|
|
16
|
+
Standard `.mcp.json` (`mcpServers` HTTP transport):
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"mcpServers": {
|
|
21
|
+
"molecule": {
|
|
22
|
+
"type": "http",
|
|
23
|
+
"url": "https://moleculelineage.com/api/mcp"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Workspace `servers` JSON:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"servers": {
|
|
34
|
+
"molecule": {
|
|
35
|
+
"type": "http",
|
|
36
|
+
"url": "https://moleculelineage.com/api/mcp"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
TOML (`config.toml`):
|
|
43
|
+
|
|
44
|
+
```toml
|
|
45
|
+
[mcp_servers.molecule]
|
|
46
|
+
url = "https://moleculelineage.com/api/mcp"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Direct `curl` check (keyless):
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
curl -fsS https://moleculelineage.com/api/mcp \
|
|
53
|
+
-H "Content-Type: application/json" \
|
|
54
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"resolve_ndc","arguments":{"ndc":"00003-0894-21"}}}'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For commercial access, attach `Authorization: Bearer mlin_lic_v1...` to each `POST`.
|
|
58
|
+
|
|
59
|
+
## Optional stdio-to-HTTPS bridge (`molecule-mcp`)
|
|
60
|
+
|
|
61
|
+
For MCP clients that only launch a local stdio process, install [uv](https://docs.astral.sh/uv/getting-started/installation/) and run `molecule-mcp` (or `molecule-mcp serve`). With zero local snapshot configured, `molecule-mcp` acts as a zero-dependency stdio-to-HTTPS bridge to `https://moleculelineage.com/api/mcp`, sending `User-Agent: molecule-client/1.0` and forwarding `MOLECULE_API_KEY` (or `MOLECULE_LICENSE_KEY` / `--api-key`) as `Authorization: Bearer ...` when set.
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"molecule": {
|
|
67
|
+
"command": "uvx",
|
|
68
|
+
"args": ["molecule-mcp"]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`molecule-mcp serve --remote https://your-host.example/api/mcp` targets an alternate HTTPS endpoint.
|
|
75
|
+
|
|
76
|
+
## Live `/api/mcp` tools
|
|
77
|
+
|
|
78
|
+
| Tool | Access | Description |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `find_drug(query, limit?)` | Keyless (`5,000`-NDC starter subset; full catalog with key) | Search FDA ingredient and label (brand) names. Returns matching federal ingredient names with file-and-row citations. |
|
|
81
|
+
| `resolve_ndc(ndc)` | Keyless (`5,000`-NDC starter subset; full catalog with key) | Resolve a US package NDC (hyphenated 10-digit or 11-digit, always a string) to its FDA NDC Directory listing: package name, application number, and file-and-row citations. |
|
|
82
|
+
| `get_price_benchmark(ndc)` | Commercial (`data_feed` or `audit_advisor`) | Get the CMS retail NADAC per-unit benchmark for an NDC in the edition served, with citations. A pharmacy acquisition cost survey, not a patient price. |
|
|
83
|
+
| `get_equivalents(ndc)` | Commercial (`data_feed` or `audit_advisor`) | List the FDA Orange Book A-rated therapeutic equivalence entries for the product behind an NDC, with TE codes and citations. |
|
|
84
|
+
| `diagnose_ndc_cohort(ndcs, profile?)` | Commercial (`data_feed` or `audit_advisor`) | Assess question fit and benchmark availability for up to 12 de-identified NDCs in the edition served (NADAC match, VA FSS only, active FDA shortage, ambiguous 10-digit NDC). Profiles: `strict_federal@1` (default) and `amplified_discovery@1`. |
|
|
85
|
+
| `verify_receipt(receipt, payload?)` | Keyless (any Molecule receipt) | Check the cryptographic signature on a Molecule outcome receipt (`mlin_rcpt_v1...`) and, when `payload` is provided, confirm that its canonical SHA-256 digest matches the receipt. |
|
|
86
|
+
|
|
87
|
+
Pass NDCs as strings to preserve leading zeros. An unhyphenated 10-digit NDC can map to multiple 11-digit forms (`ambiguous_ndc10: true`); supply the hyphenated package code rather than guessing.
|
|
88
|
+
|
|
89
|
+
In keyless mode (`30` requests/minute per IP), `find_drug` and `resolve_ndc` search a `5,000`-NDC small-molecule starter subset (excluding FDA Purple Book biologics). A zero-hit response carries `index_scope: "starter_subset_5000_ndc"` and `scope_note` so callers never mistake a subset miss for a nonexistent drug.
|
|
90
|
+
|
|
91
|
+
## Catalog scope and plans (USD)
|
|
92
|
+
|
|
93
|
+
| Plan | Price | `/api/mcp` commercial tools | Scope |
|
|
94
|
+
| --- | --- | --- | --- |
|
|
95
|
+
| Keyless Lookup & Starter API | `$0` | No (`find_drug`, `resolve_ndc` starter subset + `verify_receipt`) | `83,000+` cited pages, eligible table CSVs, `500`-NDC audit sample, `25`-family screener preview, and keyless starter API (`30` req/min). |
|
|
96
|
+
| [Screener Pro](https://moleculelineage.com/screener/) | `$79/month` | No | Interactive cross-catalog screener, threshold filters, watchlists, and CSV export across `11,300+` exportable small-molecule versions plus view-only biologic browsing. |
|
|
97
|
+
| [Single Audit Pass](https://moleculelineage.com/audit/) | `$299` one-time (`30` days) | No | Single employer plan evaluation across `46,500+` NDCs, `850,000+` dated CMS NADAC intervals, and `1,150+` 12-quarter Part B J-code ASP rates, with cited CSV export and paginated Board PDF. |
|
|
98
|
+
| [Commercial Data Feed](https://moleculelineage.com/data/) | `$299/month` | Yes (all 6 tools) | Full-catalog signed `/api/mcp` lookups plus `38` zstd Parquet views, `2,500+` dated ingredient JSON documents, and `SHA256SUMS` manifests. |
|
|
99
|
+
| [Advisor Unlimited](https://moleculelineage.com/audit/) | `$599/month` | Yes (all 6 tools) | Multi-client advisory practice — unlimited client evaluations and white-label paginated Board PDFs across `46,500+` NDCs, plus all six signed `/api/mcp` tools. |
|
|
100
|
+
|
|
101
|
+
FDA Purple Book biologic rows are view-only on web pages and excluded from `/api/mcp` and bulk Parquet/API exports pending FDA reuse confirmation.
|
|
102
|
+
|
|
103
|
+
## Deterministic `mlin_rcpt_v1` receipt checking
|
|
104
|
+
|
|
105
|
+
Every `/api/mcp` response returns a deterministic `mlin_rcpt_v1.<digest>.<signature>` receipt covering `receipt_meta` (`tool`, `arguments`, `release_id`), the answer body, and any `commitment_hmac` inside the JSON, while leaving `receipt` and top-level `issued_at` outside the digest. Identical calls against the same release return byte-identical receipts.
|
|
106
|
+
|
|
107
|
+
Check canonical digest binding locally from the CLI or Python, or call keyless `verify_receipt(receipt, payload)` on `/api/mcp` to check both the digest and the server's HMAC signature:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
molecule-mcp verify-receipt "mlin_rcpt_v1.<digest>.<signature>" --payload response.json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from molecule_mcp import verify_receipt
|
|
115
|
+
|
|
116
|
+
outcome = verify_receipt(response["receipt"], response)
|
|
117
|
+
assert outcome["digest_verified"] is True
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Air-gapped Commercial Data Feed snapshots
|
|
121
|
+
|
|
122
|
+
Commercial Data Feed subscribers (`$299/month`) can mirror checksummed Parquet views and ingredient JSON documents on a connected host, then serve them offline with `--snapshot-dir` (alias: `--api-dir`, or `MOLECULE_SNAPSHOT_DIR` / `MOLECULE_MCP_API_DIR`):
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
export MOLECULE_API_KEY="mlin_lic_v1..."
|
|
126
|
+
uvx molecule-mcp sync-commercial --dest ./snapshot
|
|
127
|
+
uvx molecule-mcp doctor --snapshot-dir ./snapshot
|
|
128
|
+
uvx --from 'molecule-mcp[parquet]' molecule-mcp serve --snapshot-dir ./snapshot
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The retired static starter tarball (`/data/molecule-mcp-starter.tar.gz`) is no longer distributed; use the keyless HTTPS endpoint (`molecule-mcp` or `https://moleculelineage.com/api/mcp`) for zero-install starter lookups.
|
|
132
|
+
|
|
133
|
+
Offline snapshot mode exposes `find_drug`, `resolve_ndc`, `get_equivalents`, `get_price(ndc, as_of?)`, `get_changes(id, since, until?)`, and `cite_fact(fact_table, fact_id)`. To opt into offline BLA lookups using your own local FDA Purple Book CSV, pass `--purple-csv /path/to/local.csv` alongside `--snapshot-dir`.
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
Apache-2.0 covers this client package (stdio-to-HTTPS bridge, receipt helper, and air-gapped snapshot reader). The hosted service runs the private engine and returns cited outcomes with signed receipts. [Data and service terms](https://moleculelineage.com/data-terms/)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "molecule-mcp"
|
|
3
|
+
version = "0.1.1"
|
|
4
|
+
description = "Molecule Lineage MCP stdio-to-HTTPS bridge, receipt verifier, and air-gapped snapshot reader"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "Apache-2.0"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.12"
|
|
9
|
+
dependencies = []
|
|
10
|
+
|
|
11
|
+
[project.optional-dependencies]
|
|
12
|
+
parquet = ["duckdb>=1.4,<2"]
|
|
13
|
+
|
|
14
|
+
[project.scripts]
|
|
15
|
+
molecule-mcp = "molecule_mcp.cli:main"
|
|
16
|
+
|
|
17
|
+
[project.urls]
|
|
18
|
+
Homepage = "https://moleculelineage.com/console/"
|
|
19
|
+
Documentation = "https://moleculelineage.com/agent-onboarding/SKILL.md"
|
|
20
|
+
Repository = "https://github.com/writtenonwater99/molecule-lineage-public"
|
|
21
|
+
|
|
22
|
+
[build-system]
|
|
23
|
+
requires = ["uv_build>=0.13.8,<0.14"]
|
|
24
|
+
build-backend = "uv_build"
|
|
25
|
+
|
|
26
|
+
[tool.uv.build-backend]
|
|
27
|
+
source-include = [
|
|
28
|
+
"server.json",
|
|
29
|
+
"smithery.yaml",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[tool.pytest.ini_options]
|
|
33
|
+
pythonpath = ["src"]
|
|
34
|
+
testpaths = ["tests"]
|
|
35
|
+
|
|
36
|
+
[tool.ruff]
|
|
37
|
+
line-length = 100
|
|
38
|
+
target-version = "py312"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "molecule-mcp"
|
|
3
|
+
version = "0.1.1"
|
|
4
|
+
description = "Molecule Lineage MCP stdio-to-HTTPS bridge, receipt verifier, and air-gapped snapshot reader"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "Apache-2.0"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.12"
|
|
9
|
+
dependencies = []
|
|
10
|
+
|
|
11
|
+
[project.optional-dependencies]
|
|
12
|
+
parquet = ["duckdb>=1.4,<2"]
|
|
13
|
+
|
|
14
|
+
[project.scripts]
|
|
15
|
+
molecule-mcp = "molecule_mcp.cli:main"
|
|
16
|
+
|
|
17
|
+
[project.urls]
|
|
18
|
+
Homepage = "https://moleculelineage.com/console/"
|
|
19
|
+
Documentation = "https://moleculelineage.com/agent-onboarding/SKILL.md"
|
|
20
|
+
Repository = "https://github.com/writtenonwater99/molecule-lineage-public"
|
|
21
|
+
|
|
22
|
+
[build-system]
|
|
23
|
+
requires = ["uv_build>=0.13.8,<0.14"]
|
|
24
|
+
build-backend = "uv_build"
|
|
25
|
+
|
|
26
|
+
[tool.uv.build-backend]
|
|
27
|
+
source-include = ["server.json", "smithery.yaml"]
|
|
28
|
+
|
|
29
|
+
[tool.pytest.ini_options]
|
|
30
|
+
pythonpath = ["src"]
|
|
31
|
+
testpaths = ["tests"]
|
|
32
|
+
|
|
33
|
+
[tool.ruff]
|
|
34
|
+
line-length = 100
|
|
35
|
+
target-version = "py312"
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "com.moleculelineage/molecule",
|
|
4
|
+
"title": "Molecule Lineage",
|
|
5
|
+
"description": "US drug records from FDA, CMS, VA and NLM files, cited to file and row, with signed receipts.",
|
|
6
|
+
"version": "0.1.1",
|
|
7
|
+
"websiteUrl": "https://moleculelineage.com/agent-onboarding/SKILL.md",
|
|
8
|
+
"icons": [
|
|
9
|
+
{
|
|
10
|
+
"src": "https://moleculelineage.com/favicon.svg",
|
|
11
|
+
"mimeType": "image/svg+xml",
|
|
12
|
+
"sizes": ["any"]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"url": "https://github.com/writtenonwater99/molecule-lineage-public",
|
|
17
|
+
"source": "github",
|
|
18
|
+
"subfolder": "packages/molecule-mcp"
|
|
19
|
+
},
|
|
20
|
+
"remotes": [
|
|
21
|
+
{
|
|
22
|
+
"type": "streamable-http",
|
|
23
|
+
"url": "https://moleculelineage.com/api/mcp",
|
|
24
|
+
"headers": [
|
|
25
|
+
{
|
|
26
|
+
"name": "Authorization",
|
|
27
|
+
"description": "Optional. Bearer mlin_lic_v1... commercial access key. Omit for keyless calls (find_drug, resolve_ndc, verify_receipt).",
|
|
28
|
+
"isRequired": false,
|
|
29
|
+
"isSecret": true
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"packages": [
|
|
35
|
+
{
|
|
36
|
+
"registryType": "pypi",
|
|
37
|
+
"registryBaseUrl": "https://pypi.org",
|
|
38
|
+
"identifier": "molecule-mcp",
|
|
39
|
+
"version": "0.1.1",
|
|
40
|
+
"runtimeHint": "uvx",
|
|
41
|
+
"transport": {
|
|
42
|
+
"type": "stdio"
|
|
43
|
+
},
|
|
44
|
+
"packageArguments": [
|
|
45
|
+
{
|
|
46
|
+
"type": "positional",
|
|
47
|
+
"value": "serve",
|
|
48
|
+
"isRequired": false
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"type": "named",
|
|
52
|
+
"name": "--snapshot-dir",
|
|
53
|
+
"description": "Optional path to an air-gapped Commercial Data Feed Parquet/JSON snapshot installed with molecule-mcp sync-commercial.",
|
|
54
|
+
"format": "filepath",
|
|
55
|
+
"isRequired": false
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "named",
|
|
59
|
+
"name": "--purple-csv",
|
|
60
|
+
"description": "Optional path to your own local FDA Purple Book CSV to enable offline BLA lookups.",
|
|
61
|
+
"format": "filepath",
|
|
62
|
+
"isRequired": false
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"environmentVariables": [
|
|
66
|
+
{
|
|
67
|
+
"name": "MOLECULE_API_KEY",
|
|
68
|
+
"description": "Optional Molecule access key (mlin_lic_v1...) for full-catalog and commercial tools.",
|
|
69
|
+
"isSecret": true,
|
|
70
|
+
"isRequired": false
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "MOLECULE_LICENSE_KEY",
|
|
74
|
+
"description": "Alias for MOLECULE_API_KEY.",
|
|
75
|
+
"isSecret": true,
|
|
76
|
+
"isRequired": false
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "MOLECULE_SNAPSHOT_DIR",
|
|
80
|
+
"description": "Optional air-gapped snapshot directory (alias: MOLECULE_MCP_API_DIR).",
|
|
81
|
+
"format": "filepath",
|
|
82
|
+
"isRequired": false
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|