Install MCP Simple PubMed via Smithery
masterTo automatically install Simple PubMed for Claude Desktop, use the Smithery CLI with the following command:
npx -y @smithery/cli install mcp-simple-pubmed --client clauderepository·master·Indexed 41 days ago
https://github.com/andybrandt/mcp-simple-pubmedAn MCP (Model Context Protocol) server version 0.1.16 that provides AI assistants with access to PubMed articles via the Entrez API. It enables literature searches, abstract retrieval, and full-text access for open access articles in PubMed Central. The server includes specialized tools for keyword and field-specific searches, as well as prompts for Systematic Review, PICO, and Author searches.
To automatically install Simple PubMed for Claude Desktop, use the Smithery CLI with the following command:
npx -y @smithery/cli install mcp-simple-pubmed --client claudeTo use the server with Claude Desktop, add the following configuration to your claude_desktop_config.json file. Replace the placeholders with your actual email and API key.
// macOS Configuration
{
"mcpServers": {
"simple-pubmed": {
"command": "python",
"args": ["-m", "mcp_simple_pubmed"],
"env": {
"PUBMED_EMAIL": "your-email@example.com",
"PUBMED_API_KEY": "your-api-key"
}
}
}
}You can install the server manually using pip:
pip install mcp-simple-pubmedOn Windows, you must provide the full path to your Python executable in the command field of your claude_desktop_config.json.
{
"mcpServers": {
"simple-pubmed": {
"command": "C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Programs\\Python\\Python311\\python.exe",
"args": [
"-m",
"mcp_simple_pubmed"
],
"env": {
"PUBMED_EMAIL": "your-email@example.com",
"PUBMED_API_KEY": "your-api-key"
}
}
}
}The server requires specific environment variables to interact with the NCBI Entrez API.
PUBMED_EMAIL: Required. Your email address (required by NCBI).PUBMED_API_KEY: Optional. An API key to increase rate limits from 3 requests/second to 10 requests/second.If you encounter [SSL: CERTIFICATE_VERIFY_FAILED] errors on macOS, you must install the Python certificate bundle. Run the following command in your terminal, replacing 3.13 with your specific Python version:
/Applications/Python\ 3.13/Install\ Certificates.command
Note: You must restart Claude Desktop for this change to take effect.
/Applications/Python\ 3.13/Install\ Certificates.commandThe server requires specific environment variables to initialize the PubMedClient and FullTextClient.
Required Environment Variables:
PUBMED_EMAIL: Your email address (required for PubMed API usage).Optional Environment Variables:
PUBMED_TOOL: The name of the tool (defaults to mcp-simple-pubmed).PUBMED_API_KEY: Your PubMed API key.The server provides the following tools for interacting with PubMed:
As of v0.1.14, the server includes prompts to help construct optimized PubMed queries:
The PubMedFetch class provides a client for retrieving the full text content of PubMed articles by leveraging PubMed Central (PMC).
To use it, call the asynchronous get_full_text(pmid) method with a valid PubMed ID (PMID). The method follows this logic:
Note: The method returns the full text as a string on success, or an error message string if the text cannot be retrieved.
from mcp_simple_pubmed.pubmed_fetch import PubMedFetch
# Note: get_full_text is an async method
async def fetch_article():
fetcher = PubMedFetch()
content = await fetcher.get_full_text("12345678")
print(content)To start the MCP server, call the main() function. This function initializes the asynchronous event loop and runs the server's main entry point defined in the package's server module.
from mcp_simple_pubmed import main
if __name__ == "__main__":
main()Search PubMed for medical and life sciences research articles using keyword or field-specific queries.
Search Features:
"covid vaccine"[Title][Author][MeSH Terms][Journal]"2020:2024"[Date - Publication]AND, OR, NOTReturns: A JSON string containing paper titles, authors, publication details, abstract previews, links to full text, DOIs, and keywords/MeSH terms.
Constraints: max_results is constrained between 1 and 50.
# Example usage via tool call
await search_pubmed(query='"breast cancer"[Title] AND "2023"[Date - Publication]', max_results=10)