Langsung ke konten
Skillpedia
Konektor (MCP)5.8k Β· #14691

deploying-openmed-mcp

Fungsinya

Skill ini menyiapkan server MCP yang mengekspos alat teks klinis OpenMed ke agent pengodean dan klien obrolan, seperti Claude Code atau Codex. Skill ini untuk tim yang ingin asisten bisa memanggil penghapusan identitas dan ekstraksi entitas secara langsung.

Kapan dipakai

  • βœ“Saat Anda ingin Claude Code atau Codex bisa memanggil penghapusan identitas atau ekstraksi entitas OpenMed sebagai alat.
  • βœ“Saat Anda perlu menjalankan server MCP OpenMed lewat stdio atau koneksi jaringan.
  • βœ“Saat tim Anda membutuhkan endpoint MCP bersama atau container untuk server tersebut.

Link skill

https://github.com/maziyarpanahi/openmed/blob/master/skills/deploying-openmed-mcp/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/maziyarpanahi/openmed/blob/master/skills/deploying-openmed-mcp/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œTambahkan OpenMed ke pengaturan Claude Code saya agar saya bisa meminta penghapusan identitas catatan secara langsung.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent memasang tambahan MCP, menjalankan server dengan transport yang tepat, lalu menambahkannya ke pengaturan klien agar alatnya tersedia di perangkat.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Deploying the OpenMed MCP server

openmed.mcp.server exposes OpenMed's clinical NLP as Model Context Protocol tools, so coding agents (Claude Code, Codex) and chat clients can de-identify and analyze clinical text by calling tools instead of writing glue code. It runs on-device β€” models are local, no telemetry β€” and the server instructs clients to send real PHI only to instances the user operates.

When to use this skill

When an agent or LLM client should be able to invoke OpenMed: add it to a coding agent's MCP config, give a chat client de-id/NER tools, or run a shared MCP endpoint for a team. For programmatic HTTP from your own services, prefer serving-openmed-rest-api; for corpora, batch-processing-clinical-text.

Quick start

pip install "openmed[mcp]"                 # FastMCP / MCP SDK

# stdio transport (what coding agents spawn): default
python -m openmed.mcp.server

# Streamable HTTP transport (network-reachable):
python -m openmed.mcp.server --transport streamable-http --host 127.0.0.1 --port 8081
# Or embed it:
from openmed.mcp.server import create_mcp_server
server = create_mcp_server()              # FastMCP("OpenMed", ...) with tools+resources+prompts
server.run(transport="stdio")             # or "streamable-http"

CLI flags (build_arg_parser): --transport {stdio,streamable-http,http}, --host, --port, --streamable-http-path (default /mcp), --version. Env equivalents: OPENMED_MCP_TRANSPORT, OPENMED_MCP_HOST, OPENMED_MCP_PORT (8081), OPENMED_MCP_PATH.

The 7 tools (confirmed in openmed/mcp/server.py)

Tool What it does Key args
openmed_analyze_text clinical NER text, model_name (disease_detection_superclinical), confidence_threshold, group_entities, aggregation_strategy, sentence_*, keep_alive
openmed_extract_pii detect PII/PHI spans text, model_name (default PII model), confidence_threshold (0.5), use_smart_merging, lang, normalize_accents
openmed_deidentify mask/remove/replace/hash/shift dates text, method (mask), confidence_threshold (0.7), keep_year, shift_dates, date_shift_days, keep_mapping, lang
openmed_list_models list registry models category, pii_language, limit
openmed_list_pii_languages supported PII languages + default models β€”
openmed_loaded_models resident-model status of the MCP runtime β€”
openmed_unload_model free one model or all inactive models model_name, all_models

It also registers resources β€” openmed://models, openmed://pii-languages, openmed://examples (synthetic) β€” and prompts openmed-clinical-ner and openmed-pii-deidentify that nudge the agent toward safe, correct calls.

Adding it to a coding agent

// Claude Code: .mcp.json (or ~/.claude.json) β€” stdio transport
{
  "mcpServers": {
    "openmed": {
      "command": "python",
      "args": ["-m", "openmed.mcp.server"],
      "env": { "OPENMED_PROFILE": "prod" }
    }
  }
}

For a shared HTTP deployment, run --transport streamable-http and point the client at http://<host>:8081/mcp. The agent then sees the 7 tools and can call e.g. openmed_deidentify on a snippet before sending it elsewhere.

Runtime config

The MCP server shares OpenMed's ServiceRuntime (ServiceRuntime.from_env()), so the same env vars as the REST service apply: OPENMED_PROFILE, OPENMED_SERVICE_PRELOAD_MODELS, OPENMED_SERVICE_KEEP_ALIVE, OPENMED_SERVICE_MAX_RESIDENT_MODELS. Preload to avoid first-call latency; openmed_unload_model/openmed_loaded_models let an agent manage memory.

Running in Docker

FROM python:3.11-slim
RUN pip install --no-cache-dir "openmed[mcp]"
ENV OPENMED_MCP_TRANSPORT=streamable-http \
    OPENMED_MCP_HOST=0.0.0.0 OPENMED_MCP_PORT=8081 \
    OPENMED_SERVICE_PRELOAD_MODELS="OpenMed/OpenMed-PII-SuperClinical-Small-44M-v1"
EXPOSE 8081
CMD ["python", "-m", "openmed.mcp.server"]

stdio servers are spawned by the client and don't need a port; use HTTP only for shared/remote access, behind your own auth proxy. Mount the model cache so the container starts offline.

Workflow

  1. Install + launch. pip install "openmed[mcp]", then python -m openmed.mcp.server (stdio) or --transport streamable-http for a shared endpoint.
  2. Configure the runtime via the ServiceRuntime env vars (profile, preload, keep-alive, max res
Pertanyaan umum

Apakah data pasien dikirim ke cloud?

Model berjalan di perangkat. Skill menyarankan agar data pasien sungguhan hanya dikirim ke instans yang Anda operasikan sendiri.

Transport apa yang didukung?

Server mendukung stdio, yang biasanya dijalankan agent pengodean, dan Streamable HTTP untuk akses jaringan.

Apakah ini untuk layanan saya sendiri?

Untuk layanan sendiri, REST API biasanya lebih cocok daripada MCP.

Detail

Deskripsi asli dari pembuat

Run OpenMed's Model Context Protocol (MCP) server so coding agents (Claude Code, Codex) and chat clients can call clinical NER, PII extraction, and de-identification as tools, on-device. Use when the user wants to add OpenMed to an agent's MCP config, expose de-id/NER as MCP tools, run an MCP server over stdio or Streamable HTTP, give Claude/Codex access to OpenMed, or containerize the MCP server. Covers the mcp extra, create_mcp_server, the 7 tools (openmed_analyze_text, openmed_extract_pii, openmed_deidentify, openmed_list_models, openmed_list_pii_languages, openmed_loaded_models, openmed_un

repo: maziyarpanahi/openmed

Popularitas

Bintang GitHub
5.8k
Peringkat
#14691
Lisensi
Apache-2.0
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa