---
name: iblai-connect-pubmed
description: "Read PubMed (NCBI E-utilities) data through the Entrez Programming Utilities (E-utilities) and expose it to an ibl.ai agent as an MCP tool. Use when the user asks an agent to work with PubMed (NCBI E-utilities) data, or to set up a PubMed (NCBI E-utilities) MCP connection on ibl.ai."
metadata:
  kind: guide
---

# PubMed (NCBI E-utilities) connector for AI agents

> A starting point maintained on ibl.ai at https://ibl.ai/developer/connectors/pubmed — not part of the iblai/base repository. Checked against National Center for Biotechnology Information (NLM)'s documentation on October 20, 2026; test it against your own PubMed (NCBI E-utilities) setup before you rely on it.

PubMed is the National Library of Medicine's database of biomedical literature citations and abstracts. NCBI's E-utilities expose PubMed and the other Entrez databases, such as Gene, ClinVar and MeSH, to programs.

## Auth & conventions

- **API:** Entrez Programming Utilities (E-utilities) (REST (URL parameters; XML or JSON)). Nine utilities: ESearch returns PMIDs for a query, ESummary and EFetch return summaries and full records, ELink finds related records, EPost and the History server batch IDs, EInfo, ESpell, ECitMatch and EGQuery.
- **Base URL:** https://eutils.ncbi.nlm.nih.gov/entrez/eutils/{utility}.fcgi
- **Access:** Public, self-serve. Open without registration. A free API key from the API Key Management area of an NCBI account settings page raises the rate limit. NCBI asks larger jobs to send tool and email parameters.
- **Auth:** None (anonymous); API key (api_key query parameter). No login is needed. Add api_key=YOUR_KEY to any request to use the higher per-key limit; each NCBI account has one key.
- **Limits:** 3 requests per second per IP without a key; 10 per second with an API key. ESummary and EFetch return up to 10,000 records per call. NCBI asks that large jobs run on weekends or 9 PM to 5 AM Eastern on weekdays.
- Keep PubMed (NCBI E-utilities) credentials in environment variables or the ibl.ai credential store. Never print a token in chat and never commit one to a file.
- Destructive or outward-facing calls are marked **Confirm with the user first** — do.

## Reads

- **Search results** — ESearch returns PMIDs matching a PubMed query, up to 100,000 per request.
- **Citations and abstracts** — EFetch returns full records (e.g. PubMed XML with abstracts); ESummary returns document summaries.
- **Related articles and links** — ELink returns related PubMed records and links into other Entrez databases.
- **Citation matching** — ECitMatch resolves citation strings to PMIDs.
- **Database info** — EInfo lists databases and their searchable fields.

## Writes

- None. This skill only reads PubMed (NCBI E-utilities) data.

## Expose it to an ibl.ai agent (MCP)

Community MCP servers wrap E-utilities; we found none published by NCBI or NLM as of December 2026. Host a small MCP server that wraps the calls above, then register it below.

First install the ibl.ai platform skills and connect your organization (writes `IBLAI_ORG`, `IBLAI_USERNAME` and `IBLAI_API_KEY` to `.env`):

```bash
npx skills add iblai/base --all
# then, in your coding agent:
/iblai-api-login
```

Every call below sends `Authorization: Api-Token $IBLAI_API_KEY`.

1. **Register the server** — `POST https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-servers/` with `name`, `url`, `transport` (`sse` | `websocket` | `streamable_http`) and `auth_type` (`none` | `token` | `oauth2`). Capture the returned `id`.
   - For an API key or service credential use `auth_type=token` with `auth_scope=platform` for one key across the organization, or scope it to a single agent for one key per agent.
2. **Create the connection** — `POST https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-server-connections/` with `server`, `scope` (`platform` | `mentor` | `user`), `auth_type`, and either `credentials` + `authorization_scheme` or a `connected_service` id for OAuth. Credentials are masked on read; never send a masked value back.
3. **Enable it on the agent** — `GET https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mentors/{agent_id}/settings/`, add `mcp-tool` to `tool_slugs` and the server id to `mcp_servers`, then `PATCH` the full lists back. They are replaced, not merged.

Full reference: https://ibl.ai/developer/platform/mcp/mcp-connections and the `/iblai-api-agent-mcp` skill.

## Example prompts

- "Find randomized trials of GLP-1 agonists in NASH published since 2023"
- "Fetch the abstracts for these 20 PMIDs and summarize their endpoints"
- "List articles related to PMID 12345678 that mention CRISPR off-target effects"
- "Resolve this reference list to PubMed IDs"

## Guardrails

- PubMed content is public literature metadata; the sensitivity lies in the queries, which can reveal unpublished research direction or drug programs.
- Request the narrowest PubMed (NCBI E-utilities) scopes or role the task needs, and prefer a read-only credential for agents that only answer questions.
- Return the fields the user asked for, not whole records; do not paste personal data into chat that the user did not request.
- Before any write, show the user exactly what will change and wait for a yes.
- Respect the documented limits above: page through results and back off on rate-limit responses instead of retrying in a loop.

## References

- A General Introduction to the E-utilities (NCBI): https://www.ncbi.nlm.nih.gov/books/NBK25497/
- NLM data guide: the nine E-utilities: https://www.nlm.nih.gov/dataguide/eutilities/utilities.html
- New API keys for the E-utilities (NCBI Insights): https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/
- This connector on ibl.ai: https://ibl.ai/developer/connectors/pubmed
- ibl.ai MCP server connections: https://ibl.ai/developer/platform/mcp/mcp-connections
