An MCP (Model Context Protocol) server for querying the UCSF OMOP electronic health records database for rapid clinical data retrieval.
- Query UCSF OMOP Database: Execute SQL queries on the UCSF OMOP de-identified clinical database
- List Available Tables: Discover all available clinical data tables
- Pre-configured Server: Server and database endpoints are pre-configured - only provide your credentials!
uvx --from git+https://github.com/BaranziniLab/UCSFOMOPAgent ucsfomopagentcd UCSFOMOPAgent
pip install -e .Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"ucsfomopagent": {
"command": "uvx",
"args": ["--from", "git+https://github.com/BaranziniLab/UCSFOMOPAgent", "ucsfomopagent"],
"env": {
"CLINICAL_RECORDS_USERNAME": "CAMPUS\\YourUsername",
"CLINICAL_RECORDS_PASSWORD": "YourPassword"
}
}
}
}Set environment variables and run:
export CLINICAL_RECORDS_USERNAME="CAMPUS\\YourUsername"
export CLINICAL_RECORDS_PASSWORD="YourPassword"
ucsfomopagentPre-configured server settings:
- Server: QCDIDDWDB001.ucsfmedicalcenter.org
- Database: OMOP_DEID
Required environment variables (you must provide):
CLINICAL_RECORDS_USERNAME: Your UCSF database username (e.g., "CAMPUS\username")CLINICAL_RECORDS_PASSWORD: Your UCSF database password
Optional environment variable:
OMOP_LOG_LEVEL: Set logging level (DEBUG, INFO, WARNING, ERROR) - defaults to INFO
Execute a READ-ONLY SQL query on the UCSF OMOP electronic health records database.
Parameters:
sql_query(string, required): SQL SELECT query for rapid clinical record retrieval
Example:
SELECT TOP 10 person_id, gender_concept_id, year_of_birth
FROM dbo.person
WHERE year_of_birth > 1980List all available clinical data tables in the UCSF OMOP electronic health records database.
Returns: JSON list of tables with schema, name, type, and full name.
This server enforces read-only access to the UCSF OMOP database. Write operations (INSERT, UPDATE, DELETE, etc.) are not permitted.
Important:
- Only SELECT queries are allowed
- The database contains de-identified patient data
- Follow all UCSF data use policies and HIPAA regulations
The UCSF OMOP database follows the OMOP Common Data Model (CDM) standard, which includes standardized tables such as:
person: Patient demographicscondition_occurrence: Diagnosis and conditionsdrug_exposure: Medication recordsprocedure_occurrence: Medical proceduresmeasurement: Lab results and vital signsobservation: Clinical observationsvisit_occurrence: Healthcare visits
MIT
- Wanjun Gu (wanjun.gu@ucsf.edu)
- Gianmarco Bellucci (gianmarco.bellucci@ucsf.edu)
The Observational Medical Outcomes Partnership (OMOP) Common Data Model (CDM) is designed to standardize the structure and content of observational data to enable efficient analyses across disparate datasets.