Logo von Pubmed MCP Server

Pubmed MCP Server

Community
cyanheads

Search PubMed/Europe PMC, fetch articles and full text (PMC/EPMC/Unpaywall), citations, MeSH terms via MCP. STDIO or Streamable HTTP.

Herausgebercyanheads
Repositorypubmed-mcp-server
SpracheTypeScript
Forks
23
Sterne
148
Verfügbare Tools
0
Transporttypstdio
Kategorien
LizenzApache-2.0
Links
  • Tools mit KI-Workflows verbinden

    Pubmed MCP Server stellt MCP-Funktionen bereit, die kompatible KI-Clients und Agenten nutzen können.

  • Verfügbare Tools: 0

    Unten finden Sie die aufrufbaren Aktionen. Namen und Beschreibungen werden angezeigt, sofern der Server sie bereitstellt.

  • Konfiguration zum Kopieren

    Nutzen Sie die Installationsbeispiele, um diesen Server in Ihrem bevorzugten MCP-Client zu konfigurieren.

  • Open-Source-Kennzahlen

    Kennzahlen des verlinkten Repositorys: Sterne (148) und Forks (23).

Version License Docker MCP SDK npm TypeScript Bun

Install in Claude Desktop Install in Cursor Install in VS Code

Framework

Public Hosted Server: https://pubmed.caseyjhand.com/mcp


Overview

The biomedical literature via NCBI's E-utilities, 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.

Tools

ToolDescription
pubmed_search_articlesSearch PubMed with full query syntax, field-specific filters, date ranges, pagination, and optional brief summaries
pubmed_europepmc_searchSearch Europe PMC for preprints, patents, Agricola, and EPMC-only OA records that don't surface in PubMed. Cursor-based pagination.
pubmed_europepmc_fetchFetch complete Europe PMC records — including the untruncated abstract — by source + epmcId, the only identifier many preprint, patent, and Agricola records carry
pubmed_fetch_articlesFetch full article metadata by PMIDs — abstract, authors, journal, MeSH terms, grants
pubmed_fetch_fulltextFetch full-text articles via a chain: NCBI PMC EFetch → Europe PMC fullTextXML → Unpaywall. Accepts PMIDs, PMCIDs, or DOIs.
pubmed_format_citationsGenerate formatted citations in APA 7th, MLA 9th, BibTeX, RIS, or Vancouver (ICMJE/NLM)
pubmed_find_relatedFind similar articles, citing articles, or references for a given PMID
pubmed_spell_checkSpell-check a biomedical query via NCBI ESpell — returns the corrected query and whether a suggestion was found
pubmed_lookup_meshSearch MeSH by heading — tree numbers, scope notes, entry terms — for building controlled-vocabulary queries
pubmed_lookup_citationResolve partial bibliographic references to PubMed IDs via ECitMatch
pubmed_convert_idsConvert between DOI, PMID, and PMCID using the PMC ID Converter API

Resources

ResourceDescription
pubmed://database/infoPubMed database metadata via EInfo (field list, record count, last update)

Prompts

PromptDescription
research_planGenerate a structured 4-phase biomedical research plan outline

Capability reference

pubmed_search_articles tool

  • Full PubMed boolean and field-tag syntax, plus structured filters: author, journal, MeSH terms, language, species, publication type, has-abstract, free-full-text
  • Date ranges by publication, modification, or Entrez date; sort by relevance, date, author, or journal; offset pagination
  • Optional brief summaries for the top N results via ESummary
  • NCBI Bookshelf hits carry bookTitle, publisherName, docType, and editors in place of the empty source
  • Echoes the original query, the fully applied PubMed query, and normalized filter metadata

pubmed_fetch_articles tool

  • Up to 200 PMIDs per call (POST for batches of 100 or more)
  • Title, abstract, authors with deduplicated affiliations, journal info, DOI, PubMed/PMC links; optional MeSH terms, grants, and publication types
  • Tolerant of PubMed's inconsistent XML — structured abstracts, missing fields, varying date formats
  • Bookshelf chapters and books are first-class: recordType (journal-article / book-chapter / book) plus a book object (title, publisher, editors, ISBNs, Bookshelf accession); journalInfo is absent on them
  • Article-number journals report journalInfo.elocationId + elocationIdType rather than a page range
  • Opt-in maxResponseCharacters keeps whole records in order until the ceiling, then defers the rest to deferred.ids for a follow-up call

pubmed_fetch_fulltext tool

  • Exactly one of pmcids, pmids, or dois (one id per element), up to 10 per request
  • Three-tier chain: NCBI PMC EFetch → Europe PMC fullTextXML (EUROPEPMC_ENABLED, default on) → Unpaywall (needs UNPAYWALL_EMAIL); viaSource names which tier served each article
  • Preprints, patents, and Agricola records have metadata via pubmed_europepmc_search but no full text through this chain — Europe PMC's fullTextXML is PMC-keyed
  • source: "pmc" returns structured sections plus tables[] (cells, caption, label, footnotes) and assets[] (figures and supplementary material, with [Figure: <label>] markers left in the body); source: "unpaywall" returns a best-effort body with contentFormat (html-markdown / pdf-text)
  • Unavailable entries carry a typed reason (not-found, no-doi, doi-lookup-failed, no-oa, service-error, …), idType, triedTiers (per-tier outcome in execution order), and unqueriedTiers when an unconfigured tier could have served the id
  • Filters and budgets: sections (case-insensitive title match), maxSections, includeTables, includeAssets, maxCharacters, maxCharactersPerSection, overflowMode (truncate / outline), and maxResponseCharacters, which defers whole articles past the ceiling to deferred.ids; a truncation object reports what was shortened or omitted

pubmed_europepmc_search tool

  • Reaches records PubMed can't: preprints (PPR), patents (PAT), Agricola (AGR), alongside MED and PMC; default sources is ["MED", "PMC", "PPR"]
  • Cursor pagination via cursorMark — * for the first page, then nextCursorMark
  • Hits carry source plus pmid / pmcId / doi when known; abstractSnippet is capped at 400 characters, with abstractTruncated flagging the cut
  • Not registered when EUROPEPMC_ENABLED=false

pubmed_europepmc_fetch tool

  • Full records with the untruncated plain-text abstract, addressed by source + epmcId — the only identifier preprint, patent, and Agricola records reliably carry
  • Up to 25 per call in one Europe PMC request; unresolved ids come back in notFound rather than failing the batch
  • Not registered when EUROPEPMC_ENABLED=false

pubmed_format_citations tool

  • APA 7th, MLA 9th, BibTeX, RIS, Vancouver (ICMJE/NLM); several styles per article in one call, up to 50 articles
  • Bookshelf chapters and books cite in each style's edited-book form; articles without a page range cite by electronic locator in each style's convention
  • Hand-rolled formatters — zero dependencies, Workers-compatible
  • Reports formatted counts and unavailable PMIDs

pubmed_find_related tool

  • similar, cited_by, or references for a PMID, in NCBI relevance order, enriched with title, authors, date, and source (or Bookshelf book title and publisher)
  • Falls back to Europe PMC, then OpenAlex, when NCBI can't answer; the response names the provider. Fails with a typed all_providers_failed error rather than an empty result

pubmed_spell_check tool

  • Runs a query through NCBI ESpell and returns original, corrected, and hasSuggestion
  • A blank or whitespace-only query is rejected rather than sent upstream

pubmed_lookup_mesh tool

  • Looks up MeSH descriptors by name or free-text term, pinning the exact-heading match to the top of the first page
  • Records carry meshId (DescriptorUI), entrezUid, and, with includeDetails (default on), tree numbers, scope notes, and entry terms
  • maxResults up to 50 with offset pagination via nextOffset; totalCount reports the upstream match count

pubmed_lookup_citation tool

  • Match on journal, year, volume, first page, and/or author — at least one field, more fields for better precision; up to 25 per call
  • Pipes and line breaks are rejected at the schema (ECitMatch's wire format is pipe-delimited); the free-form key label is exempt
  • Explicit matched, not_found, and ambiguous statuses with recovery detail

pubmed_convert_ids tool

  • Up to 50 DOIs, PMIDs, or PMCIDs per call, all one type; only PMC-indexed articles resolve
  • One id per element — a packed "23193287,37952131" is rejected rather than expanded
  • Per-id success/error rows; a partial batch never fails as a whole

pubmed://database/info resource

  • Live EInfo call for the pubmed database, returned as application/json
  • dbName, description, count, lastUpdate, and fields[] — each field's short name (the tag usable in pubmed_search_articles queries), fullName, and description
  • No parameters

research_plan prompt

  • Arguments: title, goal, keywords (comma-separated) required; organism and includeAgentPrompts ("true" / "false") optional
  • Returns two messages: an assistant framing message (biomedical research planning assistant, grounds recommendations in the PubMed tools when available) and a user message carrying the plan
  • The plan walks four phases — Conception & Planning, Data Collection & Processing, Analysis & Interpretation, Dissemination — with sub-steps under each
  • includeAgentPrompts: "true" adds an agent-guidance block under each sub-step, several of which point at pubmed_search_articles and pubmed_lookup_mesh

Features

Built 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:

  • Complete NCBI E-utilities integration (ESearch, EFetch, ESummary, ELink, ESpell, EInfo, ECitMatch) plus PMC ID Converter
  • Sequential request queue with configurable delay for NCBI rate limit compliance
  • NCBI-specific XML parser with isArray hints for PubMed's inconsistent XML structure
  • Hand-rolled citation formatters (APA, MLA, BibTeX, RIS, Vancouver) — zero deps, Workers-compatible

Agent-friendly output:

  • Provenance on every response — source labels, license fields, best-effort warnings on Unpaywall results, and effective-query echo on searches so agents can reason about trust
  • Graceful partial failure — batch tools return per-item success/error rows instead of failing the request, with structured status codes and actionable next-step text
  • Discriminated output contracts — source: "pmc" | "unpaywall", typed unavailable reasons, viaSource and triedTiers fields — callers branch on data, not string parsing

Getting started

Public Hosted Instance

A public instance is available at https://pubmed.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:

json
{
  "mcpServers": {
    "pubmed-mcp-server": {
      "type": "streamable-http",
      "url": "https://pubmed.caseyjhand.com/mcp"
    }
  }
}

Self-Hosted / Local

Add the following to your MCP client configuration file.

json
{
  "mcpServers": {
    "pubmed-mcp-server": {
      "type": "stdio",
      "command": "bunx",
      "args": ["@cyanheads/pubmed-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info",
        "NCBI_API_KEY": "your-key-here"
      }
    }
  }
}

Or with npx (no Bun required):

json
{
  "mcpServers": {
    "pubmed-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@cyanheads/pubmed-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info",
        "NCBI_API_KEY": "your-key-here"
      }
    }
  }
}

Or with Docker:

json
{
  "mcpServers": {
    "pubmed-mcp-server": {
      "type": "stdio",
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/pubmed-mcp-server:latest"]
    }
  }
}

For Streamable HTTP, set the transport and start the server:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp

Prerequisites

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/pubmed-mcp-server.git
  1. Navigate into the directory:
sh
cd pubmed-mcp-server
  1. Install dependencies:
sh
bun install

Configuration

Key environment variables:

VariableDescriptionDefault
MCP_TRANSPORT_TYPETransport: stdio or httpstdio
MCP_HTTP_PORTHTTP server port3010
MCP_HTTP_ENDPOINT_PATHHTTP endpoint path where the MCP server is mounted/mcp
MCP_SESSION_MODEHTTP session mode: stateless, stateful, or auto (resolves to stateful). This server ships stateless — it has no ctx.requestInput call sites.stateless
MCP_PUBLIC_URLPublic origin override for TLS-terminating reverse-proxy deployments (landing page, Server Card, RFC 9728 metadata).none
MCP_AUTH_MODEAuthentication: none, jwt, or oauthnone
MCP_LOG_LEVELLog level (debug, info, warning, error, etc.)info
MCP_GC_PRESSURE_INTERVAL_MSOpt-in Bun-only forced-GC pressure loop (ms). Drains the per-request McpServer/McpSessionTransport cycle under sustained low-traffic HTTP. Recommended starting point if heap growth is observed: 60000.0 (disabled)
LOGS_DIRDirectory for log files (Node.js only). Relative paths resolve against the application root.<app-root>/logs
STORAGE_PROVIDER_TYPEStorage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1in-memory
NCBI_API_KEYNCBI API key for higher rate limits (10 req/s vs 3 req/s)none
NCBI_ADMIN_EMAILContact email sent with NCBI requests (recommended by NCBI)none
NCBI_REQUEST_DELAY_MSMinimum gap between NCBI request starts in ms334 (100 with key)
NCBI_MAX_CONCURRENTMax concurrent in-flight NCBI requests8
NCBI_MAX_RETRIESRetry attempts for failed NCBI requests6
NCBI_TIMEOUT_MSPer-request HTTP timeout in ms30000
NCBI_TOTAL_DEADLINE_MSTotal deadline across all retry attempts for one NCBI call, in ms60000
UNPAYWALL_EMAILContact email for Unpaywall. When set, pubmed_fetch_fulltext falls back to Unpaywall open-access copies for non-PMC DOIsnone
UNPAYWALL_TIMEOUT_MSPer-request HTTP timeout for Unpaywall lookups and content fetches, in ms20000
EUROPEPMC_ENABLEDEnable Europe PMC search tool and the pubmed_fetch_fulltext JATS fallback chain. Set false to disable all EPMC calls and skip tool registration.true
EUROPEPMC_EMAILOptional contact email sent with Europe PMC requests (EBI courtesy).none
EUROPEPMC_REQUEST_DELAY_MSMinimum gap between Europe PMC request starts in ms200
EUROPEPMC_MAX_RETRIESRetry attempts for failed Europe PMC requests3
EUROPEPMC_TIMEOUT_MSPer-request HTTP timeout for Europe PMC calls, in ms20000
OTEL_ENABLEDEnable OpenTelemetryfalse

Running the server

Local development

  • Build and run the production version:

    sh
    # One-time build
    bun run rebuild
    
    # Run the built server
    bun run start:http
    # or
    bun run start:stdio
  • Run checks and tests:

    sh
    bun run devcheck  # Lints, formats, type-checks, and more
    bun run test      # Runs the test suite

Project structure

DirectoryPurpose
src/mcp-server/toolsTool definitions (*.tool.ts). Eleven tools across PubMed, PMC, and Europe PMC.
src/mcp-server/resourcesResource definitions. Database info resource.
src/mcp-server/promptsPrompt definitions. Research plan prompt.
src/services/ncbiNCBI E-utilities service layer — API client, queue, parser, formatter.
src/services/europe-pmcEurope PMC service — search + fullTextXML JATS retrieval. Reuses the NCBI JATS parser.
src/services/unpaywallUnpaywall service — DOI → OA location resolution and content fetch (HTML/PDF).
src/configServer-specific environment variable parsing and validation with Zod.
tests/Unit and integration tests, mirroring the src/ structure.

Development guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for logging, ctx.state for storage
  • Register new tools and resources in the createApp() arrays

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheck
bun run test

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

Installation

TypingMind
{
  "mcpServers": {
    "cyanheads-pubmed-mcp-server": {
      "command": "node",
      "args": [
        "dist/index.js"
      ]
    }
  }
}

Pubmed MCP Server MCP mit mehreren KI-Modellen nutzen

TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. Sobald Pubmed MCP Server verbunden ist, können Sie die Integration mit verschiedenen KI-Modellen in TypingMind verwenden, statt sie für jedes Modell separat einzurichten. Diese MCP-Integration läuft lokal über den TypingMind-MCP-Konnektor auf Ihrem Gerät.

Einrichtungsanleitung für den lokalen Konnektor

Nutzen Sie diese Option, wenn der MCP-Server Zugriff auf lokale Dateien, Apps oder private Ressourcen auf Ihrem Computer benötigt.

1

MCP-Einstellungen öffnen

Gehen Sie in TypingMind zu „Einstellungen“, „Erweiterte Einstellungen“ und dann „Model Context Protocol“ und wählen Sie „Konnektor einrichten“.

  1. Öffnen Sie TypingMind in Ihrem Browser.
  2. Klicken Sie auf das Symbol „Einstellungen“.
  3. Gehen Sie zu „Erweiterte Einstellungen“.
  4. Öffnen Sie den Abschnitt „Model Context Protocol“.
  5. Klicken Sie auf „Konnektor einrichten“ und wählen Sie „Dieses Gerät“.
Einrichtungsbildschirm des TypingMind-MCP-Konnektors mit ausgewählter Option „Dieses Gerät“
2

Konnektor-Befehl ausführen

Wählen Sie „Dieses Gerät“, kopieren Sie den Befehl aus TypingMind und führen Sie ihn im Terminal aus. Lassen Sie den Prozess laufen, solange Sie MCP verwenden.

  1. Kopieren Sie den in TypingMind angezeigten Einrichtungsbefehl.
  2. Öffnen Sie „Terminal“ (macOS) bzw. „Windows Terminal“ (Windows).
  3. Fügen Sie den Befehl ein und führen Sie ihn aus.
  4. Bestätigen Sie die Paketinstallation, wenn Sie im Terminal zum Fortfahren aufgefordert werden.
  5. Lassen Sie das Terminalfenster geöffnet und den Prozess darin laufen, solange Sie MCP-Tools verwenden.
3

Pubmed MCP Server als Server hinzufügen

Wenn der Konnektorstatus „Bereit“ anzeigt, klicken Sie auf „Server bearbeiten“ und fügen Sie die MCP-Server-Konfiguration ein.

  1. Warten Sie, bis der Konnektorstatus „Bereit“ anzeigt.
  2. Klicken Sie auf „Server bearbeiten“.
  3. Fügen Sie die MCP-Server-Konfiguration für Pubmed MCP Server ein.
  4. Speichern Sie die Serverliste.
  5. Aktualisieren Sie die Ansicht, um bei Bedarf zu prüfen, ob der Konnektor weiterhin bereit ist.
MCP-Einstellungen in TypingMind mit aktivem Server und der Schaltfläche „Server bearbeiten“
{
  "mcpServers": {
    "cyanheads-pubmed-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/pubmed-mcp-server"
      ]
    }
  }
}
4

Verbindung modellübergreifend nutzen

Speichern Sie die Serverliste, öffnen Sie „Plugins“ und aktivieren Sie die MCP-Tools von Pubmed MCP Server. Wählen Sie dann ein beliebiges unterstütztes KI-Modell in TypingMind und verwenden Sie die Tools im Chat oder weisen Sie sie einem KI-Agenten zu.

  1. Öffnen Sie die Seite „Plugins“ in TypingMind.
  2. Aktivieren Sie die MCP-Tools von Pubmed MCP Server.
  3. Starten Sie einen Chat und wählen Sie das KI-Modell, das Sie verwenden möchten.
  4. Nutzen Sie die MCP-Tools im Chat oder weisen Sie sie einem KI-Agenten zu.
  5. Wechseln Sie bei Bedarf zu einem anderen KI-Modell, ohne die MCP-Verbindung erneut herzustellen.
TypingMind-Chat mit aktivierten MCP-Tools und einem ausgewählten KI-Modell
Können Sie mir mit Pubmed MCP Server bei dieser Aufgabe helfen?
Pubmed MCP Server
Gerne. Ich habe es gelesen.
Das habe ich mit Pubmed MCP Server gefunden.

Häufig gestellte Fragen

Wofür wird der MCP-Server Pubmed MCP Server verwendet?

Pubmed MCP Server ist ein MCP-Server, über den kompatible KI-Clients auf externe Tools und Kontext zugreifen können. In TypingMind können Sie diesen MCP-Server einmal hinzufügen und seine Tools in Ihrem KI-Arbeitsbereich verfügbar machen.

Kann ich den MCP-Server Pubmed MCP Server mit mehreren KI-Modellen in TypingMind verwenden?

Ja. TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. So können Sie Pubmed MCP Server mit verschiedenen KI-Modellen wie Claude, ChatGPT, Gemini oder anderen in TypingMind konfigurierten Modellen verwenden, ohne den MCP-Server für jedes Modell separat einzurichten.

Warum den MCP-Server Pubmed MCP Server mit TypingMind nutzen?

TypingMind ist eine der besten Oberflächen für LLM-Chats, da es mehrere KI-Modelle, Prompts, Plugins, KI-Agenten, API-Schlüssel und MCP-Tools in einem Arbeitsbereich vereint. Sobald Pubmed MCP Server verbunden ist, können Sie die zugehörigen MCP-Tools mit Ihren bevorzugten Modellen nutzen und Ihre Chat-Abläufe in TypingMind übersichtlich organisieren.

Wie verbinde ich den MCP-Server Pubmed MCP Server mit TypingMind?

Pubmed MCP Server wird über den lokalen MCP-Konnektor von TypingMind angebunden. Das ist die beste Wahl, wenn der MCP-Server auf lokale Dateien, Desktop-Apps, Befehlszeilentools oder private Ressourcen auf Ihrem Computer zugreifen muss.

Welche Tools stellt der MCP-Server Pubmed MCP Server in TypingMind bereit?

Pubmed MCP Server stellt MCP-Funktionen bereit, die Sie auf der Plugins-Seite in TypingMind aktivieren und im Chat verwenden oder KI-Agenten zuweisen können.

Muss ich meine API-Schlüssel mit TypingMind teilen, um den MCP-Server Pubmed MCP Server zu verwenden?

Nein. TypingMind arbeitet vorrangig lokal. Sie wählen Ihre Modellanbieter selbst und behalten die Kontrolle über Ihre API-Schlüssel, Prompts und MCP-Konfiguration. Falls Pubmed MCP Server eine Authentifizierung erfordert, fügen Sie beim Erstellen der Verbindung die erforderlichen Header, OAuth-Einstellungen oder die lokale Konfiguration für diesen MCP-Server hinzu.

Ähnliche MCP-Server

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇