Medical Literature MCP Server
README.md
# Medical Literature MCP Server
Zero-hallucination medical literature search across **PubMed, Europe PMC, Semantic Scholar, OpenAlex, and CrossRef**.
Every result is passed through from the source APIs; nothing is generated or inferred.
## Quick Start
Requires Node.js 18+ and git. In a terminal (macOS, Linux, or Windows PowerShell):
```bash
git clone https://github.com/uglobetrotter/verified-medical-literature-mcp.git
cd verified-medical-literature-mcp
npm install
claude mcp add medical-literature -s user -- node "$PWD/dist/index.js"
```
`npm install` also builds `dist/`. Keep the clone where it is; Claude Code starts the server from that path. In Windows `cmd.exe` use `%CD%\dist\index.js` instead of `$PWD/dist/index.js`. CI runs these steps on Linux, macOS and Windows with Node 18 and 22. Update later with `git pull` and `npm install`.
The companion Claude Code plugin [clinical-manuscript-gates](https://github.com/uglobetrotter/clinical-manuscript-gates) calls these tools under the server name `medical-literature`; keep that name.
`node tests/acceptance.mjs` runs the acceptance tests (network mocked) and `node tests/smoke.mjs node dist/index.js` starts the server and lists its tools.
A one-line `npx --package=github:uglobetrotter/verified-medical-literature-mcp medical-literature-mcp` install works on some machines but failed in CI under npm 10 ("GitFetcher requires an Arborist constructor"); use the clone until that is resolved.
## Claude Desktop Configuration
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
```json
{
"mcpServers": {
"medical-literature": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/medical-literature-mcp/dist/index.js"],
"env": {
"NCBI_API_KEY": "YOUR_NCBI_KEY_HERE",
"SEMANTIC_SCHOLAR_API_KEY": "YOUR_S2_KEY_HERE",
"CONTACT_EMAIL": "your@email.com"
}
}
}
}
```
## API Keys (Optional but Recommended)
| Key | Where to get | Effect |
|-----|-------------|--------|
| `NCBI_API_KEY` | https://www.ncbi.nlm.nih.gov/account/ | PubMed rate limit: 3 → 10 req/s |
| `SEMANTIC_SCHOLAR_API_KEY` | https://www.semanticscholar.org/product/api | S2 rate limit: 1 → 100 req/s |
| `CONTACT_EMAIL` | Your email | CrossRef + OpenAlex polite pool |
| `SCOPUS_API_KEY` | https://dev.elsevier.com/ | Required by `scopus_search` |
| `SCOPUS_INSTTOKEN` | Institution / Elsevier | Optional; sent with the key when set |
| `WOS_API_KEY` | https://developer.clarivate.com/apis/wos-starter | Required by `wos_search` |
## Available Tools
| Tool | Description |
|------|-------------|
| `pubmed_search` | PubMed/MEDLINE with MeSH, date range, publication type, author and journal filters, relevance or date order; reports total hits, PubMed's query translation and warnings |
| `pubmed_fetch_by_pmid` | Fetch full metadata + abstracts by PMID |
| `europe_pmc_search` | Europe PMC (PubMed + preprints + guidelines) |
| `semantic_scholar_search` | Semantic/AI-powered search + citation counts |
| `openalex_search` | 200M+ works, open-access detection |
| `scopus_search` | Scopus query syntax, year range, sort by relevance, date or citations. First author only, no abstract (the `COMPLETE` view returned HTTP 401 on the tested key). Not part of `multi_database_search` |
| `wos_search` | Web of Science Core Collection (Starter API) with field tags, year range, sort by relevance, year or citations. No abstract; the free plan omits citation counts and allows 50 requests/day. Not part of `multi_database_search` |
| `crossref_search` | DOI-verified bibliographic search |
| `resolve_doi` | Resolve a DOI to verified CrossRef metadata |
| `trace_citations` | Forward/backward citation tracing via Semantic Scholar |
| `multi_database_search` | All databases simultaneously, deduplicated |
| `retraction_status` | Retraction / withdrawal / expression of concern / correction notices from CrossRef (incl. Retraction Watch data) and PubMed; each source reported CHECKED or NOT RUN |
| `claim_context` | Passages of the cited article (Europe PMC OA full text, else PubMed abstract) that match a claim, each shown with its section heading and neighbouring paragraphs (or the whole section); lists claim numbers absent from the source. The caller must then give SUPPORTS / PARTIAL / CONTRADICTS / NOT FOUND with a quoted sentence, labelled ABSTRACT-ONLY when only the abstract was available. |
| `get_full_text` | Open-access full text paragraph by paragraph with section headings; section filter and character cap |
| `convert_ids` | PMID ↔ PMCID ↔ DOI via Europe PMC |
| `export_citation` | BibTeX / RIS / CSL-JSON from doi.org content negotiation (registry metadata verbatim) |
| `pubmed_cited_by` | PubMed records citing a PMID (NCBI elink `pubmed_pubmed_citedin`, built from PMC reference lists, so it under-counts) |
| `pubmed_references` | A PMID's reference list as PubMed records (NCBI elink `pubmed_pubmed_refs`, where deposited) |
| `pubmed_similar` | PubMed "Similar articles", ordered by NCBI's relatedness score |
| `pubmed_recent` | Newest PubMed records for a topic within the last N days (recency, not attention) |
| `verify_bibliography` | Every BibTeX entry: identifier resolves, title/year/journal match, retraction status → PASS/WARN/FAIL with counts |
## Test with MCP Inspector
```bash
npm run inspector
```
## Project Integration
Copy `SKILL.md` into your Claude Project as a Knowledge document. Claude will use it as the operating protocol for all literature searches.
## Licence
MIT, see [LICENSE](LICENSE). Each database's own terms of use apply to the data it returns.