Scrapling MCP Server
Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
D4D4Vinci/Scrapling107k近 7 天新增 1,730 个 star
Search PubMed/Europe PMC, fetch articles and full text (PMC/EPMC/Unpaywall), citations, MeSH terms.
Search PubMed/Europe PMC, fetch articles and full text (PMC/EPMC/Unpaywall), citations, MeSH terms via MCP. STDIO or Streamable HTTP.
Public Hosted Server: https://pubmed.caseyjhand.com/mcp
Biomedical literature from PubMed, PubMed Central, and Europe PMC. Search it, fetch metadata and full text, resolve identifiers and partial citations, format references, and ground queries in MeSH vocabulary. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above. Ships the pubmed-guide agent skill (skill://pubmed-guide/SKILL.md), which MCP clients read for PubMed query syntax, DOI-to-PMID routes outside PMC, reference-list resolution, citation counts, and full-text misses.
| Tool | Description |
|---|---|
pubmed_search_articles | Search PubMed with full query syntax, structured filters, date ranges, and optional summaries |
pubmed_fetch_articles | Fetch article metadata by PMID: abstract, authors, journal, language and original-language title, MeSH terms and indexed substances, databank accessions such as trial registration IDs, grants, a collective author's investigators on request, linked retraction and correction notices |
pubmed_fetch_fulltext | Fetch full text by PMID, PMCID, or DOI, falling back from PMC to Europe PMC to Unpaywall |
pubmed_europepmc_search | Search Europe PMC for preprints, patents, Agricola, and open-access records PubMed doesn't carry |
pubmed_europepmc_fetch | Fetch complete Europe PMC records, including the untruncated abstract, as records: [{ source, epmcId }] |
pubmed_fetch_citation_metrics | Fetch NIH iCite citation metrics by PMID: Relative Citation Ratio, NIH percentile, citation counts and rates |
pubmed_format_citations | Format citations in APA 7th, MLA 9th, BibTeX, RIS, or Vancouver (ICMJE/NLM), with linked retraction and correction notices |
pubmed_find_related | Find similar articles, citing articles, or references for a PMID |
pubmed_spell_check | Correct a misspelled PubMed query via NCBI ESpell |
pubmed_lookup_mesh | Look up MeSH records (descriptors, supplementary concepts, qualifiers, pharmacological actions) with the PubMed clause that searches each, tree numbers, scope notes, and entry terms |
pubmed_lookup_citation | Resolve partial references, up to 25 at a time, to PMIDs via ECitMatch |
pubmed_convert_ids | Convert between DOI, PMID, and PMCID via the PMC ID Converter |
| Resource | Description |
|---|---|
pubmed://database/info | PubMed database metadata via EInfo (field list, record count, last update) |
| Prompt | Description |
|---|---|
research_plan | Generate a structured four-phase biomedical research plan |
pubmed_search_articles toolquery is optional: with an author, journal, MeSH, or publication-type filter, the filters alone make the search (a journal's output over a date range, for example)maxResults: 0 for the match count alone; summaryCount adds briefs for up to 50 hits. A larger page size is served at the cap with a notice naming where to continue; a page that reaches PubMed's 9,999-record window says how many matches no offset can reach and advises narrowing or splitting the query by dateRangetotalCount, the effectiveQuery PubMed ran, and the appliedFilterslanguages (NLM three-letter codes, e.g. ["ger"]), so a result set can be screened by language without fetching the records; a record in another language has NLM's English translation as its title once NLM has indexed it, and its original-language title until thenpubmed_fetch_articles toolunavailablePmids. A PMC ID or DOI in pmids is rejected with the route to pubmed_convert_ids or pubmed_fetch_fulltext; idType is accepted only as "pmid"languages, linked retraction/erratum/comment notices, and links; a record in another language carries its original-language title as vernacularTitle, with title NLM's English translation; MeSH terms and chemicals (the record's indexed substances, each with its MeSH UI and, where NLM assigns one, its registry number) on by default via includeMesh, grants via includeGrants, and the members of a collective author (its InvestigatorList, thousands on some consortium trials) via includeInvestigatorspubmed_format_citations, directly under its titledataBanks lists the record's trial registrations and data deposits (ClinicalTrials.gov NCT IDs, GenBank and PDB accessions, Dryad DOIs) verbatim; search pubmed_search_articles for <accession>[si] to find other records citing one; search "<name>"[nm] to find other records listing a substance (a C UI is a supplementary concept, which no [mh] clause matches)recordType separates journal articles from Bookshelf chapters and books; opt-in maxResponseCharacters defers overflow to deferred.idspubmed_fetch_fulltext toolpmcids, pmids, and dois in any mix, up to 50 distinct identifiers per call: the first 10 are fetched and the rest returned in overLimit for a follow-up call. A DOI may be sent bare, as a resolver link (https://doi.org/…), or with the doi: scheme; each is read as the bare DOI, which is what the response echoes. Each is tried against PMC, then Europe PMC, then Unpaywall (needs UNPAYWALL_EMAIL); an article several of them name is fetched and returned once, and viaSource names the tier that answeredsource: "pmc" returns sections (the body, then back matter such as acknowledgments, declarations, and appendices), tables, and figures; source: "unpaywall" returns a best-effort HTML or PDF text body; each read is held to 50 MiB, and an open-access copy over that is a fetch-failed miss (a PDF over it falls through to the publisher landing page)licenses their PMC JATS states*_deadline_exceeded reason in its detail, and one it left no time for is not-attempted. The PMC ID Converter lookup that routes pmids and dois takes the same half share while a later tier can run; when it fails, its ids carry a pmc service-error naming the ID Converter and go on to Europe PMC and Unpaywallreason and triedTiers; sections, maxSections, maxCharacters, overflowMode, and maxResponseCharacters bound the response, truncation reports what was cut, and sectionCap names the sections maxSections cutsections filter that matches an article only in part adds a notice naming, per article, the terms that matched no section or subsection title there and pointing at overflowMode: "outline" to list its headingspubmed_europepmc_search toolPPR), patents (PAT), and Agricola (AGR) to MED and PMC; defaults to MED, PMC, PPRcursorMark / nextCursorMark, up to 100 per page; a larger page size is served at the cap with a notice naming where to continue. Abstracts arrive as 400-character snippetssort of comma-separated <field> asc|desc keys; relevance is the default order, and a sort Europe PMC cannot use fails as europepmc_invalid_inputlicense and hasFullTextXmlEUROPEPMC_ENABLED=falsepubmed_europepmc_fetch toolrecords: [{ source, epmcId }], each pair copied from a search hit, with the full abstract, license, and hasFullTextXml; unresolved ids land in notFound; opt-in maxResponseCharacters defers overflow to deferred.recordsEUROPEPMC_ENABLED=falsepubmed_fetch_citation_metrics tooloverLimit, PMIDs NIH iCite has no record for in unavailablePmidsincludeClinicalCitations adds clinicalCitationPmids, the PMIDs of the clinical articles citing each record (uncapped, so off by default)pubmed_fetch_articles for noticespubmed_format_citations toolapa, mla, bibtex, ris, and vancouver1637-1645 → 1637-45); BibTeX issn and RIS SN carry the journal's linking ISSN, and RIS TI drops its trailing periodnotices and are shown ahead of its citations; Vancouver adds a Retraction in: / Erratum in: note and APA a retraction parentheticalpubmed_find_related toolsimilar, cited_by, or references, up to 50 per page with offset pagination. A larger page size is served at the cap with a notice naming where to continuedoi, pmcId and pmcUrl when the record has them, and a pubmedUrl on every row, plus languagesall_providers_failed if none can. The chain shares the call's one deadline: each step with another behind it (a fallback provider, then the rows' ESummary) gets half the time left, a provider the deadline left no time to ask is reported not_reached, and with none left for the ESummary the rows are pmid and pubmedUrl only, with a noticepubmed_spell_check tooloriginal, corrected, and hasSuggestion; corrections land in place, so field tags, operators, spacing, and gene symbols stay as written, and a single letter such as an author initial is never swapped for anotheraged[mh], zhang y[au], free full text[sb]) are kept as written; free-text fields ([tiab], [ti], [tw]) are still correctedtirzepatide stays, where ESpell alone returns irzepatide), unless ESpell's MeSH dictionary offers a spelling PubMed holds more often than the word (tirzepatid → tirzepatide). A query ESpell leaves unchanged costs one NCBI request; a corrected one sends up to 12 more, within 10 seconds or the time the tool call has left. A check that cannot run leaves ESpell's correction applied (or the dropped word as written) and a notice names itpubmed_search_articles with correctedpubmed_lookup_mesh toolnextOffset. A larger page size is served at the cap with a notice naming where to continuemeshId, e.g. D000072657) beside the Entrez UID, their recordType, and a searchTerm, the PubMed clause that searches them ("Name"[mh], [nm] for a supplementary concept, [pa], [pt], [sh]); a drug-class heading returns its descriptor and its pharmacological-action record as two records under one name and ID, told apart by recordTypeincludeDetails (default on) adds tree numbers, scope notes, entry terms, yearIntroduced, and previousIndexing; the exact heading match on a query's first page also gets its allowable subheadingspubmed_lookup_citation toolmatched, not_found, or ambiguous, with recovery detailpubmed_convert_ids toolidType (doi, pmid, pmcid); only PMC-indexed articles resolve. A DOI may be a resolver link or carry the doi: scheme; requestedId keeps the spelling sentpubmed://database/info resourcepubmed database, returned as application/jsoncount, lastUpdate, and fields[], whose names are the search tags pubmed_search_articles acceptsresearch_plan prompttitle, goal, and keywords required; organism and includeAgentPrompts optionalincludeAgentPrompts: "true" adds an agent-guidance block under each of its nine sub-steps, two of which point at tools: the literature review names pubmed_search_articles and pubmed_lookup_mesh, and the interpretation step names pubmed_search_articlesBuilt on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
PubMed-specific:
NCBI_TOTAL_DEADLINE_MS always fits (5 at defaults), later calls to it make one attempt each until one succeedspubmed_fetch_fulltext also matches DOIs case-insensitively and PMC IDs with or without the PMC prefix; pubmed_convert_ids and pubmed_fetch_fulltext read a DOI link or doi: form as the bare DOIAgent-friendly output:
source: "pmc" | "unpaywall", typed unavailable reasons, viaSource and triedTiers fields, so callers branch on data, not string parsingConnect to the hosted instance, no install:
claude mcp add --transport http pubmed-mcp-server https://pubmed.caseyjhand.com/mcp
Or run it locally:
claude mcp add pubmed-mcp-server -- npx -y @cyanheads/pubmed-mcp-server
For other clients, add this to the MCP config file:
{
"mcpServers": {
"pubmed-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/pubmed-mcp-server"]
}
}
}
An NCBI API key in NCBI_API_KEY raises the rate limit from 3 to 10 requests per second (-e NCBI_API_KEY=your-key, or an env entry). For Docker or a source build, see Running the server.
| Variable | Description | Default |
|---|---|---|
NCBI_API_KEY | NCBI API key; raises the rate limit from 3 to 10 req/s. NCBI counts the limit per key (per IP address without one), so processes sharing a key or an address share it. | none |
NCBI_ADMIN_EMAIL | Contact email sent with NCBI requests, as NCBI recommends. | none |
NCBI_REQUEST_DELAY_MS | Minimum gap between NCBI request starts, in ms. | 400 (120 with a key) |
NCBI_MAX_CONCURRENT | Max concurrent in-flight NCBI requests. | 8 |
NCBI_MAX_RETRIES | Retry attempts for failed NCBI requests. An endpoint where a call failed unreachable on every attempt, after all its retries or at least as many attempts as half of NCBI_TOTAL_DEADLINE_MS always fits (5 at defaults), gets one attempt per call until one succeeds. | 6 |
NCBI_TIMEOUT_MS | Per-request HTTP timeout, in ms. | 30000 |
NCBI_TOTAL_DEADLINE_MS | Deadline for one NCBI call across queue wait, retries, and backoff, in ms. A call that can't start in time is rejected at once. A tool call as a whole runs under 50 s, or the larger of this and EUROPEPMC_TOTAL_DEADLINE_MS when either is set higher; a value below 50 s still ends the NCBI call at its own. | 50000 |
UNPAYWALL_EMAIL | Contact email for Unpaywall. Setting it enables the Unpaywall tier of pubmed_fetch_fulltext for non-PMC DOIs. | none |
UNPAYWALL_TIMEOUT_MS | Per-request timeout for Unpaywall lookups and content fetches, in ms, or the time the tool call has left when that is less. Each content read is held to 50 MiB. | 20000 |
EUROPEPMC_ENABLED | Set false to disable every Europe PMC call: both Europe PMC tools go unregistered, pubmed_fetch_fulltext skips that tier, and pubmed_find_related skips that fallback. | true |
EUROPEPMC_EMAIL | Optional contact email sent with Europe PMC requests. | none |
EUROPEPMC_REQUEST_DELAY_MS | Minimum gap between Europe PMC request starts, in ms. | 200 |
EUROPEPMC_MAX_RETRIES | Retry attempts for failed Europe PMC, OpenAlex, and iCite requests. | 3 |
EUROPEPMC_TIMEOUT_MS | Per-request timeout for Europe PMC, OpenAlex, and iCite calls, in ms. | 20000 |
EUROPEPMC_TOTAL_DEADLINE_MS | Deadline for one Europe PMC or OpenAlex call across queue wait, retries, and backoff, in ms. iCite calls keep a fixed 50 s deadline. | 45000 |
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | HTTP server port. | 3010 |
MCP_SESSION_MODE | HTTP session mode: stateless, stateful, or auto. | stateless |
MCP_AUTH_MODE | Authentication: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (debug, info, warning, error, etc.). | info |
LOGS_DIR | Directory for log files (Node.js only). | <app-root>/logs |
STORAGE_PROVIDER_TYPE | Storage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1. | in-memory |
OTEL_ENABLED | Enable OpenTelemetry. | false |
See .env.example for every server setting and the common framework overrides.
Requires Bun v1.4.4 or higher (or Node.js v24+).
Clone and install:
git clone https://github.com/cyanheads/pubmed-mcp-server.git
cd pubmed-mcp-server && bun install
cp .env.example .env # set NCBI_API_KEY, NCBI_ADMIN_EMAIL, and UNPAYWALL_EMAIL as needed
Build and run the production version:
# One-time build
bun run rebuild
# Run the built server
bun run start:http
# or
bun run start:stdio
Run checks and tests:
bun run devcheck # Lints, formats, type-checks, and more
bun run test # Runs the test suite
docker run --rm -p 3010:3010 ghcr.io/cyanheads/pubmed-mcp-server:latest
The image defaults to HTTP transport, stateless session mode, and logs to /var/log/pubmed-mcp-server. To run it over stdio from an MCP client, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/pubmed-mcp-server:latest"]. To build locally, docker build -t pubmed-mcp-server .; OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
| Directory | Purpose |
|---|---|
src/mcp-server/tools | Tool definitions (*.tool.ts). Twelve tools across PubMed, PMC, Europe PMC, and NIH iCite. |
src/mcp-server/resources | Resource definitions. Database info resource. |
src/mcp-server/prompts | Prompt definitions. Research plan prompt. |
src/services/ncbi | NCBI E-utilities service layer — API client, queue, parser, formatter. |
src/services/europe-pmc | Europe PMC service — search + fullTextXML JATS retrieval. Reuses the NCBI JATS parser. |
src/services/unpaywall | Unpaywall service — DOI → OA location resolution and content fetch (HTML/PDF). HTML extraction runs off-thread: a worker thread per extraction, a 10 s deadline or the time the tool call has left when that is less, two at a time per process. Each content read is held to 50 MiB. |
src/services/openalex | OpenAlex service — last-resort provider for pubmed_find_related. |
src/config | Server-specific environment variable parsing and validation with Zod. |
tests/ | Unit and integration tests, mirroring the src/ structure. |
skills/ | The published pubmed-guide agent skill, served over MCP and shipped in the package, the .mcpb bundle, and the Docker image. |
See CLAUDE.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for logging, ctx.state for storagecreateApp() arrays in src/index.tsIssues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
D4D4Vinci/Scrapling107k近 7 天新增 1,730 个 star
Fetches web content and converts it to Markdown for an LLM to read
MOmodelcontextprotocol/servers92k近 7 天新增 166 个 star
Keyword research, site audits, rank tracking and AI visibility for your AI agent.
EVevery-app/open-seo29k近 7 天新增 533 个 star
Search and discover Agent Skills from the skills.sh registry. Powered by HAPI MCP server.
AGagentskills/agentskills28k近 7 天新增 175 个 star
The search engine for AI agents: cited answers from your local code, docs, specs and logs.
XExerj-org/xerj23k近 7 天新增 1,626 个 star