CUF Health Portal MCP Server
Enables users to interact with the CUF health portal to retrieve patient information, appointments, clinical documents, invoices, and prescriptions through natural language.
README
CUF Health Portal MCP Server
An MCP (Model Context Protocol) server that exposes the CUF health portal as tools for Claude and other MCP clients.
Tools
| Tool | Description |
|---|---|
get_patient_info |
Patient profile (name, contacts, NIF, SNS number) |
list_appointments |
Upcoming appointments |
list_past_appointments |
Full appointment history |
list_clinical_documents |
Imaging reports, lab reports, clinical files, etc. |
get_clinical_document |
Download a clinical document PDF by ID |
list_exam_results |
Active lab/exam results from the portal |
list_invoices |
All invoices |
get_invoice |
Download an invoice PDF by payment number |
list_prescriptions |
Exam prescriptions (scrapes www.cuf.pt) |
get_prescription |
Download a prescription PDF by download URL |
Downloaded PDFs are saved to ./downloads/cuf/ by default (configurable via OUTPUT_DIR env var).
Setup
Requirements
- uv
- A CUF portal account (saudecuf.pt)
Install
git clone <repo>
cd cuf-mcp
uv sync
Configure credentials
Create a .env file:
CUF_USERNAME=your.email@example.com
CUF_PASSWORD=yourpassword
OUTPUT_DIR=./downloads # optional
Register with Claude Code
Add to ~/.claude/claude_desktop_config.json (or your MCP settings):
{
"mcpServers": {
"cuf-health": {
"command": "uv",
"args": ["run", "--directory", "/path/to/cuf-mcp", "python", "mcp_server.py"]
}
}
}
Then run /mcp in Claude Code to connect.
Run standalone (MCP Inspector)
uv run mcp dev mcp_server.py
Bulk download all records
uv run python download_cuf.py
Downloads all clinical documents and invoices to ./downloads/cuf/.
Architecture
Authentication
The portal uses two separate auth systems:
-
saudecuf.ptGraphQL API — JWT bearer token obtained viaauthenticationMutation. The JWT containspatientId,usercode, andinternalPatientCode. Headers requirex-channel-type-id: 1and a per-requestx-transaction-idUUID. -
cuf.ptDrupal (prescriptions only) — Separate Drupal session cookie (SSESS*) obtained by POSTing tohttps://www.cuf.pt/mycuf/login. Prescriptions are server-rendered HTML, not available via GraphQL.
Key files
mcp_server.py— FastMCP server; defines all 10 tools; lazy-initializes a shared authenticatedCufClientcuf_client.py— AsyncCufClientclass; wraps all GraphQL queries and the prescription scraperdownload_cuf.py— Standalone bulk downloader script
WAF note
The portal runs behind a Barracuda WAF that blocks headless Chromium. Plain httpx with browser-like headers works fine.
Notes
list_exam_resultscurrently returns an empty list — thegetActiveExamResultsGraphQL endpoint requires a separate auth scope not present in the standard JWT.- Prescriptions use
internalPatientCodeas the client identifier, notpatientId. - Invoice
paymentNumberformat:"CCF2026/45291"→docSeries="CCF2026",docNumber="45291".
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。