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.2.tar.gz.

File metadata

  • Download URL: iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 feef49b9a880d09014a1c0b094100ee4bddbd662ba9201624598db639782193b
MD5 4df479420ad87c858dc90a9ff8ce2d9d
BLAKE2b-256 01d67827c9a3bdf2b3707fe7e2b6b97455eb8604362f37fee618e61f3d8d59da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iflow_mcp_alibaba_damo_academy_lingshu_mcp-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a5f9e0f14632f96013aca7c1f504d398345be0a8c6cd884c71412f166dc9a019
MD5 5092cabef3d7b57b4f76bcf52ff959f1
BLAKE2b-256 758802eb6c75b9c587cd4001e8c243663e00cb34b382d147cccae2df878dea5b

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