Hospital

Provides secure read-only hospital data via MCP tools connected to PostgreSQL
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "sheshugit-mcp_postgres": {
      "command": "C:\\Users\\shesh\\my-first-mcp-server\\.venv\\Scripts\\python.exe",
      "args": [
        "C:\\Users\\shesh\\my-first-mcp-server\\main.py",
        "stdio"
      ],
      "env": {
        "DB_HOST": "localhost",
        "DB_NAME": "db_name",
        "DB_PORT": "5432",
        "DB_USER": "postgres",
        "DB_PASSWORD": "your_password"
      }
    }
  }
}

You run a Python-based MCP server that exposes secure, read-only access to a PostgreSQL hospital management system through safe data views. This setup lets Claude Desktop query hospital data via defined MCP tools without touching raw tables, ensuring data protection while enabling practical, read-only access for workflows and queries.

How to use

You connect Claude Desktop to your MCP server so it can automatically discover and call the available tools. Your client will request information such as doctor lists, appointments, or billing summaries, and the MCP server will fetch data from PostgreSQL using safe, parameterized queries through the predefined read-only views.

How to install

Prerequisites you need before starting:

  • Python 3.9+ installed on your system

  • A PostgreSQL database accessible from the server host

Follow these concrete steps to install and run the MCP server locally:

How to install

uv sync

Or if using pip manually:

pip install -r requirements.txt

(Dependencies are defined in pyproject.toml)

## Additional sections

Security and data access are implemented through read-only PostgreSQL views and a restricted database role. Create secure read-only views first, then expose only those views through an MCP role.

PostgreSQL setup highlights from the configuration:
- Create safe read-only views for the data you want Claude to access
- Create a restricted role mcp\_readonly with read access to those views
- Set tight session timeouts to prevent long-lived, idle connections

Environment variables required by the MCP server to connect to PostgreSQL are listed in the deployment configuration. You will provide these values to the MCP runtime so it can authenticate to the database.

In Claude Desktop, the MCP server is registered as a local stdio server using a complete command that launches your Python MCP server and runs it in stdio mode. The client discovers the tools exposed by the server and calls them to fetch safe results from PostgreSQL.

Example testing workflow you can perform in Claude:
- Ask for a list of doctors in a department
- Request appointments for a specific doctor
- Retrieve patient billing summaries
Claude will route these requests to the appropriate MCP tool, query the database safely, and return structured results.

## Available tools

### get\_doctor\_by\_id

Fetches a single doctor by their identifier, returning read-only details such as department and specialization.

### list\_doctors\_by\_department

Returns doctors within a specified department, enabling department-wide overviews.

### get\_appointments\_for\_doctor

Retrieves appointments for a given doctor, filtered by date or other constraints as supported by the server.

### check\_room\_status

Checks the current status of a room, such as occupancy and availability.

### get\_patient\_billing\_summary

Provides a billing summary for a patient, including related admission and appointment references.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
Hospital MCP Server - sheshugit/mcp_postgres | VeilStrat