Skip to main content

PubTator3 API compatible with the MCP agent protocol

Project description

Pubtator MCP Server

This project provides an async Python server for interacting with the PubTator3 API. It exposes multiple biomedical text-mining tools compatible with the MCP agent protocol, supporting tasks such as entity lookup, biomedical literature search, and text extraction from PubMed/PMC articles.

Features

  • Entity Autocomplete: Find biomedical entities (genes, diseases, chemicals, variants) using free-text queries.
  • Literature Search: Search the PubTator3 database using keywords, entity IDs, or entity relations.
  • Article Retrieval: Download and extract text from PubMed/PMC articles in multiple formats.
  • Find Related Entities: Query for entities related to a given identifier via customizable relation and type filters.
  • Async and Fast: Uses aiohttp for non-blocking HTTP requests; designed for integration into broader MCP environments.

Available Tools

The server provides the following tools to interact with the PubTator3 API, accessible via the MCP protocol. These tools allow programmatic access to biomedical concept lookup, literature search, full-text extraction, and entity relation discovery.

1. find_entity

  • Purpose: Find the identifier(s) for a specific bioconcept using a free text query.
  • Input:
    • query (string, required): Free text of the concept to look up (e.g. "breast cancer", "BRCA1").
    • bioconcept (string, optional): Restrict results to a concept type: one of 'disease', 'gene', 'chemical', 'variant'.
    • limit (integer, optional): Maximum number of results (default 10, max 50).
  • Returns:
    A list of matching entities, each with PubTator identifiers, labels, and concept types.

2. search_pubtator

  • Purpose: Search for relevant PubMed/PMC articles in PubTator3 using flexible queries.
  • Input:
    • query (string, required): Free text, PubTator concept ID, or a relations query.
    • relation (string, optional): Specific relation type (default 'ANY').
    • limit (integer, optional): Number of results to retrieve (default 10, max 50).
  • Returns:
    A JSON list including article IDs and brief summaries.

3. get_paper_text

  • Purpose: Download and extract the text content from a PubMed or PMC article.
  • Input:
    • pmid or pmcid (string, required): Article identifier (PubMed ID or PMC ID).
  • Returns:
    The plain text content of the article if available.

4. find_related_entities

  • Purpose: Find entities related to a specific PubTator entity, filtered by relation type or entity type.
  • Input:
    • entity_id (string, required): The PubTator entity ID to query (e.g., @GENE_BRCA1).
    • relation_type (string, optional): Restrict relations by type (e.g., 'interacts_with', 'associated_with').
    • entity_type (string, optional): Restrict related entities to a concept type.
  • Returns:
    A pretty-printed JSON with related entity IDs and relation details.

Each tool's full input schema, description, and examples are provided in the list_tools endpoint within server.py.
Use these tools to integrate sophisticated PubTator3-powered biomedical knowledge access in compatible platforms or agents.

Installation

  1. Installation 3.10+ and required libraries (see below).
    pip install mcp-server-pubtator3
    
  2. Run the server:
    python -m mcp-server-pubtator3
    
    or
    uv run mcp-server-pubtator3
    

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

mcp_server_pubtator3-0.1.5.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

mcp_server_pubtator3-0.1.5-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_pubtator3-0.1.5.tar.gz.

File metadata

  • Download URL: mcp_server_pubtator3-0.1.5.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for mcp_server_pubtator3-0.1.5.tar.gz
Algorithm Hash digest
SHA256 d8f816252e04dc0ccb9db4285b5561169efd3afe04ff24a6af9915fe06318f18
MD5 b9c4bc7bd32c809763eb7c0b3ea29f29
BLAKE2b-256 cf4adb7a08e8088f69f4f29fc8417e6449f17dc26a8ef412dae1f48e5580c5be

See more details on using hashes here.

File details

Details for the file mcp_server_pubtator3-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_pubtator3-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 05c8a9415c64d343bb58e42a50bcc1d27b7cde1b1590327de7aa0a2e4cea6f5c
MD5 c9732397f50f257398a28dbcd25f5b1e
BLAKE2b-256 9c6de0f365755a35b8803f1fa732a1b4238098f046d25fe9d579e239f5d417a3

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