api + mcp

Combining PubMed Trends API with Anthropic's PubMed MCP

This guide shows how an AI agent chains our trend analytics API with Anthropic's PubMed MCP server to go from signal to substance — discovering what's trending, scoring the key papers, then reading the actual research.


The idea

Our API answers what's happening in biomedical research: which topics are growing, what's spiking this week, which papers matter most. But it returns PMIDs, not full articles.

Anthropic's PubMed MCP server fills the gap. It can search PubMed, fetch article metadata, retrieve full text, and find related articles — all as MCP tool calls that Claude (or any MCP-compatible agent) can invoke directly.

Together, they form a complete research pipeline:

1
PubMed Trends API
Discover — Find what's trending, emerging, or spiking
2
PubMed Trends API
Score — Get ranked key papers with PMIDs via /digest or /keypapers
3
PubMed MCP
Read — Fetch full metadata, abstracts, and citations for each PMID

Worked example: GLP-1 receptor agonists

An agent wants to understand the current research landscape for GLP-1 receptor agonists — a drug class expanding beyond diabetes into obesity, cardiology, and neuroscience.

Step 1: Check the pulse

Start with /pulse to see current activity level. $0.02

GET http://pubmed.sekgen.xyz/api/v1/pulse?query=GLP-1+receptor+agonist
{ "query": "GLP-1 receptor agonist", "current": { "7d": 89, "30d": 342, "90d": 1021 }, "year_ago": { "7d": 61, "30d": 231, "90d": 695 }, "change": { "7d": 0.459, "30d": 0.480, "90d": 0.469 }, "as_of": "2026-02-21" }

+48% year-over-year across all windows. This is a hot and sustained trend, not a one-week spike.

Step 2: Get scored key papers

Call /digest to get the most important recent papers, scored by journal prestige, publication type, MeSH relevance, and cross-strategy frequency. $0.08

GET http://pubmed.sekgen.xyz/api/v1/digest?query=GLP-1+receptor+agonist&start_year=2024&end_year=2026
{ "query": "GLP-1 receptor agonist", "start_year": 2024, "end_year": 2026, "papers": [ { "pmid": "39461342", "title": "Oral orforglipron in participants with type 2 diabetes...", "journal": "N Engl J Med", "pub_year": 2024, "pub_type": "clinical_trial", "score": 7, "score_breakdown": { "top_journal": 3, "review_or_trial": 2, "mesh_major_topic": 0, "multi_strategy_hit": 1, "relevance_rank": 1 } }, { "pmid": "39511425", "title": "GLP-1 receptor agonists and cardiovascular outcomes...", "journal": "Eur Heart J", "pub_year": 2024, "pub_type": "review", "score": 7, "score_breakdown": { "top_journal": 3, "review_or_trial": 2, "mesh_major_topic": 0, "multi_strategy_hit": 1, "relevance_rank": 1 } }, { "pmid": "39294803", "title": "Neuroprotective effects of GLP-1 receptor agonists...", "journal": "J Clin Invest", "pub_year": 2024, "pub_type": "review", "score": 6 } ], "mesh_terms": ["GLP-1 Receptor Agonists", "Diabetes Mellitus, Type 2", "Obesity", "Cardiovascular Diseases", "Neuroprotection"], "authors": [{ "name": "Drucker DJ", "appearances": 3 }] }

The digest reveals the field's three fronts: an oral formulation trial in NEJM, cardiovascular Mendelian randomization in European Heart Journal, and neuroprotection reviews in JCI. The MeSH terms confirm expansion beyond diabetes.

Step 3: Read the papers via PubMed MCP

Pass the PMIDs directly to the MCP's get_article_metadata tool. Free (MCP)

mcp get_article_metadata({ "pmids": ["39461342", "39511425", "39294803"] })
// Returns for each PMID: { "pmid": "39461342", "title": "Oral orforglipron in participants with type 2 diabetes...", "abstract": "BACKGROUND: Orforglipron is a nonpeptide, oral GLP-1 receptor agonist under development for type 2 diabetes and obesity. METHODS: In this phase 3 trial, we randomly assigned 1539 adults with type 2 diabetes to receive once-daily oral orforglipron or placebo for 40 weeks...", "authors": ["Frias JP", "Hsia DS", "Eyde S", "..."], "journal": "N Engl J Med", "publication_date": "2024-11-14", "doi": "10.1056/NEJMoa2403586", "mesh_terms": ["GLP-1 Receptor Agonists", "Administration, Oral", "Diabetes Mellitus, Type 2", "..."] }

The agent now has the full abstracts and can synthesize a research briefing, identify methodology patterns, or compare findings across papers.

Total cost: $0.10 — Pulse ($0.02) + Digest ($0.08). The MCP calls are free. An agent gets from "what's trending?" to reading three key abstracts for a dime.

Other workflow patterns

Weekly category scan

An agent monitors all 5 categories for spikes, then deep-dives the standouts.

stepcallcost
/hottest-weekly × 5 categoriesAPI$0.25
/digest for top 2 topicsAPI$0.16
get_article_metadata for top PMIDsMCPfree
Total$0.41

Competitive landscape

Compare two therapeutic approaches, then read the key papers from each.

stepcallcost
/compare with both termsAPI$0.02
/keypapers for each termAPI$0.06
get_article_metadata for top PMIDsMCPfree
find_related_articles to expandMCPfree
Total$0.08

Niche discovery

Find an emerging field nobody's watching and read the foundational papers.

stepcallcost
/emerging for a categoryAPI$0.05
/trends on the top hitAPI$0.01
/digest on the top hitAPI$0.08
get_full_text_article for open-access papersMCPfree
Total$0.14

PubMed MCP tools reference

These are the Anthropic PubMed MCP tools most useful alongside our API:

tooluse case
search_articlesFree-text PubMed search (useful when you need different queries than our API)
get_article_metadataFetch title, abstract, authors, MeSH for specific PMIDs
get_full_text_articleFull text for open-access articles (PMC)
find_related_articlesExpand from a seed PMID to related papers
get_copyright_statusCheck if full text is available before fetching

Setup

For the API side, you need an x402-compatible client. Coinbase awal handles payment automatically:

awal x402 pay 'http://pubmed.sekgen.xyz/api/v1/digest?query=GLP-1+receptor+agonist'

Or use @x402/fetch programmatically in your agent's code.

For the MCP side, add the PubMed MCP server to your Claude configuration:

{ "mcpServers": { "pubmed": { "command": "npx", "args": ["-y", "@anthropic/pubmed-mcp-server"] } } }

Once configured, Claude can call PubMed MCP tools directly alongside x402 API calls in the same conversation.

← API Reference · Machine-readable docs · Data from NCBI PubMed