MedifinderMCP Server

MedifinderMCP Server

medifinder-mcp•bymedifinderbot

An MCP server that provides tools and resources for querying a medicine inventory database.

License: MIT License•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Searches for medicines by name or location and finds facilities where a medicine is available.
  • •Reports stock information and overall statistics for specific medicines.
  • •Provides regional medicine availability statistics and locations of medical centers by region.
  • •Includes diagnostic tools for database connectivity and schema creation.

BEST FOR

  • •Checking whether a specific medicine is in stock at healthcare facilities.
  • •Analyzing medicine availability and stock status across regions.
  • •Letting AI assistants query a medicine inventory database conversationally.

ABOUT MEDIFINDER-MCP

MedifinderMCP Server is cataloged as an MCP server attributed to medifinderbot. An MCP server that provides tools and resources for querying a medicine inventory database. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MedifinderMCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 95babc372029 · 采集于 2026-11-13 13:46:46 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MedifinderMCP Server

An MCP (Model Context Protocol) server for medicine inventory queries, designed to work with AI assistants like Claude.

Overview

The MedifinderMCP Server provides tools and resources for querying a medicine inventory database through the Model Context Protocol (MCP). It allows AI assistants and other clients to:

  • Search for medicines by name or location
  • Check medicine availability at different healthcare facilities
  • Get stock information for specific medicines
  • View statistics on medicine availability by region
  • Analyze stock status across the healthcare system

Database Schema

The application uses a normalized database schema:

Region
  - region_id (PK)
  - name
  - code
  - created_at
  - updated_at

MedicalCenter
  - center_id (PK)
  - code
  - name
  - region_id (FK -> Region)
  - category
  - reporter_name
  - institution_type
  - reporter_type
  - address
  - latitude
  - longitude
  - created_at
  - updated_at

ProductType
  - type_id (PK)
  - code
  - name
  - description
  - created_at
  - updated_at

Product
  - product_id (PK)
  - code
  - name
  - type_id (FK -> ProductType)
  - description
  - dosage_form
  - strength
  - created_at
  - updated_at

Inventory
  - inventory_id (PK)
  - center_id (FK -> MedicalCenter)
  - product_id (FK -> Product)
  - current_stock
  - avg_monthly_consumption
  - accumulated_consumption_4m
  - measurement
  - last_month_consumption
  - last_month_stock
  - status_indicator
  - cpma_12_months_ago
  - cpma_24_months_ago
  - cpma_36_months_ago
  - accumulated_consumption_12m
  - report_date
  - status
  - created_at
  - updated_at

User
  - user_id (PK)
  - phone_number
  - name
  - preferred_location
  - created_at
  - updated_at

SearchHistory
  - search_id (PK)
  - user_id (FK -> User)
  - product_query
  - location_query
  - search_radius
  - results_count
  - created_at

Project Structure

medifinder-mcp/
├── app/
│   ├── __init__.py
│   ├── config.py            # Configuration management
│   ├── db/
│   │   ├── __init__.py
│   │   ├── connection.py    # Database connection handling
│   │   └── queries.py       # SQL queries
│   ├── models/
│   │   ├── __init__.py
│   │   ├── base.py          # Base model with timestamp fields
│   │   ├── region.py        # Region model
│   │   ├── medical_center.py # Medical center model
│   │   ├── product_type.py  # Product type model
│   │   ├── product.py       # Product model
│   │   ├── inventory.py     # Inventory model
│   │   ├── user.py          # User model
│   │   └── search_history.py # Search history model
│   ├── mcp/
│   │   ├── __init__.py
│   │   ├── server.py        # MCP server setup
│   │   ├── tools.py         # Tool implementations
│   │   ├── resources.py     # Resource implementations
│   │   └── prompts.py       # Prompt templates
│   └── utils/
│       ├── __init__.py
│       └── helpers.py       # Helper functions
├── main.py                  # Application entry point
├── requirements.txt         # Dependencies
└── README.md                # Documentation

MCP Features

Tools

  • search_medicines: Search for medicines by name or location
  • get_medicine_locations: Find locations where a medicine is available
  • get_medicine_stock: Get stock information for a specific medicine
  • get_regional_statistics: Get medicine statistics by region
  • get_medicine_status: Get overall medicine statistics
  • diagnose_database: Check database connectivity and content
  • troubleshoot_connection: Detailed database connection diagnostics
  • create_database_schema: Create database tables based on models

Resources

  • product://{id}: Get product details by ID
  • stock://{name}: Get stock information for a product by name
  • locations://{region}: Get medical centers in a specific region
  • statistics://stock: Get overall stock statistics
  • statistics://regions: Get regional statistics

Prompts

  • medicine_search_prompt: Template for searching medicines by name
  • medicine_availability_prompt: Template for checking medicine availability
  • medicine_statistics_prompt: Template for analyzing medicine statistics
  • regional_availability_prompt: Template for analyzing regional medicine availability

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/medifinder-mcp.git
    cd medifinder-mcp
    
  2. Create a virtual environment and install dependencies:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
    
  3. Set up environment variables by creating a .env file:

    DB_HOST=localhost
    DB_PORT=5432
    DB_NAME=medifinderbot
    DB_USER=your_user
    DB_PASSWORD=your_password
    DEBUG=True
    ENV=development
    SERVER_NAME=MedifinderMCP
    SERVER_VERSION=1.0.0
    MCP_SERVER_NAME=MedifinderMCP
    MCP_SERVER_DESCRIPTION=MCP server for medicine inventory queries
    MAX_SEARCH_RESULTS=50
    SEARCH_SIMILARITY_THRESHOLD=0.3
    
  4. Create the database:

    # Connect to PostgreSQL
    psql -U postgres
    
    # Create database and user
    CREATE DATABASE medifinderbot;
    CREATE USER your_user WITH PASSWORD 'your_password';
    GRANT ALL PRIVILEGES ON DATABASE medifinderbot TO your_user;
    
    # Exit PostgreSQL
    \q
    
  5. Initialize the database schema: After starting the server, use the create_database_schema tool to create the tables.

Usage

Running the Server Locally

You can run the MCP server directly:

python main.py

Using MCP Inspector

For development and testing, the MCP Inspector provides a convenient way to interact with the server:

  1. Install MCP CLI:

    pip install mcp[cli]
    
  2. Run the server in development mode:

    python -m mcp dev main.py
    
  3. The MCP Inspector will open in your browser, allowing you to:

    • Test tools and resources
    • View the output of diagnostic tools
    • Experiment with different queries

Integration with Claude Desktop

To use the server with Claude Desktop:

  1. Create a batch file for reliable startup (run-mcp-server.bat):

    @echo off
    cd /d %~dp0
    call venv\Scripts\activate.bat
    python main.py
    
  2. Install the server in Claude Desktop:

    mcp install run-mcp-server.bat -f .env
    
  3. Alternatively, edit Claude Desktop's config file manually:

    {
      "mcpServers": {
        "MedifinderMCP": {
          "command": "C:\\path\\to\\project\\venv\\Scripts\\python.exe",
          "args": ["C:\\path\\to\\project\\main.py"],
          "env": {
            "DB_HOST": "localhost",
            "DB_PORT": "5432",
            "DB_NAME": "medifinderbot",
            "DB_USER": "your_user",
            "DB_PASSWORD": "your_password",
            "DEBUG": "True",
            "ENV": "development",
            "SERVER_NAME": "MedifinderMCP",
            "SERVER_VERSION": "1.0.0",
            "MCP_SERVER_NAME": "MedifinderMCP",
            "MCP_SERVER_DESCRIPTION": "MCP server for medicine inventory queries",
            "MAX_SEARCH_RESULTS": "50",
            "SEARCH_SIMILARITY_THRESHOLD": "0.3"
          }
        }
      }
    }
    
  4. In Claude Desktop, select the MedifinderMCP server from the servers dropdown to enable it for your conversation.

Troubleshooting

Common Issues

  1. Database Connection Issues:

    • Use the troubleshoot_connection tool to diagnose connection problems
    • Verify your database credentials in the .env file
    • Ensure PostgreSQL is running on the specified port
  2. Missing Tables:

    • Use the create_database_schema tool to create the database tables
    • Check logs for any errors during schema creation
  3. Empty Results:

    • If queries return no results, there might not be any data in your tables
    • You need to import data into the tables using your data ingestion process
  4. Session Binding Errors:

    • If you see "Instance is not bound to a Session" errors, ensure model instances are converted to dictionaries within active sessions
    • See how this is handled in the queries.py file for examples
  5. Missing Dependencies:

    • Run pip install -r requirements.txt to ensure all dependencies are installed
    • Common missing dependencies are: mcp, python-dotenv, psycopg2-binary

Diagnostic Tools

When troubleshooting, use these built-in diagnostic tools:

  1. diagnose_database: Checks if:

    • The database connection works
    • Tables exist
    • Tables contain data
  2. troubleshoot_connection: Provides detailed information about:

    • Database connection settings
    • Connection errors
    • Table structure
    • Recommended fixes
  3. create_database_schema: Creates the database tables and provides:

    • List of created tables
    • Any errors that occurred
    • Test record creation results

License

MIT License

Contributors

  • Lenin Carrasco - Initial work

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MedifinderMCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/medifinder-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage