Prescription Review MCP Server

Prescription Review MCP Server

Enables MCP-integrated prescription review with incomplete laboratory evidence, using deterministic rules and language-model guardrails to enforce approval authority boundaries.

Category
访问服务器

README

Executable Authority Boundary for MCP-Integrated Prescription Review

This repository is the public, anonymous reproducibility package for a synthetic study of auxiliary prescription review with laboratory evidence. It evaluates one narrow question:

When required laboratory evidence is incomplete or discordant, can an executable authority contract prevent a language-model candidate from issuing an unsupported approval?

The contribution is the allocation of final approval authority at the Model Context Protocol (MCP) policy boundary. MCP connectivity, deterministic medication rules, language-model guardrails, and their combination are not claimed as firsts.

Research status

  • Research prototype only. Do not use it for clinical care or autonomous prescription approval.
  • All 660 current benchmark cases are synthetic.
  • Reference labels and deterministic rules share the same public-label contract. Their agreement is implementation consistency, not clinical accuracy.
  • No patient records, author metadata, ethics documents, credentials, API keys, or model weights are included.

Included evidence

  • 528 main scenarios and 132 silent plausible-substitution scenarios across 11 drug-laboratory domains.
  • Qwen2.5-3B-Instruct, SmolLM2-1.7B-Instruct, and Phi-3.5-mini-instruct frozen candidate scores.
  • Deterministic rules, evidence access, confidence abstention, and governed decision paths.
  • A real MCP stdio client compared with a same-evidence direct interface.
  • Domain-bootstrap summaries, per-domain confusion counts, threshold sensitivity, repeat and batch-size stability.
  • Publication figures in PNG and PDF.
  • Public-source router and RDKit molecular-similarity components as ancillary engineering channels.

The deterministic baseline was the strongest comparator inside the shared synthetic contract. The current evidence does not establish residual model value beyond rules. Silent plausible substitution remains an exposed failure boundary.

Quick start

Python 3.11 or 3.12 is recommended.

python -m venv .venv
& '.\.venv\Scripts\python.exe' -m pip install --upgrade pip
& '.\.venv\Scripts\python.exe' -m pip install -r requirements.txt
& '.\.venv\Scripts\python.exe' -m pytest -q tests
& '.\.venv\Scripts\python.exe' tests_smoke.py

Start the MCP stdio server:

& '.\.venv\Scripts\python.exe' mcp_server.py --transport stdio

Start the local HTTP research interface:

.\start_http.ps1

Neither interface is hardened for deployment with protected health information.

Reproducing the reported study

The supplied outputs/lab_evidence_benchmark_v2 directory contains the immutable reported scores and summaries. Verify or regenerate figures without downloading model weights:

& '.\.venv\Scripts\python.exe' scripts\plot_lab_evidence_study.py

A full model rerun requires separate acceptance of each model license, sufficient GPU memory, and a PyTorch build appropriate for the local CUDA environment. Model identifiers and license boundaries are documented in MODEL_SOURCES.md. The original run contract records model IDs but not immutable Hugging Face commit revisions, which limits exact future weight-level reproduction.

Run the full benchmark into a new output directory. Do not overwrite the reported outputs:

$out = 'outputs/reproduction_lab_evidence_v2'
$python = '.\.venv\Scripts\python.exe'

& $python scripts\run_lab_evidence_benchmark.py --phase prepare --output $out

foreach ($model in @('qwen2.5-3b', 'smollm2-1.7b', 'phi3.5-mini')) {
    foreach ($stage in @('main', 'batch8_repeat1', 'batch8_repeat2', 'batch1_repeat0', 'finalize')) {
        & $python scripts\run_lab_evidence_benchmark.py --phase model --model $model --model-stage $stage --output $out
    }
}

& $python scripts\run_lab_evidence_benchmark.py --phase summarize --output $out

Repository layout

Path Purpose
prescription_mcp/ Evidence normalization, deterministic contract, router, molecular tools, and orchestration
mcp_server.py MCP server and client-facing tools
scripts/ Public data retrieval, router training, benchmark execution, and figure generation
data/public/ Archived public-source inputs and derived router data
data/molecular/ Public PubChem pair provenance
outputs/lab_evidence_benchmark_v2/ Frozen synthetic cases, model scores, decisions, and statistics
outputs/lab_evidence_figures_v2/ Reproducible figures
tests/ System and real MCP protocol tests

MANIFEST_SHA256.csv records the size and SHA-256 digest of every packaged file except the manifest itself.

Related open-source projects

These projects are relevant to the study. Only the first three are direct foundations or dependencies of this repository; the others are independent neighboring implementations and were not used to generate the reported results.

Project Relevance Relationship
Model Context Protocol Python SDK Official Python client and server SDK Direct dependency; MIT
Synthea Synthetic patient and FHIR/CSV data generation Public data source; Apache-2.0
RDKit Molecular parsing and Morgan/MACCS fingerprints Direct dependency; BSD-3-Clause
health-record-mcp SMART on FHIR access exposed through MCP Related independent project; MIT
OMOP MCP MCP-based clinical terminology mapping to OMOP concepts Related independent project; Apache-2.0
FHIR Server for Azure Open-source FHIR service and interoperability backend Related infrastructure; MIT

Listing a project does not imply endorsement, collaboration, code reuse, or experimental dependence beyond the relationship stated above.

License and third-party material

Repository-authored code is released under the MIT License. Third-party data, software, and models retain their own terms. See DATA_SOURCES.md, MODEL_SOURCES.md, and THIRD_PARTY_NOTICES.md before redistribution or commercial use.

In particular, Qwen/Qwen2.5-3B-Instruct is governed by the Qwen Research License and is restricted to non-commercial purposes unless a separate license is obtained. Model weights are not included in this repository.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选