Skip to content

Ship an MCP-enabled container image and compose service #1740

Description

@maziyarpanahi

Summary

The current Dockerfile builds an image that runs only the REST service (uvicorn on 8080); there is no way to run the MCP server from the container. Many agents are wired to MCP servers via a container command (stdio) or a remote HTTP endpoint, so an MCP-capable image plus a compose service is the most direct path to making OpenMed connectable from containerized agent setups.

Scope

  • Provide an MCP server entrypoint in the container so docker run -i --rm <image> runs the stdio MCP server and a flagged form runs the Streamable HTTP server on a documented port bound appropriately.
  • Either add an MCP image variant (Dockerfile.mcp) or make the existing image multi-mode via a command override; keep the REST image working unchanged.
  • Add a docker-compose service for the remote HTTP MCP endpoint with a healthcheck and a persistent model cache volume.
  • Document the container client config (the command-based stdio form and the remote HTTP form) in docs/mcp-clients.md.
  • Add a smoke test/script that builds or validates the MCP container command and asserts the compose file declares the MCP service, port, and cache volume.

Acceptance criteria

  • An MCP server can be launched from the container in both stdio and Streamable HTTP modes without breaking the existing REST image.
  • docker-compose declares an MCP service with a healthcheck and a persisted model-cache volume.
  • The container MCP client config (stdio command form and remote HTTP form) is documented.
  • .venv/bin/python -m pytest tests/ -q

Out of scope

  • Submitting to an external container MCP catalog (optional follow-up).
  • OAuth for remote MCP (can follow).

Files

  • Dockerfile
  • Dockerfile.mcp
  • docker-compose.yml
  • docs/mcp-clients.md
  • tests/unit/mcp/test_mcp_container.py

Task: OM-396 · Milestone: v2.0 · Priority: P1 · Size: M
Depends on: OM-395 · Blocks: —
Roadmap: agentic initiative
Spec: PLANS/V2/EXECUTION/tasks/OM-396.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1HighfeatureNew capabilityroadmap-v2OpenMed V2 roadmap backlog

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions