본문으로 건너뛰기
Skillpedia
커넥터 (MCP)5.8k · #14691

deploying-openmed-mcp

하는 일

이 스킬은 OpenMed의 임상 텍스트 도구를 Claude Code나 Codex 같은 코딩 에이전트와 채팅 클라이언트에 노출하는 MCP 서버를 설정합니다. 어시스턴트가 비식별화와 개체 추출을 직접 호출하도록 하고 싶은 팀을 위한 스킬입니다.

사용하는 경우

  • ✓Claude Code나 Codex가 OpenMed 비식별화나 개체 추출을 도구로 호출하게 하고 싶을 때.
  • ✓stdio 또는 네트워크 연결을 통해 OpenMed MCP 서버를 실행해야 할 때.
  • ✓팀이 공유하는 MCP 엔드포인트나 서버용 컨테이너가 필요할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/maziyarpanahi/openmed/blob/master/skills/deploying-openmed-mcp/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Claude Code에 OpenMed를 추가해서, 메모를 직접 비식별화해 달라고 요청할 수 있게 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 MCP 추가 패키지를 설치하고, 맞는 전송 방식으로 서버를 시작한 뒤, 도구를 기기에서 쓸 수 있도록 클라이언트 설정에 추가합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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
자주 묻는 질문

환자 데이터를 클라우드로 보내나요?

모델은 기기에서 실행됩니다. 실제 환자 데이터는 사용자가 운영하는 인스턴스로만 보내라고 안내합니다.

어떤 전송 방식을 지원하나요?

코딩 에이전트가 보통 실행하는 stdio와, 네트워크 접근을 위한 Streamable HTTP를 지원합니다.

자체 서비스에 쓰기에도 좋은가요?

자체 서비스에는 보통 MCP보다 REST API가 더 알맞습니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
5.8k
순위
#14691
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬