- ้จ็ฝฒๆจกๅผ็ธฝ่ฆฝ
- Microsoft Copilot Studio ๆดๅ โญ NEW
- ๅฟซ้้ๅง
- HTTPS ้จ็ฝฒ (ๆจ่ฆ)
- Docker ้จ็ฝฒ
- ๅฎขๆถ็ซฏ้ ็ฝฎ
- ๅฎๅ จๅปบ่ญฐ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Deployment Options โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโค
โ HTTP (Dev) โ Streamable โ MCP stdio โ HTTPS (Production) โ
โ (Port 8765) โ HTTP (8765) โ (Local) โ (Nginx + TLS) โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
Quick test โ โ
Copilot โ โ
Claude โ โ
Production deploy โ
โ โ Studio โ Desktop โ โ
Secure connections โ
โ โ โ
M365 Copilot โ โ
VS Code โ โ
Rate limiting โ
โ โ โ
Docker/Cloud โ Copilot โ โ
TLS 1.2/1.3 โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ
| Mode | Protocol | Port | Best For |
|---|---|---|---|
| stdio | MCP stdio | - | Local Claude Desktop, VS Code Copilot |
| streamable-http | Streamable HTTP | 8765 | Microsoft Copilot Studio, M365 Copilot โญ |
| sse | MCP over SSE | 8765 | Other remote MCP clients (deprecated in some platforms) |
| https | HTTPS (Nginx) | 443 | Production with TLS encryption ๐ |
ๅฐ PubMed Search MCP ๆดๅๅฐ Microsoft 365 Copilot (Word, Teams, etc.)๏ผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Microsoft 365 โ
โ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โ
โ โ Word โ โ Teams โ โ Outlook โ โ Copilot โ โ
โ โโโโโโฌโโโโโ โโโโโโฌโโโโโ โโโโโโฌโโโโโ โโโโโโฌโโโโโ โ
โ โโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโโโ โ
โ โ โ
โ Copilot Studio โ
โ (Declarative Agent) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Streamable HTTP
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PubMed Search MCP โ
โ /mcp endpoint โ
โ โ
โ โข 35+ Tools โ
โ โข PICO Analysis โ
โ โข Full Text Access โ
โ โข Citation Export โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| ้ ็ฎ | ้ๆฑ |
|---|---|
| Transport | Streamable HTTP (SSE ๅทฒๆผ 2025/8 ่ตทๅ็จ) |
| URL | ๅ ฌ้ๅฏ่จชๅ็ HTTPS URL |
| Endpoint | /mcp |
| ่ช่ญ | None, API Key, ๆ OAuth 2.0 |
# ๅๅ่
ณๆฌ (ๅซ ngrok)
./scripts/start-copilot-studio.sh --with-ngrok
# ่ผธๅบ้กไผผ๏ผ
# โ
Server ready for Copilot Studio!
# Server URL: https://abc123.ngrok.io/mcp# Railway (ๆจ่ฆ๏ผๆๅ
่ฒป้กๅบฆ)
railway up
# ๆ Azure Container Apps
az containerapp create \
--name pubmed-mcp \
--resource-group myRG \
--image u9401066/pubmed-search-mcp \
--target-port 8765 \
--env-vars MCP_TRANSPORT=streamable-http- ๅๅพ Copilot Studio
- ๅตๅปบๆ้ธๆ Agent โ Tools โ Add a tool โ New tool
- ้ธๆ Model Context Protocol
- ๅกซๅ ฅ๏ผ
| ๆฌไฝ | ๅผ |
|---|---|
| Server name | PubMed Search |
| Server description | ๆๅฐ PubMed ้ซๅญธๆ็ป (3300่ฌ+)ใMeSH ๆดๅฑใPICO ่จๅบๅๆใEurope PMC/CORE ๅ
จๆใๅบๅ /ๅๅ็ฉ็ ็ฉถใๅผ็จๅฏๅบ |
| Server URL | https://your-server.com/mcp |
| Authentication | None (ๆ้
็ฝฎ API Key) |
- Create โ Add to agent โ Publish
็ผๅธๅพ๏ผๅจ Word ไธญ๏ผ
- ๆ้ Copilot ๅด้ๆฌ
- ้ธๆ PubMed Search Agent
- ้ๅงๅฐ่ฉฑ๏ผ
- ใๆๅฐ diabetes treatment ็ๆๆฐ็ ็ฉถใ
- ใๅๆ้ๅ่จๅบๅ้ก๏ผAspirin vs Clopidogrel ้ ้ฒไธญ้ขจใ
- ใๆพๅบ BRCA1 ๅบๅ ็ธ้็ๆ็ปใ
Copilot Studio ๆ่ชๅ็ผ็พๆๆๅทฅๅ ท๏ผ
| ้กๅฅ | ๅทฅๅ ท |
|---|---|
| ๆๅฐ | search_literature, search_europe_pmc, search_core |
| ๅๆ | parse_pico, generate_search_queries, merge_search_results |
| ็ผ็พ | find_related_articles, find_citing_articles, build_citation_tree |
| ๅ จๆ | get_fulltext, get_fulltext_xml, get_core_fulltext |
| NCBI | search_gene, search_compound, search_clinvar |
| ๅฏๅบ | prepare_export (RIS, BibTeX, CSV) |
# Clone repo
git clone https://github.com/u9401066/pubmed-search-mcp.git
cd pubmed-search-mcp
# ๅปบ็ซ่ๆฌ็ฐๅข
python3 -m venv .venv
source .venv/bin/activate
# ๅฎ่ฃๅฅไปถ
pip install -e ".[all]"# Streamable HTTP ๆจกๅผ (ๆจ่ฆ - Copilot Studio ็ธๅฎน)
python run_server.py --transport streamable-http --port 8765 --email your@email.com
# SSE ๆจกๅผ (โ ๏ธ ๅทฒๆผ 2025/8 ่ตทๅจ Copilot Studio ๆฃ็จ)
python run_server.py --transport sse --port 8765 --email your@email.com# Streamable HTTP ๆจกๅผ
curl -X POST http://localhost:8765/mcp
# SSE ๆจกๅผ
curl http://localhost:8765/sse# ่จญ็ฝฎ็ฐๅข่ฎๆธ
export NCBI_EMAIL="your@email.com"
export NCBI_API_KEY="your_api_key" # ๅฏ้ธ๏ผๆ้ซ่ซๆฑ้ๅถ
# ๅๅๆๅ (้ ่จญ streamable-http)
python run_server.py --port 8765ๅตๅปบ /etc/systemd/system/pubmed-mcp.service:
[Unit]
Description=PubMed Search MCP Server
After=network.target
[Service]
Type=simple
User=your_user
WorkingDirectory=/path/to/pubmed-search-mcp
Environment=NCBI_EMAIL=your@email.com
Environment=NCBI_API_KEY=your_api_key
ExecStart=/path/to/pubmed-search-mcp/.venv/bin/python run_server.py --transport streamable-http --port 8765
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetๅๅๆๅ:
sudo systemctl daemon-reload
sudo systemctl enable pubmed-mcp
sudo systemctl start pubmed-mcpๅตๅปบ Dockerfile:
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install -e ".[all]"
EXPOSE 8765
ENV NCBI_EMAIL=pubmed-search@example.com
CMD ["python", "run_server.py", "--transport", "sse", "--port", "8765"]ๆงๅปบไธฆ้่ก:
docker build -t pubmed-mcp .
docker run -d -p 8765:8765 -e NCBI_EMAIL=your@email.com pubmed-mcp็บ็็ข็ฐๅขๆไพๅฎๅ จ็ HTTPS ้ฃ็ท๏ผไฝฟ็จ Nginx ๅๅไปฃ็่็ TLS ็ตๆญขใ
HTTPS (TLS 1.2/1.3)
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Nginx Reverse Proxy โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โข TLS Termination (SSL Certificates) โ โ
โ โ โข Rate Limiting (30 req/s) โ โ
โ โ โข Security Headers (XSS, CSRF protection) โ โ
โ โ โข SSE Optimization (24h timeout, no buffer) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP (internal)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PubMed Search MCP โ
โ (Port 8765) โ
โ โ
โ โข /sse โ
โ โข /messages โ
โ โข /exports โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# Step 1: ็ๆ SSL ๆ่ญ
chmod +x scripts/generate-ssl-certs.sh
./scripts/generate-ssl-certs.sh
# Step 2: ๅๅ HTTPS ๆๅ
./scripts/start-https-docker.sh up
# ๅ
ถไปๅฝไปค
./scripts/start-https-docker.sh down # ๅๆญขๆๅ
./scripts/start-https-docker.sh logs # ๆฅ็ๆฅ่ช
./scripts/start-https-docker.sh restart # ้ๅๆๅ
./scripts/start-https-docker.sh status # ๆฅ็็ๆ
็ซฏ้ป | Endpoints:
| Service | URL | Description |
|---|---|---|
| MCP SSE | https://localhost/ |
MCP Server root |
| MCP SSE | https://localhost/sse |
SSE connection |
| Health | https://localhost/health |
Health check |
| Exports | https://localhost/exports |
Export files |
ไฝฟ็จ Uvicorn ๅ็ SSL ๆฏๆด้ฒ่กๆฌๅฐๆธฌ่ฉฆใ
# Step 1: ็ๆ SSL ๆ่ญ
./scripts/generate-ssl-certs.sh
# Step 2: ๅๅ HTTPS ๆๅ
./scripts/start-https-local.sh
# ๅๆญขๆๅ
./scripts/start-https-local.sh stop็ซฏ้ป | Endpoints:
| Service | URL | Description |
|---|---|---|
| MCP SSE | https://localhost:8443/ |
MCP Server |
| MCP SSE | https://localhost:8443/sse |
SSE connection |
{
"mcpServers": {
"pubmed-search": {
"url": "https://localhost/sse"
}
}
}็็ข็ฐๅขไฝฟ็จๅฏฆ้็ถฒๅ๏ผ
{
"mcpServers": {
"pubmed-search": {
"url": "https://mcp.your-domain.com/sse"
}
}
}Linux (Ubuntu/Debian):
sudo cp nginx/ssl/ca.crt /usr/local/share/ca-certificates/pubmed-mcp-dev.crt
sudo update-ca-certificatesmacOS:
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain nginx/ssl/ca.crtWindows:
้ๆ ca.crt โ ๅฎ่ฃๆ่ญ โ ๆฌๆฉ้ป่
ฆ โ ๅไฟกไปป็ๆ นๆ่ญๆๆฌ
| File | Description |
|---|---|
nginx/nginx.conf |
Nginx ่จญๅฎ (TLS, rate limiting, SSE optimization) |
docker-compose.https.yml |
Docker Compose for HTTPS deployment |
scripts/generate-ssl-certs.sh |
็ๆ่ช็ฐฝ SSL ๆ่ญ |
scripts/start-https-docker.sh |
Docker HTTPS ๅๅ่ ณๆฌ |
scripts/start-https-local.sh |
ๆฌๅฐ HTTPS ๅๅ่ ณๆฌ |
# ๅๅๆๅ
docker-compose up -d
# ๆฅ็ๆฅ่ช
docker-compose logs -f
# ๅๆญขๆๅ
docker-compose downๅจๅ
ถไปไธปๆฉ็ .vscode/mcp.json ไธญๆทปๅ :
{
"servers": {
"pubmed-search": {
"type": "sse",
"url": "http://YOUR_SERVER_IP:8765/sse"
}
}
}ๅจ claude_desktop_config.json ไธญๆทปๅ :
{
"mcpServers": {
"pubmed-search": {
"command": "npx",
"args": [
"mcp-remote",
"http://YOUR_SERVER_IP:8765/sse"
]
}
}
}from mcp.client.sse import sse_client
from mcp import ClientSession
import asyncio
async def main():
async with sse_client("http://YOUR_SERVER_IP:8765/sse") as streams:
async with ClientSession(*streams) as session:
await session.initialize()
# ๆๅฐๆ็ป
result = await session.call_tool(
"search_literature",
arguments={
"query": "diabetes treatment",
"limit": 5
}
)
print(result.content[0].text)
asyncio.run(main())| ๅทฅๅ ทๅ็จฑ | ่ชชๆ |
|---|---|
search_literature |
ๆๅฐ PubMed ๆ็ป |
find_related_articles |
ๅฐๆพ็ธ้ๆ็ซ |
find_citing_articles |
ๅฐๆพๅผ็จๆ็ซ |
fetch_article_details |
็ฒๅๆ็ซ ่ฉณ็ดฐ่ณ่จ |
generate_search_queries |
็ๆๅคๅๆๅฐๆฅ่ฉข |
merge_search_results |
ๅไฝตๆๅฐ็ตๆ |
expand_search_queries |
ๆดๅฑๆๅฐๆฅ่ฉข |
# UFW
sudo ufw allow 8765/tcp
# iptables
sudo iptables -A INPUT -p tcp --dport 8765 -j ACCEPTserver {
listen 443 ssl;
server_name mcp.yourdomain.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://127.0.0.1:8765;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 86400; # SSE ้่ฆ้ท้ฃๆฅ
}
}-
็ขบ่ชๆๅๆญฃๅจ้่ก:
curl http://localhost:8765/sse
-
ๆชขๆฅ้ฒ็ซ็่จญๅฎ
-
็ขบ่ช IP ๅฐๅๅฏ้
- ็ขบ่ช NCBI_EMAIL ๅทฒ่จญๅฎ
- ๅฆๆ่ซๆฑ้ ป็น๏ผ่ๆ ฎ็ณ่ซ NCBI API Key
- ไฝฟ็จ HTTPS: ๅจ็็ข็ฐๅขไธญ๏ผ้้ๅๅไปฃ็ๅ็จ SSL/TLS
- ้ๅถ่จชๅ: ไฝฟ็จ้ฒ็ซ็้ๅถๅฏ้ฃๆฅ็ IP
- API Key: ไฝฟ็จ NCBI API Key ๆ้ซ่ซๆฑ้ๅถไธฆ่ฟฝ่นคไฝฟ็จ
- ็ฃๆง: ่จญๅฎๆฅ่ช็ฃๆง็ฐๅธธๆดปๅ