Skip to main content

FastMCP server for the Lingshu medical AI model, providing medical image analysis and report generation services

Project description

Lingshu FastMCP Medical AI Service

This project implements a FastMCP server for the Lingshu medical AI model and a corresponding client for testing and integration.

Components

  1. mcp_server_lingshu.py: FastMCP server wrapping the Lingshu model
  2. mcp_client_lingshu.py: Test client demonstrating interaction with the Lingshu FastMCP server

Server Features

  • Medical image analysis
  • Structured medical report generation
  • Medical Q&A

Prerequisites

  • FastMCP framework
  • OpenAI API compatible LLM server (e.g., vLLM)
  • Required Python packages (install via pip install -r requirements.txt)

Setup

  1. Clone the repository
  2. Install dependencies: pip install -r requirements.txt

Usage

Use vLLM to serve the Lingshu Model

vllm serve lingshu-medical-mllm/Lingshu-7B  --dtype float16 --api_key api_key --port 8000  --max-model-len 32768

Wrap the server with FastMCP

export LINGSHU_SERVER_URL="http://localhost:8000/v1" 
export LINGSHU_SERVER_API="api_key"
export LINGSHU_MODEL="lingshu-medical-mllm/Lingshu-7B" # the above config depends on your vllm server config
python mcp_server_lingshu.py --host 127.0.0.1 --port 4200 --path /lingshu --log-level info

Try connecting Lingshu with MCP

export LLM_SERVER_URL="xxx"
export LLM_SERVER_API="xxx"
export LLM_MODEL="xxx" ## this is your own model
python mcp_client_lingshu.py  --mcp-url http://127.0.0.1:4200/lingshu # the mcp-url should depend on the mcp server you deployed in the last step

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 218b29e20117a67160ed547273eee8ddd8902b29bbb0d3c72ef59608c00d2bb3
MD5 770a6125938ea2f47179bfa4c93862be
BLAKE2b-256 c11a22ccf105d299e15a5fdfdc822e819964fb99f686bd112e01cc1bb559bfd9

See more details on using hashes here.

File details

Details for the file iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0ef5ee98a56a7c3dd054839996b133bd6b23b8aa7e8ac732832cdf13563935b
MD5 bab9e5a8a471b67a0a3ffa08a44d9490
BLAKE2b-256 6b65fd0381ba2726f7addd308cbb1d19af6d041144f3476eceff0c9985eea618

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page