Skip to main content

PubMed search, fetch, and parse library with optional MCP server for AI agents

Project description

pubmed-lib

PubMed search, fetch, and parse for Python apps and AI agents.

MCP quickstart

uv add "pubmed-lib[mcp]"
export ENTREZ_EMAIL=you@example.com
pubmed-mcp

Add to Cursor mcp.json (local repo — adjust path):

{
  "mcpServers": {
    "pubmed": {
      "command": "uv",
      "args": ["--directory", "/Users/matu/Xcode/pubmed_lib", "run", "pubmed-mcp"],
      "env": {
        "ENTREZ_EMAIL": "you@example.com"
      }
    }
  }
}

After PyPI publish, you can use "command": "uvx", "args": ["pubmed-mcp"] instead.

Remote SSE:

MCP_API_KEY=<32+ chars> ENTREZ_EMAIL=you@example.com \
  pubmed-mcp --transport sse --port 8000

See docs/mcp.md for tool reference and security notes.

Python library

uv add pubmed-lib
from pubmed_lib import PubMedClient

client = PubMedClient(email="you@example.com")
response = client.search_articles("diabetes", max_results=5)
for article in response.articles:
    print(article.summary)

See docs/library.md and docs/models.md.

Development

uv sync --all-extras --dev
uv run pytest

See docs/contributing.md and MIGRATION.md.

License

Apache-2.0

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

pubmed_lib-1.0.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

pubmed_lib-1.0.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file pubmed_lib-1.0.0.tar.gz.

File metadata

  • Download URL: pubmed_lib-1.0.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.16

File hashes

Hashes for pubmed_lib-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1d33bb7852049ff9c27336f9583c879398a7124cee8018f3867f347476dd9e7e
MD5 5b701b1b08fc11353698145a7bdf1cc2
BLAKE2b-256 c3afda48c0f8966265b0a7eaea77873c2c56ad5efe7c509469385071c7abe0e0

See more details on using hashes here.

File details

Details for the file pubmed_lib-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pubmed_lib-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.16

File hashes

Hashes for pubmed_lib-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6700374931edd601dddc2667961ae464b133229f060cd70b786c2275f4b0ebf
MD5 9f11cef3b124cf7ba6c927cb69cdd5a6
BLAKE2b-256 a9b56075b51f1f47440e70ab1f6cb941433fcb51ea4edb8ee5d5d1cf54aed981

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