mcp-medical-server

poliveira81/mcp-medical-server

3.1

If you are the rightful owner of mcp-medical-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

This project implements an MCP server using the mcp-sdk for TypeScript/JavaScript to verify medical exam files.

Tools
1
Resources
0
Prompts
0

MCP Medical Exam Verification ServerThis project implements an MCP (Model Context Protocol) server using the mcp-sdk for TypeScript/JavaScript. The server exposes a single tool, verify_medical_exam, designed to determine if an uploaded file (like a PDF or image) corresponds to a specified type of medical exam.FeaturesMCP Compliant: Built on the official mcp-sdk.AI-Powered Verification: Utilizes a multimodal model (GPT-4o) to analyze the visual content of the uploaded file.Simple Interface: The tool takes a binary file and a string (the exam type) as input.Probabilistic Output: Returns a probability score (0-1), a confidence level, and a brief explanation.Azure Ready: A standard NodeJS application that can be easily containerized and deployed to Azure App Service or other hosting platforms.PrerequisitesNode.js (v18 or later recommended)An OpenAI API keySetup and InstallationClone the repository:git clone cd mcp-medical-server Install dependencies:npm install Configure environment variables:Create a file named .env in the root of the project and add your OpenAI API key:OPENAI_API_KEY="your_openai_api_key_here" PORT=3000 Running the ServerDevelopment ModeTo run the server with automatic reloading on file changes (useful for development), use:npm run dev The server will start, typically on port 3000.Production ModeFor production, simply use:npm start How It WorksServer Initialization: The index.js script initializes an McpServer.Tool Definition: It defines the verify_medical_exam tool, including its name, description, and Zod schemas for structured inputs and outputs.Tool Logic (run method):When the tool is called, the run method is executed.It converts the input McpBinary file into a Base64-encoded data URL.This data URL is sent to the OpenAI GPT-4o model along with a prompt asking it to verify if the image matches the examType.The model is instructed to return a JSON object with the probability, confidence, and reasoning.The server parses this JSON and sends the structured data back to the MCP client.Streaming: The tool uses the stream object to send progress updates back to the client, providing a better user experience.Deployment to AzureThis application is a standard NodeJS server and can be deployed to Azure in several ways. The most common method is using Azure App Service.Create an Azure App Service:In the Azure portal, create a new "Web App".Choose "Node" as the runtime stack and select a recent LTS version (e.g., 18 LTS).Choose your desired operating system (Linux is recommended).Configure Deployment:You can set up continuous deployment from a GitHub repository (recommended).In the "Configuration" section of your App Service, add your OPENAI_API_KEY as an "Application setting". This is more secure than including it in your code or a .env file in production.Deploy:Push your code to the configured GitHub branch, and the deployment will trigger automatically.Alternatively, you can deploy manually using the Azure CLI, Visual Studio Code, or by pushing a Docker container to Azure Container Registry.