PubMed MCP Server
Provides tools for searching PubMed articles using the NCBI Entrez API, enabling retrieval of detailed article information including title, authors, abstract, journal, and publication date with configurable search parameters
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PubMed MCP Serversearch for recent articles on CRISPR gene editing in humans, limit to 5 results"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PubMed-MCP
A Model Context Protocol (MCP) server that provides tools for searching PubMed articles using the NCBI Entrez API.
Author: Emilio Delgado Muñoz
Features
Search PubMed for articles based on queries
Retrieve detailed information including title, authors, abstract, journal, and publication date
Returns results in JSON format
Configurable maximum number of results
Related MCP server: PubMed MCP Server
Architecture
graph TB
A[User] --> B[MCP Server<br/>pubmed_server.py]
B --> C[search_pubmed function]
C --> D[Entrez.esearch<br/>Search in PubMed]
D --> E[PubMed database<br/>NCBI]
E --> F[List of PMIDs]
F --> G[Entrez.efetch<br/>Fetch details]
G --> E
G --> H[Article XML records]
H --> I[Data processing]
I --> J[Extraction of:<br/>- Title<br/>- Authors<br/>- Abstract<br/>- Journal<br/>- Date]
J --> K[List of articles<br/>in JSON format]
K --> L[Response to user]
subgraph "Dependencies"
M[BioPython<br/>requirements.txt]
N[FastMCP<br/>requirements.txt]
end
B -.-> M
B -.-> N
subgraph "Configuration"
O[Entrez.email<br/>Configured in code]
end
C -.-> O
style A fill:#e1f5fe
style L fill:#c8e6c9
style E fill:#fff3e0Installation
Clone this repository:
git clone <repository-url> cd PubMed-MCPInstall dependencies:
uv syncConfigure your email in
pubmed_server.py:Entrez.email = 'your-email@example.com' # Replace with your actual email
VS Code Configuration
To use this MCP server locally in VS Code, the project includes a pre-configured .vscode/mcp.json file. This file tells VS Code how to run the MCP server.
The configuration is already set up to use uv for running the server:
{
"servers": {
"pubmed-mcp": {
"command": "uv",
"args": ["run", "${workspaceFolder}/pubmed_server.py"]
}
}
}Requirements for VS Code Integration
VS Code with MCP extension support
uvpackage manager installedPython virtual environment set up
Alternative Configuration
If you prefer to use pip instead of uv, you can modify the .vscode/mcp.json file:
{
"servers": {
"pubmed-mcp": {
"command": "python",
"args": ["${workspaceFolder}/pubmed_server.py"]
}
}
}Make sure your virtual environment is activated when using this configuration.
Requirements
Python 3.11+
BioPython
FastMCP
Usage
Run the MCP server:
python pubmed_server.pyThe server will start and listen for MCP protocol messages on stdin/stdout.
Available Tools
search_pubmed
Searches PubMed for articles matching the given query.
Parameters:
query(string): The search querymax_results(integer, optional): Maximum number of results to return (default: 10)title(bool, optional): If true (default) search in Title fieldabstract(bool, optional): If true (default) search in Abstract fieldkeywords(bool, optional): If true (default) expand search with Author Keywords ([ot]) and MeSH Headings ([mh])
Field logic:
title=Trueandabstract=True-> query applied as(your terms)[tiab]Only
title=True->(your terms)[ti]Only
abstract=True->(your terms)[ab]Both false -> no field tag (all fields)
keywords=True-> OR-expanded with(your terms)[ot] OR (your terms)[mh]
Example refined queries:
query = "breast cancer metastasis"
title=True, abstract=True, keywords=True -> (breast cancer metastasis)[tiab] OR ((breast cancer metastasis)[ot] OR (breast cancer metastasis)[mh])
title=True, abstract=False, keywords=False -> (breast cancer metastasis)[ti]
title=False, abstract=False, keywords=True -> (breast cancer metastasis) OR ((breast cancer metastasis)[ot] OR (breast cancer metastasis)[mh])Returns: A list of article objects containing:
pmid: PubMed IDtitle: Article titleauthors: List of author namesabstract: Article abstractjournal: Journal namepublication_year: Year of publicationpublication_month: Month of publicationurl: PubMed URL
Configuration
Before using the tool, you must set your email address in the Entrez.email variable. This is required by NCBI's Entrez API.
License
This project is open source. Please check the license file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Available Tools
1 toolsearch_pubmedA
Search PubMed and return a list of article JSON objects.
Parameters: query: Free-text user query; boolean operators (AND/OR/NOT) supported by PubMed. max_results: Maximum number of records to retrieve (retmax). title: If True, include Title field in search restriction (ti / tiab). abstract: If True, include Abstract field in search restriction (ab / tiab). keywords: If True, expand search to Author Keywords (ot) and MeSH Headings (mh).
Field logic: - title and abstract both True => core search uses [tiab] - only title True => uses [ti] - only abstract True => uses [ab] - neither title nor abstract True => no restriction (all fields) - keywords True => additionally OR with [ot] and [mh] versions of the query
Returns: List[dict]: Each dict contains pmid, title, authors, abstract, journal, publication_year, publication_month, url.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| max_results | No | ||
| title | No | ||
| abstract | No | ||
| keywords | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden. It effectively describes the search behavior, field logic, and return format, though it lacks details on rate limits, authentication needs, or error handling.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (Parameters, Field logic, Returns) and avoids redundancy. It could be slightly more concise by integrating some details, but overall it's efficient and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 5-parameter search tool with no annotations or output schema, the description is quite complete—covering parameters, logic, and return values. Minor gaps include lack of error handling or performance details, but it's largely sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It thoroughly explains all 5 parameters, including their purposes, defaults, and interactions (e.g., field logic for title/abstract/keywords), adding significant value beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Search PubMed') and resource ('article JSON objects'), with no siblings to distinguish from. It provides a complete picture of what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for searching PubMed articles but provides no explicit guidance on when to use this tool versus alternatives, prerequisites, or error conditions. With no sibling tools, this is less critical but still a gap.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
- First observed
search_pubmed
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'search_pubmed' has a clearly defined and distinct purpose for searching PubMed articles.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'search_pubmed' follows a clear verb_noun pattern that would be appropriate if more tools were added.
A single tool for a PubMed server is too minimal for the apparent scope. While search is a core function, a complete PubMed interface would typically include tools for fetching article details, citations, related articles, or filtering by metadata. One tool feels thin and incomplete.
The tool surface is severely incomplete for a PubMed domain. It only provides search functionality, missing essential operations like retrieving specific articles by PMID, fetching citations, accessing related articles, or filtering by date/journal. This will cause significant agent failures when trying to perform comprehensive PubMed tasks.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Search biomedical literature, get article details, find related articles, and explore MeSH terms
Search PubMed with precision using keyword and journal filters and smart sorting. Uncover MeSH ter…
Search PubMed/Europe PMC, fetch articles and full text (PMC/EPMC/Unpaywall), citations, MeSH terms.
Search 36M+ PubMed biomedical articles and ClinicalTrials.gov studies.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to search and retrieve biomedical research articles from PubMed's database of over 35 million citations, including metadata, abstracts, MeSH terms, and full-text PDFs when available.11MIT
- FlicenseNot gradedqualityCmaintenanceEnables searching PubMed's biomedical literature database and retrieving article metadata, abstracts, and full content through the E-utilities API. Supports advanced queries, batch operations, and multiple output formats with automatic rate limiting.1-
- FlicenseNot gradedqualityDmaintenanceProvides seamless access to over 35 million PubMed scientific articles through natural language queries for research discovery and analysis. It enables tools for advanced searches, retrieving article details, and exploring related research within the life sciences and biomedical fields.12-
- AlicenseNot gradedqualityCmaintenanceEnables searching and retrieving biomedical literature from PubMed via the NCBI E-utilities API.141MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/emi-dm/PubMed-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server