Deploying Openmed Mcp logo

Deploying Openmed Mcp

CommunityPopular
maziyarpanahi
deploying-openmed-mcp

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_unload_model), the resources and prompts, stdio vs streamable-http transports, ServiceRuntime env config, and MCP client config snippets.

Overview

Publishermaziyarpanahi
Repositoryopenmed
Skill namedeploying-openmed-mcp
Stars
5.3K
Forks
677
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by maziyarpanahi on GitHub. Read the source before you install it.

Installation

Install the Deploying Openmed Mcp AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maziyarpanahi/openmed.git /tmp/openmed
mkdir -p .claude/skills
cp -r /tmp/openmed/skills/deploying-openmed-mcp .claude/skills/deploying-openmed-mcp
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Deploying Openmed Mcp in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Deploying Openmed Mcp on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Deploying Openmed Mcp is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

bash
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
python
# 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)

ToolWhat it doesKey args
openmed_analyze_textclinical NERtext, model_name (disease_detection_superclinical), confidence_threshold, group_entities, aggregation_strategy, sentence_*, keep_alive
openmed_extract_piidetect PII/PHI spanstext, model_name (default PII model), confidence_threshold (0.5), use_smart_merging, lang, normalize_accents
openmed_deidentifymask/remove/replace/hash/shift datestext, method (mask), confidence_threshold (0.7), keep_year, shift_dates, date_shift_days, keep_mapping, lang
openmed_list_modelslist registry modelscategory, pii_language, limit
openmed_list_pii_languagessupported PII languages + default models
openmed_loaded_modelsresident-model status of the MCP runtime
openmed_unload_modelfree one model or all inactive modelsmodel_name, all_models

It also registers resourcesopenmed://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

json
// 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

dockerfile
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 resident) so first calls aren't cold.
  3. Register with the client. Add the mcpServers entry (stdio command, or HTTP URL) to the agent's config; the 7 tools, resources, and prompts appear.
  4. Front HTTP with auth/TLS if remote — the server has none built in; keep stdio/local for untrusted-network scenarios.
  5. Let the agent call tools (openmed_deidentify before sharing a snippet, openmed_analyze_text for NER), and discover models via openmed_list_models rather than hardcoding.
  6. Manage memory with openmed_loaded_models / openmed_unload_model.

Hand-off to / from OpenMed

  • Same engine: each tool calls openmed.analyze_text / extract_pii / deidentify through the shared runtime — identical results to the library and the REST service.
  • REST sibling: serving-openmed-rest-api exposes the same operations as HTTP routes for non-agent callers.
  • Discovery: openmed_list_models / openmed_list_pii_languages mirror the library's list_* functions — agents should query, not hardcode.

Edge cases & gotchas

  • stdio vs HTTP. Coding agents spawn the server over stdio (default) and manage its lifecycle; use streamable-http only for a shared endpoint, and put auth/TLS in front of it (the server has none built in).
  • PHI trust boundary. The server's instructions tell clients to send real PHI only to instances the user controls. Keep it local/self-hosted; don't point agents at an OpenMed MCP you don't operate.
  • keep_mapping=True returns a re-identification map in the openmed_deidentify response — only enable for trusted agents, treat the mapping as PHI, never log it.
  • No raw PHI in logs. Don't add transcript/body logging around the server.
  • Use synthetic examples in docs/tests/prompts — the bundled openmed://examples resource is synthetic on purpose.
  • --transport http is accepted as an alias for streamable-http.

Standards & references

Frequently asked questions

What does the Deploying Openmed Mcp AI skill do?

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...

Why use Deploying Openmed Mcp on TypingMind?

Because you install it once and use it with any model. Deploying Openmed Mcp is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Deploying Openmed Mcp in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/maziyarpanahi/openmed/tree/master/skills/deploying-openmed-mcp. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Deploying Openmed Mcp?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Deploying Openmed Mcp?

As many as you like. As long as a model supports skills, you can use Deploying Openmed Mcp with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Deploying Openmed Mcp AI skill free?

Yes. It is published on GitHub by maziyarpanahi under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇