Skip to main content

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

Metadata

Release files for iflow-mcp_alibaba-damo-academy-lingshu-mcp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_alibaba-damo-academy-lingshu-mcp 0.1.2
File Size Uploaded
iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.2.tar.gz 9.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_alibaba-damo-academy-lingshu-mcp 0.1.2
File Interpreter ABI Platform
iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 20.1 kB

Release files / iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.2.tar.gz

Download URL iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.2.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
feef49b9a880d09014a1c0b094100ee4bddbd662ba9201624598db639782193b
BLAKE2b-256 checksum
How to use checksums
01d67827c9a3bdf2b3707fe7e2b6b97455eb8604362f37fee618e61f3d8d59da
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.2-py3-none-any.whl

Download URL iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.2-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5f9e0f14632f96013aca7c1f504d398345be0a8c6cd884c71412f166dc9a019
BLAKE2b-256 checksum
How to use checksums
758802eb6c75b9c587cd4001e8c243663e00cb34b382d147cccae2df878dea5b
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page