oncofiles
oncofiles
您的医疗记录散落在 Gmail、Google Drive 和日历中。Oncofiles 可以读取并整理所有内容,并通过 AI 提供支持——让您可以在 Claude 或 ChatGPT 中以自然语言询问您的健康状况。
oncofiles.com | 演示仪表板 | 隐私政策
这是什么?
Oncofiles 是一个专为癌症患者及其护理人员构建的 MCP 服务器。它连接到您的 Google Drive、Gmail 和日历,读取您所有的医疗文档(化验结果、CT 扫描、病理报告、处方),并使它们可以通过任何 AI 聊天工具(Claude、ChatGPT 或任何 MCP 客户端)进行访问。
源于真实需求: 由一位正在照顾患癌妻子的护理人员创建。面对数百份文档、数十位医生以及不断变化的化验结果,Oncofiles 整理了这些混乱,让您可以专注于治疗,而不是寻找纸质文件。
姊妹项目: Oncoteam — 一个分析您 Oncofiles 数据的 AI 代理:跟踪化验趋势、搜索临床试验,并为您的肿瘤科医生准备问题。
您的数据,由您掌控: 所有内容都保留在您的 Google Drive 中。没有第三方数据处理。随时断开连接——您的文件永远属于您。
Related MCP server: atlas_mcp
多患者支持 (v4.0+)
Oncofiles 支持在单个实例中管理多名患者。每位患者享有:
完整的数据隔离 — 文档、化验、治疗事件、电子邮件和日历条目均针对患者进行范围限定
独立的承载令牌 (Bearer Tokens) — 每位患者(或护理人员)拥有自己的
onco_*令牌按患者 OAuth — Google Drive、Gmail 和日历均按患者进行授权
仪表板患者选择器 — 在 Web 仪表板中切换患者
新患者入驻
仪表板向导: 打开仪表板,点击“+ 新患者”,并按照 4 步向导操作
API: 使用
{patient_id, display_name}调用POST /api/patients— 返回一个承载令牌连接 GDrive: 访问
/oauth/authorize/drive?patient_id=X以授权文档同步触发首次同步: 使用
{patient_id}调用POST /api/sync-trigger以导入文档
功能特性
76 个 MCP 工具,涵盖 14 个模块,实现全面的医疗数据管理
14 类文档分类 — 化验、病理、影像、遗传学、手术、咨询、处方等
化验值跟踪 — 存储数值、跟踪趋势、化疗方案的周期前安全检查
Google Drive 同步 — 双向同步,并带有自动 OCR 配套文件
Gmail 和日历扫描 — 自动检测并分类医疗邮件和预约
临床研究 — 搜索 PubMed 和 ClinicalTrials.gov,记录研究决策
治疗时间轴 — 跟踪化疗周期、手术及其他治疗事件
文档版本控制 — 通过完整历史记录跟踪文档修订
AI 驱动的元数据 — 自动摘要、标签和结构化数据提取
审计日志 — 记录每一次工具调用以确保可追溯性
架构
┌─────────────────┐ MCP Protocol ┌──────────────┐
│ Claude / GPT │◄────────────────────► │ Oncofiles │
│ (AI Assistant) │ streamable-http │ MCP Server │
└─────────────────┘ └──────┬───────┘
│
┌─────────────┼─────────────┐
│ │ │
┌─────▼─────┐ ┌────▼────┐ ┌─────▼─────┐
│ SQLite / │ │ Google │ │ Anthropic │
│ Turso │ │ Drive │ │ Files API │
└───────────┘ └─────────┘ └───────────┘技术栈: Python 3.12+ · FastMCP 3.1 · Pydantic · SQLite/Turso · Railway
快速入门
# Clone and install
git clone https://github.com/peter-fusek/oncofiles.git
cd oncofiles
uv sync --extra dev
# Run locally (stdio mode for Claude Desktop)
uv run oncofiles-mcp
# Run tests
uv run pytest
# Lint
uv run ruff check环境变量
# Required
DATABASE_PATH=data/oncofiles.db
# Optional — cloud database
TURSO_DATABASE_URL=libsql://...
TURSO_AUTH_TOKEN=...
# Optional — Google Drive sync
GOOGLE_DRIVE_FOLDER_ID=...
GOOGLE_OAUTH_CLIENT_ID=...
GOOGLE_OAUTH_CLIENT_SECRET=...
# Optional — remote access
MCP_TRANSPORT=streamable-http # default: stdio
MCP_HOST=0.0.0.0
MCP_PORT=8080
MCP_BEARER_TOKEN=...连接到 Claude Desktop
添加到您的 Claude Desktop 配置 (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"oncofiles": {
"command": "uv",
"args": ["run", "oncofiles-mcp"],
"cwd": "/path/to/oncofiles"
}
}
}连接到 ChatGPT
Oncofiles 支持 ChatGPT 的 MCP 集成(开发者模式)。将 ChatGPT 指向您实例的 /mcp 端点并提供承载令牌。
部署到 Railway
随附的 Dockerfile 已为 Railway 部署做好准备:
推送到 GitHub
在 Railway 中连接仓库
设置环境变量
Railway 在推送时自动部署
实时实例:oncofiles.com
项目结构
src/oncofiles/
├── server.py # FastMCP server, auth, routes, scheduler
├── database/ # Mixin-based DB layer (SQLite/Turso)
├── tools/ # 14 tool modules (76 tools)
│ ├── documents.py # CRUD, search, view, versioning
│ ├── lab_trends.py # Lab values, trends, safety checks
│ ├── clinical.py # Treatment events, research log
│ ├── research.py # PubMed, ClinicalTrials.gov search
│ └── ...
├── sync.py # Bidirectional Google Drive sync
├── gmail_sync.py # Medical email detection and import
├── calendar_sync.py # Calendar event classification
├── enhance.py # AI metadata extraction (Haiku)
├── patient_middleware.py # Per-patient token → context resolution
├── patient_context.py # Patient clinical profile
└── models.py # Pydantic modelsMCP 注册表
已在 MCP Registry 中列出,名称为 io.github.peter-fusek/oncofiles。
贡献
请参阅 CONTRIBUTING.md 获取指南。
许可证
幕后团队
核心成员
Peter Fusek — 首席执行官兼创始人
连续创业者和 AI 战略家。曾在 Tatra banka 工作 4 年。联合创立了 marketlocator(已出售给德国电信)。VÚB 银行首席执行官顾问。拥有 18 年以上构建技术产品的经验。
出于个人需求构建了 Oncofiles — 管理他妻子在数百份文档、数十位医生和不断变化的化验结果中的癌症治疗过程。
LinkedIn · peter.fusek@instarea.com
Peter Čapkovič — 首席技术官兼联合创始人
资深 IT 架构师,在企业银行 (VÚB) 拥有 20 多年经验。精通 .NET、Python、SQL 和系统架构。领导了所有 Instarea 产品的架构设计。
架构、开发、运营 — 一站式全包。
公司简介
Instarea — 成立 18 年,已发布 23 款产品。从电信分析和企业客户 (Callinspector) 到移动优先金融科技 (InventButton)、大数据退出项目 (marketlocator → 德国电信)、物联网平台以及 AI 优先产品 (PulseShape, ReplicaCity, HomeGrif)。
Oncofiles 和 Oncoteam 是 Instarea 的最新力作 — 采用与交付银行、电信和数据行业企业级产品相同的工程准则构建。
拥有 10 多名经过验证的同步团队成员,涵盖前端、后端、集成、数据科学、UX/UI、市场营销和云运营。
“我们亲力亲为,以诚相待,如同家人,亦如工作。”
Available Tools
79 toolsadd_activity_logAInspect
Log an agent tool call to the activity audit trail (append-only).
Args: session_id: Session identifier. agent_id: Agent that made the call (e.g. oncoteam). tool_name: Name of the tool that was called. input_summary: Brief summary of the input parameters. output_summary: Brief summary of the output. duration_ms: How long the call took in milliseconds. status: Result status (ok, error, timeout). error_message: Error details if status is not ok. tags: JSON array of tags (e.g. '["research","pubmed"]').
Inputs: session_id (required), agent_id (required), tool_name (required), input_summary, +5 more. Returns: result
add_research_entryAInspect
Save a research article or clinical trial found by an agent.
Deduplicates by source+external_id — if a duplicate is found, returns the existing entry without error.
Args: source: Source name (e.g. pubmed, clinicaltrials). external_id: External identifier (e.g. PMID, NCT number). title: Article or trial title. summary: Brief summary or abstract excerpt. tags: JSON array of tags (e.g. '["FOLFOX","mCRC"]'). raw_data: Full raw data (abstract, JSON, etc.) for reference.
Inputs: source (required), external_id (required), title (required), summary, +2 more. Returns: result
add_treatment_eventAInspect
Record a treatment milestone (chemo cycle, surgery, scan result, etc.).
Args: event_date: Date of the event (YYYY-MM-DD). event_type: Type of event (e.g. chemo, surgery, scan, consult, side_effect). title: Short title for the event. notes: Optional longer description or notes. metadata: Optional JSON string with extra structured data.
Inputs: event_date (required), event_type (required), title (required), notes, +1 more. Returns: result
analyze_labsAInspect
Analyze recent lab results with oncology context.
Downloads lab documents and returns them inline for Claude to read, along with patient context for interpreting results under chemotherapy.
Note: Each lab document is 100KB-2MB. Keep limit low to avoid large responses.
Args: file_id: Specific lab file_id to analyze. If omitted, fetches the most recent labs. limit: Maximum number of lab documents to include (default 3).
Inputs: file_id, limit.
calendar_auth_enableAInspect
Start Calendar authorization flow. Returns a URL the user must visit.
After visiting the URL and completing Google's consent screen, Calendar read access will be enabled. Call integration_status() to verify.
WARNING: This grants read access to ALL events in Google Calendar.
Inputs: no named parameters. Returns: result
compare_lab_panelsAInspect
Compare lab values between two dates side-by-side.
Returns all parameters measured on both dates with change direction, absolute delta, percentage change, and out-of-range flags.
Args: date_a: First date (YYYY-MM-DD), typically the earlier measurement. date_b: Second date (YYYY-MM-DD), typically the later measurement.
Inputs: date_a (required), date_b (required). Returns: result
compare_labsAInspect
Compare lab results over time to identify trends.
Two modes:
Specific: provide file_id_a and file_id_b to compare two specific lab sets.
Date range: provide date_from/date_to to compare all labs in a period.
Note: Each lab document is 100KB-2MB. Keep limit reasonable.
Args: file_id_a: First lab file_id (optional). file_id_b: Second lab file_id (optional). date_from: Start date for range query (YYYY-MM-DD). date_to: End date for range query (YYYY-MM-DD). limit: Maximum number of lab documents to include (default 10).
Inputs: file_id_a, file_id_b, date_from, date_to, +1 more.
delete_documentAInspect
Soft-delete a document (moves to trash, recoverable for 30 days).
The document is hidden from all listings and searches but can be restored using restore_document. Files API copy is also deleted.
Args: file_id: The Anthropic Files API file_id to delete.
Inputs: file_id (required). Returns: result
delete_treatment_eventBInspect
Delete a treatment event by ID. Use for removing contaminated/test data.
Args: event_id: The treatment event ID to delete.
Inputs: event_id (required). Returns: result
enhance_documentsAInspect
Run AI enhancement (summary + tags) on documents.
If document_ids is omitted, processes all documents that haven't been enhanced yet.
Args: document_ids: Comma-separated document IDs to enhance. If omitted, enhances all unprocessed.
Inputs: document_ids. Returns: result
export_document_packageAInspect
Export a structured document package for consultations or second opinions.
Assembles all documents grouped by category with metadata, treatment events timeline, and structured metadata. Returns JSON that Oncoteam can render as PDF, email, or share link.
Args: include_metadata: Include AI summaries and structured metadata (default True). include_timeline: Include treatment events timeline (default True).
Inputs: include_metadata, include_timeline. Returns: result
export_manifestBInspect
Export the full database as a JSON manifest (on-demand).
Returns the manifest JSON with all documents, conversations, treatment events, research entries, and agent state.
Inputs: no named parameters. Returns: result
extract_all_metadataAInspect
Backfill structured_metadata for all documents that have AI summaries but no metadata.
Scans for documents where ai_processed_at is set but structured_metadata is empty, then extracts structured metadata from cached OCR text. Useful after adding the structured_metadata column to an existing database.
Inputs: no named parameters. Returns: result
extract_document_metadataAInspect
Extract and store structured medical metadata from a document.
Uses AI to analyze the document text and extract findings, diagnoses, medications, providers, and a patient-friendly summary. Results are persisted in the structured_metadata column.
Args: document_id: The local document ID to extract metadata from.
Inputs: document_id (required). Returns: result
fetch_clinical_trialsAInspect
Fetch clinical trials from ClinicalTrials.gov and store in research_entries.
Searches the ClinicalTrials.gov API v2 for matching studies and saves them to the research_entries table (deduplicates by NCT number).
Args: condition: Medical condition to search for (e.g. "colorectal cancer"). keywords: Additional search terms (e.g. "FOLFOX", "immunotherapy"). status: Trial status filter (RECRUITING, ACTIVE_NOT_RECRUITING, COMPLETED). location_country: Country filter (e.g. "United States", "Slovakia"). phase: Phase filter (PHASE1, PHASE2, PHASE3, PHASE4). limit: Maximum number of trials to fetch (default 20).
Inputs: condition (required), keywords, status, location_country, +2 more. Returns: result
find_duplicatesAInspect
Detect potential duplicate documents based on original filename and file size.
Returns groups of documents that share the same original_filename + size_bytes. Each group contains 2+ documents. Useful for cleanup after repeated imports.
Inputs: no named parameters. Returns: result
gdrive_auth_callbackAInspect
Exchange an OAuth authorization code for tokens and store them.
Args: code: The authorization code from the Google OAuth redirect.
Inputs: code (required). Returns: result
gdrive_auth_statusAInspect
Check if the user has valid Google Drive OAuth tokens.
Inputs: no named parameters. Returns: result
gdrive_auth_urlAInspect
Get the Google OAuth authorization URL for the user to visit.
Returns a URL that the user should open in their browser to authorize Google Drive access. After authorization, Google redirects to the callback URL which stores the tokens automatically.
Inputs: no named parameters. Returns: result
gdrive_fix_permissionsAInspect
Grant writer access to all files/folders in the sync root (one-off fix).
Use this after initial sync when files were created by the service account and are invisible to the folder owner. Also updates the stored owner_email for automatic sharing on future uploads.
Args: email: Email to grant access to. If omitted, detects from folder owner.
Inputs: email. Returns: result
gdrive_set_folderBInspect
Set the Google Drive folder to sync with.
Detects the folder owner's email and stores it for automatic permission sharing. When the service account creates files/folders, it grants writer access to the original folder owner so they can see the files.
Args: folder_id: The Google Drive folder ID to use as the sync root.
Inputs: folder_id (required). Returns: result
gdrive_syncAInspect
Run full bidirectional Google Drive sync (runs in background).
Returns immediately with status. Use gdrive_sync_status to check progress and get the result when done.
Imports new/changed files from GDrive (GDrive wins on conflicts)
Exports documents to organized category/year-month folders
Exports manifest + metadata markdown files
Args: dry_run: Preview changes without syncing. enhance: Run AI summary/tag generation on new files (default True).
Inputs: dry_run, enhance. Returns: result
gdrive_sync_statusAInspect
Check the status of the last or current GDrive sync.
Returns whether a sync is currently running, and the result of the last completed sync (if any).
Inputs: no named parameters. Returns: result
get_activity_statsBInspect
Get aggregated activity statistics by tool and status.
Args: session_id: Filter by session. agent_id: Filter by agent. date_from: Filter from this date (YYYY-MM-DD). date_to: Filter to this date (YYYY-MM-DD).
Inputs: session_id, agent_id, date_from, date_to. Returns: result
get_agent_stateAInspect
Get a persistent state value by key.
Returns {value: null} if the key does not exist.
Args: key: State key name. agent_id: Agent identifier (default: oncoteam).
Inputs: key (required), agent_id. Returns: result
get_calendar_eventBInspect
Get full details of a stored calendar entry by ID.
Args: calendar_entry_id: The calendar entry ID.
Inputs: calendar_entry_id (required). Returns: result
get_conversationBInspect
Get the full content of a single conversation entry by ID.
Args: entry_id: The conversation entry ID.
Inputs: entry_id (required). Returns: result
get_documentAInspect
Get a document's metadata and file_id for Claude to analyze.
Returns the file_id that can be used to reference the document in conversation.
Args: file_id: The Anthropic Files API file_id.
Inputs: file_id (required). Returns: result
get_document_by_idAInspect
Get a document's metadata by its integer database ID.
Use this when you have the numeric document ID (e.g. from search results or lab values).
Args: doc_id: The integer database ID of the document.
Inputs: doc_id (required). Returns: result
get_document_status_matrixAInspect
Get per-document status matrix showing OCR, AI, metadata, sync, and rename state.
Returns a table of documents with their processing status at each pipeline stage. Use filters to find documents that need attention.
Args: filter: Filter documents — 'all', 'missing_ocr', 'missing_ai', 'missing_metadata', 'not_synced', 'not_renamed', 'incomplete' (any gap). limit: Maximum documents to return (max 200).
Inputs: filter, limit. Returns: result
get_document_versionsAInspect
Get the version history chain for a document.
Returns all versions (current and previous) ordered newest first. Works with any document ID in the chain — will find the full history.
Args: doc_id: The integer database ID of any document in the version chain.
Inputs: doc_id (required). Returns: result
get_emailCInspect
Get full details of a stored email entry by ID.
Args: email_entry_id: The email entry ID.
Inputs: email_entry_id (required). Returns: result
get_journey_timelineAInspect
Get a unified chronological timeline merging documents and conversation entries.
This is the complete view of the oncology journey — documents and diary entries interleaved by date. Useful for book writing, doctor sharing, or reviewing history.
Args: date_from: Start date (YYYY-MM-DD). date_to: End date (YYYY-MM-DD). limit: Maximum items per type (default 200).
Inputs: date_from, date_to, limit. Returns: result
get_lab_safety_checkAInspect
Lab safety check against thresholds appropriate for the patient type.
For oncology patients: mFOLFOX6 pre-cycle thresholds (NCCN + SmPC). For general patients: standard health reference ranges (EU/WHO/ESC).
For each safety parameter, returns:
The threshold (min or max) with source/guideline reference
The patient's most recent value with date and source document
Safety status: green (safe), red (unsafe), yellow (borderline ±10%)
Clickable gdrive_url to verify the source lab document
Inputs: no named parameters. Returns: result
get_lab_summaryAInspect
Get a summary of the latest value for every tracked lab parameter.
Returns status (normal/high/low), trend direction (rising/falling/stable), days since last measurement, and computed indices (SII, Ne/Ly ratio). Designed as a quick overview for clinical decision support.
Inputs: no named parameters. Returns: result
get_lab_time_seriesAInspect
Get structured time series data for one or more lab parameters.
Returns chronological values with reference ranges, units, and computed deltas (absolute change and % change between consecutive measurements). Designed for Oncoteam and MCP clients to build trend charts and analysis.
Args: parameters: Comma-separated parameter names (e.g. "CEA,CA19_9" or "PLT"). date_from: Start date filter (YYYY-MM-DD). Optional. date_to: End date filter (YYYY-MM-DD). Optional.
Inputs: parameters (required), date_from, date_to. Returns: result
get_lab_trendsBInspect
Retrieve stored lab values for trend analysis.
Returns values sorted chronologically (oldest first) for plotting trends.
Args: parameter: Filter by parameter name (e.g. PLT, SII, CEA). If None, returns all. date_from: Filter from this date (YYYY-MM-DD). date_to: Filter to this date (YYYY-MM-DD). limit: Maximum results to return.
Inputs: parameter, date_from, date_to, limit. Returns: result
get_patient_contextBInspect
Get the current patient clinical context.
Returns structured patient data including diagnosis, biomarkers, treatment, metastases, comorbidities, and excluded therapies.
Inputs: no named parameters. Returns: result
get_pipeline_statusAInspect
Get pipeline operations status: scheduled jobs, stage counts, and sync history.
Shows which automated processes run, their schedule, last results, and how many documents are at each pipeline stage (OCR → AI → metadata → sync → rename).
Inputs: no named parameters. Returns: result
get_precycle_checklistAInspect
Get the full pre-cycle checklist for mFOLFOX6 with source references.
Returns all checklist sections (lab safety, toxicity, VTE, general) with guideline source URLs for each item. Lab items include the patient's latest value and safety status.
Args: cycle_number: Current cycle number (for display context).
Inputs: cycle_number. Returns: result
get_preventive_care_statusAInspect
Get EU preventive care screening compliance for a general health patient.
Evaluates which screenings (colonoscopy, dental, ophthalmology, PSA, etc.) are up-to-date, due soon, overdue, or never done — based on patient age, sex, and treatment_events history.
Only available for patients with patient_type="general" in their context. Requires date_of_birth and sex in patient context.
Returns a compliance report with actionable screening status for each applicable protocol.
Inputs: no named parameters. Returns: result
get_prompt_log_entryAInspect
Get a single prompt log entry with full prompts and raw response.
Returns the complete AI call record including system prompt, user prompt, raw AI response, token counts, and timing. Use search_prompt_log to find entries.
Args: entry_id: The prompt log entry ID.
Inputs: entry_id (required). Returns: result
get_treatment_eventCInspect
Get full details of a treatment event by ID.
Args: event_id: The treatment event ID.
Inputs: event_id (required). Returns: result
gmail_auth_enableAInspect
Start Gmail authorization flow. Returns a URL the user must visit.
After visiting the URL and completing Google's consent screen, Gmail read access will be enabled. Call integration_status() to verify.
WARNING: This grants read access to ALL emails in the Gmail account.
Inputs: no named parameters. Returns: result
integration_statusBInspect
Show which Google services are connected and entry counts.
Returns the status of Drive, Gmail, and Calendar integrations, including whether each is authorized and how many entries are stored.
Inputs: no named parameters. Returns: result
list_agent_statesBInspect
List all persistent state keys for an agent.
Args: agent_id: Agent identifier (default: oncoteam). limit: Maximum number of states to return (default 100, max 500).
Inputs: agent_id, limit. Returns: result
list_documentsBInspect
List all stored medical documents with metadata.
Returns documents ordered by date (newest first).
Inputs: limit, offset. Returns: result
list_patientsAInspect
List all available patients.
Shows active patients with their slug, name, document count, and patient type. Use select_patient to switch to a different patient.
Inputs: no named parameters. Returns: result
list_research_entriesCInspect
List saved research entries, optionally filtered by source.
Args: source: Filter by source (e.g. pubmed, clinicaltrials). limit: Maximum results to return.
Inputs: source, limit. Returns: result
list_tool_definitionsAInspect
List all registered MCP tools with their descriptions and parameter schemas.
Returns the complete tool inventory for discovery and documentation. Useful for agents to understand available capabilities.
Inputs: no named parameters. Returns: result
list_trashAInspect
List soft-deleted documents in trash.
Args: limit: Maximum results to return (default 50, max 200).
Inputs: limit. Returns: result
list_treatment_eventsAInspect
List treatment events, optionally filtered by type and date range.
Returns events in reverse chronological order.
Args: event_type: Filter by event type (e.g. chemo, surgery). date_from: Filter from this date (YYYY-MM-DD). date_to: Filter to this date (YYYY-MM-DD). limit: Maximum results to return.
Inputs: event_type, date_from, date_to, limit. Returns: result
log_conversationAInspect
Save a diary entry to the conversation archive.
Use this to log summaries, decisions, progress notes, questions, or any narrative content from conversations about the oncology journey.
Args: title: Short title for the entry. content: Markdown body with the full entry text. entry_date: Date the entry is about (YYYY-MM-DD). Defaults to today. entry_type: Type of entry: summary, decision, progress, question, note. tags: Comma-separated tags (e.g. "chemo,FOLFOX,cycle-3"). document_ids: Comma-separated document IDs referenced (e.g. "3,15"). participant: Who created this: claude.ai, claude-code, oncoteam.
Inputs: title (required), content (required), entry_date, entry_type, +3 more. Returns: result
qa_analysisBInspect
Analyze activity logs for errors, slow tools, and improvement opportunities.
Scans the audit trail for patterns: recurring errors, slow operations, failed storage, and usage trends. Returns actionable findings that can be used to create GitHub improvement issues.
Args: days: Number of days to analyze (default 7).
Inputs: days. Returns: result
query_dbAInspect
Run a read-only SQL query against the production database.
Use this for monitoring, debugging, and ad-hoc analysis. Only SELECT/WITH queries are allowed — mutations are blocked.
Args: sql: SQL query (SELECT only). Tables: documents, activity_log, conversations, treatment_events, research_entries, lab_values, document_pages, agent_state, patient_context, schema_migrations. limit: Max rows to return (default 50, max 200).
Inputs: sql (required), limit. Returns: result
reconcile_gdriveAInspect
Detect and fix GDrive folder structure issues.
Scans for: unknown folders, root-level files not in any category folder, empty managed folders, and stale backup folders.
Args: dry_run: If True (default), report issues without making changes. If False, move files, rename folders, and clean up backups.
Inputs: dry_run. Returns: result
rename_documents_to_standardAInspect
Rename documents from old naming conventions to the standard format.
Standard format: YYYYMMDD_PatientName_Institution_Category_DescriptionEN.ext
In dry_run mode (default), returns a preview of proposed renames without making any changes. Set dry_run=False to execute the rename.
Args: dry_run: If True (default), only preview changes. Set False to execute. en_descriptions: Optional JSON object mapping doc_id → English description (e.g. '{"15": "BloodResultsPreCycle3", "42": "CTAbdomen"}'). If not provided, keeps existing descriptions.
Inputs: dry_run, en_descriptions. Returns: result
restore_documentBInspect
Restore a soft-deleted document from trash.
Args: doc_id: The local document ID to restore.
Inputs: doc_id (required). Returns: result
search_activity_logBInspect
Search the activity log with filters.
Args: session_id: Filter by session. agent_id: Filter by agent. tool_name: Filter by tool name. status: Filter by status (ok, error, timeout). date_from: Filter from this date (YYYY-MM-DD). date_to: Filter to this date (YYYY-MM-DD). text: Search in input/output summaries. limit: Maximum results to return.
Inputs: session_id, agent_id, tool_name, status, +4 more. Returns: result
search_calendar_eventsBInspect
Search stored calendar entries by text, date, or medical relevance.
Args: query: Text to search in summary and description. date_from: Filter from this date (YYYY-MM-DD). date_to: Filter to this date (YYYY-MM-DD). is_medical: Filter to medical events only when True. limit: Maximum results to return.
Inputs: query, date_from, date_to, is_medical, +1 more. Returns: result
search_conversationsAInspect
Search the conversation archive by text, type, date, or tags.
Returns entries with truncated content (500 chars). Use get_conversation for full text of a specific entry.
Args: text: Full-text search query. entry_type: Filter by type: summary, decision, progress, question, note. participant: Filter by participant: claude.ai, claude-code, oncoteam. date_from: Filter from this date (YYYY-MM-DD). date_to: Filter to this date (YYYY-MM-DD). tags: Comma-separated tags to filter by (all must match). limit: Maximum results to return.
Inputs: text, entry_type, participant, date_from, +3 more. Returns: result
search_documentsAInspect
Search medical documents by text, institution, category, or date range.
Multi-term queries (e.g. "CEA labs") use AND semantics — all terms must match somewhere. Results are ranked by relevance when text is provided: filename/description matches rank highest, then AI summaries, then tags.
Args: text: Search query (searches filename, institution, description, AI summary, tags, and structured metadata). Multiple words are AND-ed together. institution: Filter by institution code (e.g. NOUonko, OUSA). category: Filter by category (labs, report, imaging, pathology, genetics, surgery, surgical_report, prescription, referral, discharge, discharge_summary, chemo_sheet, vaccination, dental, preventive, other). date_from: Filter from this date (YYYY-MM-DD). date_to: Filter to this date (YYYY-MM-DD). limit: Maximum results to return (max 200). offset: Skip this many results (for pagination).
Inputs: text, institution, category, date_from, +3 more. Returns: result
search_emailsAInspect
Search stored email entries by text, date, sender, or medical relevance.
Args: query: Text to search in subject, body snippet, and sender. date_from: Filter from this date (YYYY-MM-DD). date_to: Filter to this date (YYYY-MM-DD). sender: Filter by sender email or name (partial match). is_medical: Filter to medical emails only when True. limit: Maximum results to return.
Inputs: query, date_from, date_to, sender, +2 more. Returns: result
search_prompt_logAInspect
Search prompt logs — all AI calls made during document processing.
Returns a list of prompt log entries (without full prompts for brevity). Use get_prompt_log_entry to see full prompts and responses for a specific entry.
Args: call_type: Filter by type: 'ocr', 'summary_tags', 'structured_metadata', 'filename_description'. document_id: Filter by document ID. status: Filter by status ('ok' or 'error'). date_from: Filter from date (YYYY-MM-DD). date_to: Filter to date (YYYY-MM-DD). text: Search in prompts and responses. limit: Max results (1-200, default 50).
Inputs: call_type, document_id, status, date_from, +3 more. Returns: result
search_researchBInspect
Search saved research entries by text and/or source.
Args: text: Search in title, summary, and tags. source: Filter by source (e.g. pubmed, clinicaltrials). limit: Maximum results to return.
Inputs: text, source, limit. Returns: result
select_patientAInspect
Switch to a different patient for this connection.
After calling this, all subsequent tool calls will use the selected patient's data. The selection persists across requests.
Args: patient_slug: Patient slug or UUID (e.g. 'q1b', 'e5g').
Inputs: patient_slug (required). Returns: result
set_agent_stateAInspect
Set a persistent key-value pair for an agent.
Upserts: creates the key if new, updates if it already exists.
Args: key: State key name (e.g. "last_briefing_date", "treatment_protocol"). value: JSON string value to store. agent_id: Agent identifier (default: oncoteam).
Inputs: key (required), value (required), agent_id. Returns: result
setup_gdriveAInspect
Create the folder structure in a GDrive root folder (patient-type-aware).
Idempotent: checks for existing folders by name before creating. Handles both bilingual and legacy EN-only folder names (renames old to bilingual). Oncology patients skip general-only folders; general patients skip oncology-only.
Args: root_folder_id: The Google Drive folder ID to create subfolders in.
Inputs: root_folder_id (required). Returns: result
store_lab_valuesAInspect
Store parsed lab values from a document for trend tracking.
Includes deduplication checks:
If document_id already has stored values, returns skipped (unless force=True to update/replace).
If another document has values for the same lab_date, warns about collision (stores anyway but flags it).
Standardized parameter names: WBC, ABS_NEUT, ABS_LYMPH, PLT, HGB, ANC, ALT, AST, GMT, ALP, BILIRUBIN, CREATININE, eGFR, CEA, CA19_9, SII, NE_LY_RATIO
Args: document_id: Source document ID (should be a labs document). lab_date: Date of the lab test (YYYY-MM-DD). values: JSON array of objects, each with: parameter, value, unit, and optionally reference_low, reference_high, flag. Example: [{"parameter": "WBC", "value": 6.8, "unit": "10^9/L", "reference_low": 4.0, "reference_high": 10.0, "flag": ""}] force: If True, store even if document already has values (replaces existing via INSERT OR REPLACE).
Inputs: document_id (required), lab_date (required), values (required), force. Returns: result
sync_from_gdriveAInspect
Import files from Google Drive into oncofiles.
Walks category/year-month subfolders, detects new and changed files, downloads them, uploads to Files API, and stores metadata.
Args: dry_run: Preview changes without importing. enhance: Run AI summary/tag generation on new/changed files (default True).
Inputs: dry_run, enhance. Returns: result
sync_to_gdriveAInspect
Export documents from oncofiles to Google Drive.
Uploads documents to organized category/year-month folders with manifest and metadata markdown files.
Args: dry_run: Preview changes without exporting.
Inputs: dry_run. Returns: result
system_healthAInspect
Get system health overview: sync history, document counts, resource usage, and errors.
Returns a comprehensive status report useful for monitoring and debugging. Includes 7-day sync statistics, recent sync runs, memory usage, and document counts.
Inputs: no named parameters. Returns: result
update_document_categoryAInspect
Update the category of a document.
Use this to recategorize documents (e.g. from 'other' to 'reference').
Args: doc_id: The integer database ID of the document. category: New category (labs, report, imaging, pathology, genetics, surgery, surgical_report, prescription, referral, discharge, discharge_summary, chemo_sheet, vaccination, dental, preventive, reference, advocate, other).
Inputs: doc_id (required), category (required). Returns: result
update_patient_contextBInspect
Update specific fields in the patient clinical context.
Merges the provided updates into the current context. Nested dicts (like biomarkers, treatment, physicians) are merged recursively. Persisted to database for durability.
Args: updates_json: JSON object with fields to update. Example: '{"treatment": {"current_cycle": 3}}'
Inputs: updates_json (required). Returns: result
update_treatment_eventBInspect
Update a treatment event's title, notes, or metadata.
Args: event_id: The treatment event ID to update. title: New title (optional). notes: New notes (optional). metadata: New metadata JSON string (optional).
Inputs: event_id (required), title, notes, metadata. Returns: result
upload_documentAInspect
Upload a medical document to persistent storage.
The filename should follow the standard convention: YYYYMMDD_PatientName_Institution_Category_DescriptionEN.ext (e.g. 20260227_PatientName_NOU_Labs_BloodResultsBeforeCycle2.pdf)
Legacy formats (space+dash, underscore-separated) are also accepted and auto-parsed. Separators: underscores only. Description: English, CamelCase.
Args: content: Base64-encoded file content. filename: Document filename in standard or legacy format. mime_type: MIME type of the document.
Inputs: content (required), filename (required), mime_type. Returns: result
validate_categoriesAInspect
Validate and fix document categories by comparing with AI-detected document types.
Checks each document's category against its structured_metadata.document_type. Reports mismatches and optionally corrects them.
Args: dry_run: If True (default), report mismatches without fixing. If False, update categories and move GDrive files.
Inputs: dry_run. Returns: result
view_documentAInspect
Download a document and return its content for Claude to read.
Returns the actual file content (image or PDF) inline so Claude can see and analyze it directly.
Args: file_id: The Anthropic Files API file_id.
Inputs: file_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 79 tools
The tool set covers a comprehensive oncology domain, but there is significant overlap between several tools. For example, compare_lab_panels, compare_labs, get_lab_time_series, and get_lab_trends all deal with lab comparison/trend analysis with subtle distinctions that could confuse an agent. Similarly, multiple search tools (search_documents, search_conversations, search_activity_log, etc.) have overlapping search functionality across different data types. The descriptions help clarify boundaries, but the sheer number of similar tools creates ambiguity.
Most tools follow a consistent verb_noun or verb_noun_noun pattern (e.g., add_activity_log, get_document, search_conversations). There are minor deviations like gdrive_auth_callback (noun_verb_noun) and system_health (noun_noun), but these are exceptions. The naming is generally predictable and readable across the set, with clear action-object relationships maintained throughout.
With 79 tools, this is an extremely large set that feels overwhelming for the oncology domain. While the domain is complex, many tools could be consolidated (e.g., multiple lab analysis tools, multiple search variants). The count suggests feature creep rather than a well-scoped surface, making it difficult for agents to navigate and increasing the risk of tool misselection.
The tool surface provides remarkably complete coverage for oncology patient management. It includes document CRUD (upload, get, delete, restore), lab analysis, treatment event tracking, research integration, Google services synchronization, patient context management, and comprehensive search capabilities across all data types. There are no obvious gaps—every major workflow from data ingestion to analysis to export appears to be supported.
Maintenance
Related MCP Connectors
Your MedNode health vault in your AI assistant — records, summaries, labs, appointments.
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Personal CRM for Claude. Contacts live as plain-text files in your own Google Drive.
Give Claude only the Google Drive files you choose. Every action logged.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA locally-hosted MCP server that integrates Gmail, Google Calendar, and Google Drive to provide AI-powered management of emails, events, and files. It enables tool-based interactions like sending emails, creating calendar events, and searching Drive files through clients like Cursor and Claude Desktop.-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that brings AI-powered search and conversation to your FHIR clinical documents.19 PyPI1MIT
- FlicenseNot gradedqualityDmaintenanceA local MCP server that connects multiple Gmail and Google Calendar accounts to Claude Desktop, enabling email and calendar management across accounts.4-
- AlicenseAqualityBmaintenanceEnables natural language interaction with multiple Google accounts (Gmail, Drive, Calendar) from MCP-compatible clients like Claude.6312 npm2MIT