PubMed Custom Connector MCP Server
Enables users to search and fetch PubMed biomedical literature articles through natural language queries in Microsoft 365 Copilot.
README
PubMed custom federated connector for Microsoft 365 Copilot
A Model Context Protocol (MCP) server that brings the public PubMed biomedical literature database into Microsoft 365 Copilot as a custom federated connector.
Users can ask Copilot natural-language questions ("find recent trials on CRISPR for sickle cell disease") and Copilot calls this server in real time to search and read PubMed articles.
What's in the box
| Path | Purpose |
|---|---|
src/server.py |
MCP server exposing the read-only search and fetch tools |
src/pubmed.py |
Async client for the NCBI E-utilities API (with rate-limit handling) |
src/auth.py |
Microsoft Entra ID bearer-token validation (ASGI middleware) |
src/config.py |
Environment-driven configuration |
src/main.py |
ASGI entrypoint (Uvicorn) |
Dockerfile |
Container image |
azure.yaml, infra/ |
azd + Bicep for Azure Container Apps |
scripts/smoke_test.py |
End-to-end MCP client test |
docs/tenant-setup-guide.md |
Step-by-step tenant configuration + validation guide |
Architecture
Microsoft 365 Copilot
│ (1) user prompt
▼
Copilot orchestrator ──(2) bearer token from Microsoft enterprise token store──┐
│ │
│ (3) MCP search / fetch over HTTPS │
▼ │
Azure Container Apps ──(4) validate Entra JWT (issuer, audience, client app)──┘
│
│ (5) NCBI E-utilities (esearch / esummary / efetch)
▼
PubMed (public)
MCP tools
search(query, max_results)→{ "results": [ { id, title, url, snippet } ] }whereidis the PubMed PMID.fetch(id)→{ id, title, text, url, metadata }wheretextis the article abstract andmetadataincludes journal, authors, publication date, and DOI.
Both tools are read-only.
Quick start (local)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
# Run without auth for local testing
$env:AUTH_REQUIRED = "false"
$env:NCBI_EMAIL = "you@example.com" # recommended by NCBI
python -m src.main
# In another terminal: end-to-end test
python scripts\smoke_test.py
Then point MCP Inspector at
http://localhost:8000/mcp (transport: Streamable HTTP) to explore the tools interactively:
npx @modelcontextprotocol/inspector
Configuration
All configuration is via environment variables (see .env.example):
| Variable | Required | Description |
|---|---|---|
AUTH_REQUIRED |
no (default true) |
Enforce Entra bearer-token validation. |
ENTRA_TENANT_ID |
when auth on | Your Microsoft Entra tenant ID. |
ENTRA_AUDIENCE |
when auth on | Accepted token audience = the Application ID URI from the Teams Developer Portal SSO registration. Comma-separated list allowed. |
ENTRA_ALLOWED_CLIENT_IDS |
no | Allowed calling client app IDs. Defaults to the Microsoft enterprise token store ab3be6b7-f5df-413d-ac2d-abf1e3fd9c0b. |
NCBI_API_KEY |
no | NCBI API key for higher PubMed rate limits (10/sec vs 3/sec). |
NCBI_EMAIL |
no | Contact email reported to NCBI (recommended). |
MCP_PATH |
no (default /mcp) |
Path of the MCP streamable-HTTP endpoint. |
ALLOWED_HOSTS |
no (default *) |
Hosts allowed by the MCP transport-security (DNS-rebinding) check. * disables the check (recommended behind Azure ingress, where Entra auth still applies). Set explicit hostnames to enable strict checking. |
ALLOWED_ORIGINS |
no (default *) |
Origins allowed by the DNS-rebinding check. |
PORT |
no (default 8000) |
Listen port. |
Deploy to Azure
azd auth login
azd env new pubmed-connector
azd env set AUTH_REQUIRED false # first deploy: get the URL, then lock down
azd up
Full deployment, Entra SSO setup, M365 admin center registration, and validation steps are in docs/tenant-setup-guide.md.
Security notes
- The connector exposes only public PubMed data, but the transport is still
authenticated: every
/mcprequest must carry a valid Entra token whose audience matches your Application ID URI and whose calling app is the Microsoft enterprise token store. /healthis intentionally unauthenticated for container liveness probes.- The server is read-only and performs no writes to any system.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.