Skip to main content

A Model Context Protocol (MCP) server for PubMed biomedical research database

Project description

AutoCleanEEG PubMed MCP Server

A Model Context Protocol (MCP) server that provides access to PubMed, the comprehensive biomedical literature database maintained by NCBI. This server enables AI assistants like Claude to search and retrieve detailed information from millions of biomedical research articles.

Features

  • Search PubMed Database: Search across 39+ million biomedical articles using flexible query syntax
  • Retrieve Article Details: Get complete article metadata, abstracts, authors, and publication information
  • Database Information: Access current PubMed database statistics and status
  • API Key Support: Optional NCBI API key integration for enhanced rate limits
  • MCP Protocol: Full Model Context Protocol compliance for seamless AI assistant integration

Installation

From PyPI (Recommended)

pip install autocleaneeg-pubmedmcp

From Source

git clone <repository-url>
cd claude_code_docker
pip install -e .

Usage

As MCP Server

The server can be run directly:

autocleaneeg-pubmedmcp

Claude Desktop Integration

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "pubmed": {
      "command": "autocleaneeg-pubmedmcp",
      "args": [],
      "env": {
        "PUBMED_API_KEY": "your_api_key_here_optional"
      }
    }
  }
}

API Key Setup (Optional)

For enhanced rate limits, obtain a free API key from NCBI:

  1. Visit NCBI API Key Settings
  2. Create an account or log in
  3. Generate an API key
  4. Set environment variable: export PUBMED_API_KEY="your_key_here"

Available Tools

search_pubmed

Search the PubMed database with flexible query syntax.

Parameters:

  • term (required): Search query using PubMed syntax
  • retmax (optional): Maximum results to return (1-1000, default: 20)
  • email (optional): Your email for NCBI tracking

Example:

{
  "term": "BRCA1 mutations AND breast cancer",
  "retmax": 10
}

get_pubmed_details

Retrieve detailed information for specific PubMed articles.

Parameters:

  • id (required): PubMed ID(s) - single ID or array of IDs

Example:

{
  "id": ["35123456", "35789012"]
}

get_pubmed_info

Get current information about the PubMed database.

Parameters: None

Query Syntax Examples

  • Basic search: "covid vaccine"
  • Multiple terms: "BRCA1 AND breast cancer"
  • Author search: "Smith J[Author]"
  • Date range: "covid vaccine" AND 2020:2023[dp]
  • Journal: "Nature[Journal]"
  • Title search: "machine learning"[Title]

Error Handling

The server provides comprehensive error handling for:

  • Invalid queries or parameters
  • Network connectivity issues
  • Rate limiting (automatically handled)
  • Invalid PubMed IDs
  • API key validation

Development

Testing

Run the test suite:

python test_focused.py

Requirements

  • Python 3.10+
  • httpx>=0.25.0
  • mcp>=1.0.0
  • pydantic>=2.0.0
  • email-validator>=2.0.0

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues.

Support

For issues and questions:

  • Check the troubleshooting section below
  • Open an issue on the repository

Troubleshooting

Connection Issues

  • Verify internet connectivity
  • Check if NCBI servers are accessible
  • Ensure firewall allows outbound HTTPS connections

Rate Limiting

  • Consider adding a PUBMED_API_KEY for higher limits
  • Reduce query frequency
  • Check NCBI rate limiting guidelines

Invalid Results

  • Verify PubMed ID format (numeric)
  • Check query syntax against PubMed documentation
  • Ensure search terms are properly formatted

Made with ❤️ for biomedical research and AI assistance

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autocleaneeg_pubmedmcp-1.1.4.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autocleaneeg_pubmedmcp-1.1.4-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file autocleaneeg_pubmedmcp-1.1.4.tar.gz.

File metadata

File hashes

Hashes for autocleaneeg_pubmedmcp-1.1.4.tar.gz
Algorithm Hash digest
SHA256 014c1b2b28fe1f666dc998b6e54fe3f8eafe8a4964ae90d7d24fba89853ebc0f
MD5 3dc26701dce9d4a0febd0cd338500275
BLAKE2b-256 3b69ea7a620f8fb4c1f764d5534bdfad57192b272b321d6213a081e63c2f8870

See more details on using hashes here.

File details

Details for the file autocleaneeg_pubmedmcp-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for autocleaneeg_pubmedmcp-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d0363a1e849995ac49cf4723c50949ab37e05ac5d221c55d3f5cc10816585c1d
MD5 2cec52cc5aed0383036992923b6e0fb5
BLAKE2b-256 dd830b36a11d868bb8b1b85338d2bc2329e5f35d9a305e6e5b75ded59ad764c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page