Back to Home
filiperochalopes icon

esus-pec-mcp

Verified Safe

by filiperochalopes

Overview

Serves as a Model Context Protocol (MCP) endpoint for LLMs to securely query anonymized clinical data from a PostgreSQL-based Prontuário Eletrônico do Cidadão (PEC) database.

Installation

Run Command
export PYTHONPATH=$PYTHONPATH:$(pwd)/src && python src/pec_mcp/server.py

Environment Variables

  • PEC_DB_HOST
  • PEC_DB_PORT
  • PEC_DB_NAME
  • PEC_DB_USER
  • PEC_DB_PASSWORD
  • MCP_HTTP_HOST
  • MCP_HTTP_PORT

Security Notes

The server demonstrates strong security practices: all database queries are read-only and use parameterized inputs to prevent SQL injection. It enforces strict limits on returned data rows (typically 50-200, up to 1000 for SOAP notes) and anonymizes sensitive patient identifiers (e.g., full names are converted to initials). Tools require specific filters to prevent broad data sweeps. Hardcoded database credentials are explicitly stated as defaults for development and users are instructed to override them with environment variables or a .env file for production. No 'eval' or other dynamic code execution patterns were found. The most sensitive data (SOAP notes) requires a specific patient ID and is subject to limits.

Similar Servers

Stats

Interest Score0
Security Score9
Cost ClassMedium
Avg Tokens7500
Stars0
Forks0
Last Update2026-01-19

Tags

MCPHealthcareClinical DataLLM ToolsPostgreSQL