Skip to content

Comments

feat: add PubMed Search MCP server (31 literature research tools)#64

Open
u9401066 wants to merge 1 commit intomims-harvard:mainfrom
u9401066:feature/add-pubmed-search-mcp
Open

feat: add PubMed Search MCP server (31 literature research tools)#64
u9401066 wants to merge 1 commit intomims-harvard:mainfrom
u9401066:feature/add-pubmed-search-mcp

Conversation

@u9401066
Copy link

@u9401066 u9401066 commented Jan 21, 2026

Description

Add PubMed Search MCP, a professional literature research assistant MCP server with 31 tools for comprehensive biomedical research.

Changes Made

  • MCP Server: Complete MCP server via uvx pubmed-search-mcp
  • Configuration: 31 tools in data/remote_tools/pubmed_search_mcp_tools.json

File Structure (in pubmed-search-mcp repo)

src/pubmed_search/
 mcp/
    server.py              # MCP server entry point
    tools/
        discovery.py       # search, related, citing, details, metrics
        strategy.py        # generate_queries, analyze_query
        pico.py            # parse_pico
        citation_tree.py   # build_citation_tree, suggest_citation_tree
        europe_pmc.py      # get_fulltext, get_text_mined_terms
        export.py          # prepare_export
        ncbi_extended.py   # gene, compound, clinvar tools
        openurl.py         # institutional access tools
        vision_search.py   # figure analysis tools
        unified.py         # unified_search
 sources/                   # API clients
    europe_pmc.py          # Europe PMC client
    semantic_scholar.py    # Semantic Scholar client
    openalex.py            # OpenAlex client
    core.py                # CORE client
    ncbi_extended.py       # Gene, PubChem, ClinVar
 session.py                 # Session management

Tools Included (31 tools)

Core Search & Strategy (4)

Tool File Description
pubmed_unified_search unified.py Multi-source search
pubmed_analyze_search_query unified.py Query analysis
pubmed_parse_pico pico.py PICO parsing
pubmed_generate_search_queries strategy.py MeSH expansion

Discovery & Citation (7)

Tool File Description
pubmed_find_related_articles discovery.py Similar articles
pubmed_find_citing_articles discovery.py Forward citation
pubmed_get_article_references discovery.py Backward citation
pubmed_fetch_article_details discovery.py Article metadata
pubmed_get_citation_metrics discovery.py iCite RCR metrics
pubmed_build_citation_tree citation_tree.py Citation network
pubmed_suggest_citation_tree citation_tree.py Tree evaluation

Full Text & Export (3)

Tool File Description
pubmed_get_fulltext europe_pmc.py Structured full text
pubmed_get_text_mined_terms europe_pmc.py Text-mined annotations
pubmed_prepare_export export.py RIS/BibTeX/CSV export

NCBI Extended (7)

Tool File Description
pubmed_search_gene ncbi_extended.py Gene search
pubmed_get_gene_details ncbi_extended.py Gene details
pubmed_get_gene_literature ncbi_extended.py Gene literature
pubmed_search_compound ncbi_extended.py PubChem search
pubmed_get_compound_details ncbi_extended.py Compound details
pubmed_get_compound_literature ncbi_extended.py Compound literature
pubmed_search_clinvar ncbi_extended.py ClinVar variants

Vision & Institutional (6)

Tool File Description
pubmed_analyze_figure_for_search vision_search.py Figure analysis
pubmed_reverse_image_search vision_search.py Reverse image search
pubmed_configure_institutional_access openurl.py OpenURL config
pubmed_get_institutional_link openurl.py Access link
pubmed_list_resolver_presets openurl.py Resolver presets
pubmed_test_institutional_access openurl.py Test access

Session Management (4)

Tool File Description
pubmed_get_session_pmids session_tools.py Cached PMIDs
pubmed_list_search_history session_tools.py Search history
pubmed_get_cached_article session_tools.py Cached retrieval
pubmed_get_session_summary session_tools.py Session summary

Additional AI Agent Support

This tool also includes 22 Claude Skill files (.claude/skills/) that provide:

  • Step-by-step workflow guidance for AI agents
  • Decision trees for search strategy selection
  • Code examples ready for immediate use

Available Skills:

  • pubmed-quick-search - Basic PubMed search with advanced filters
  • pubmed-systematic-search - MeSH expansion, comprehensive search
  • pubmed-pico-search - PICO clinical question decomposition
  • pubmed-paper-exploration - Citation tree, related articles
  • pubmed-gene-drug-research - Gene, PubChem, ClinVar integration
  • pubmed-fulltext-access - Europe PMC, CORE full text retrieval
  • pubmed-export-citations - RIS, BibTeX, CSV export
  • pubmed-multi-source-search - Cross-database search strategy
  • pubmed-mcp-tools-reference - Complete tools reference

Note: Skill files are Claude Code-specific (.claude/skills/*/SKILL.md). ToolUniverse uses JSON configs for tool integration, which is already provided in this PR. If TU adds similar workflow guidance support in the future, these skills can be adapted.

Test Results

Check Status Details
pytest Pass 565 passed, 13 skipped (578 total)
ruff lint Pass All checks passed
bandit security Pass No high severity issues

Server Information

Checklist

  • JSON config valid (31 tools)
  • Published on PyPI
  • Documentation complete
  • Tests passing (565/578)
  • Security scan passed
  • Claude Skills included (22 workflow guides)

@u9401066 u9401066 changed the title feat: add PubMed Search MCP server (35+ literature research tools) feat: add PubMed Search MCP server (31 literature research tools) Jan 21, 2026
@u9401066
Copy link
Author

Hi maintainers,

Thank you for reviewing this PR! I wanted to share some context about the design decisions:

Regarding local vs. remote MCP integration:
I'm not entirely sure if this MCP server should be built-in as a local tool in ToolUniverse, given:

  • It has several dependencies (biopython, requests, pylatexenc, etc.)
  • There might be some overlap with existing search functionality in TU

Development approach:
This project was developed collaboratively with GitHub Copilot + Claude Opus, following:

  • Domain-Driven Design (DDD) architecture
  • Comprehensive automated checks (pytest, ruff lint, bandit security)
  • 90%+ test coverage

Key features designed for AI agents:

  • Auto-correction: ESpell integration for typo fixes (remifentanyl remifentanil)
  • MeSH auto-expansion: Automatic conversion to Medical Subject Headings + synonyms
  • Advanced search filters: All PubMed field tags that human users can set are exposed to agents (age groups, sex, species, language, publication types, clinical queries, etc.)
  • PICO parsing: Clinical question decomposition (Patient/Intervention/Comparison/Outcome)
  • Multi-source parallel search: Simultaneous queries across PubMed, Europe PMC, CORE, Semantic Scholar, OpenAlex
  • Agent-friendly output: Structured responses optimized for LLM decision-making

The goal is to make literature research as accessible to AI agents as it is to human researchers.

Feedback welcome!
I'm happy to make adjustments based on your suggestions. If there are specific modifications needed for better TU integration, please let me know!

@gasvn
Copy link
Member

gasvn commented Jan 21, 2026

Thank you, @u9401066! These are great tools. Given that the dependencies are lightweight and we already have some PubMed-related tools, would it be possible to make them local tools in ToolUniverse? You can refer to this doc for guidance: https://github.com/mims-harvard/ToolUniverse/blob/main/tool_implementation_guide.md
Since remote tools need to be activated by users or require the MCP server to already be available, it would be better to make them local tools to ensure broader usage.

@u9401066 u9401066 force-pushed the feature/add-pubmed-search-mcp branch 2 times, most recently from 800c9ab to 0d6ad1f Compare January 22, 2026 03:37
Integrates pubmed-search-mcp v0.1.29 as local tools.

Streamlined from 35+ to 25 core tools by removing duplicate functionality:
- unified_search replaces multiple source-specific search tools
- Removed redundant merge/expand tools (auto-executed internally)

Categories (25 tools total):
- Core Search (1): unified_search
- Query Intelligence (2): parse_pico, generate_queries
- Article Exploration (5): fetch, related, citing, references, metrics
- Fulltext (2): get_fulltext, get_text_mined_terms
- NCBI Extended (7): gene/compound/clinvar
- Citation Network (2): build_tree, suggest_tree
- Export (1): export_citations
- Vision Search (2): analyze_figure, reverse_image_search
- OpenURL/Institutional (3): configure, get_link, list_presets

Install: pip install tooluniverse[pubmed]
@u9401066 u9401066 force-pushed the feature/add-pubmed-search-mcp branch from 0d6ad1f to 4def17d Compare January 22, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants