An MCP (Model Context Protocol) server for querying the UCSF Multiple Sclerosis medical database for rapid clinical data retrieval.
- Query MS Database: Execute SQL queries on the UCSF Multiple Sclerosis medical database
- List Available Tables: Discover all available clinical data tables with schema information
- Pre-configured Access: All database connection parameters are pre-configured - no setup required!
- Read-Only Security: Only SELECT, SHOW, DESCRIBE, and EXPLAIN queries allowed
uvx --from git+https://github.com/BaranziniLab/MSBaseAgent msbaseagentcd MSBaseAgent
pip install -e .Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"msbaseagent": {
"command": "uvx",
"args": ["--from", "git+https://github.com/BaranziniLab/MSBaseAgent", "msbaseagent"]
}
}
}msbaseagentAll database connection parameters are pre-configured:
- Server: queryms.ucsf.edu
- Port: 3306
- Username: medcp
- Password: Medcp_aiqueries_123#@!
- Database: imsms
- Namespace: MSAgent
No additional configuration is required!
Optional environment variable:
MSBASE_LOG_LEVEL: Set logging level (DEBUG, INFO, WARNING, ERROR) - defaults to INFO
List all tables in the MySQL database with their columns and data types.
Parameters:
database(string, optional): Database name to list tables from (defaults to "imsms")
Example: Returns comprehensive schema information including table structure, column names, data types, constraints, and row counts.
Execute a READ-ONLY SQL query on the UCSF MS medical database.
Parameters:
query(string, required): SQL SELECT query to executedatabase(string, optional): Database name to execute query against (defaults to "imsms")
Example:
SELECT COUNT(*) FROM patients WHERE diagnosis_date > '2023-01-01'This server enforces read-only access to the MS database. Write operations (INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, TRUNCATE, etc.) are not permitted.
Important:
- Only SELECT, SHOW, DESCRIBE, and EXPLAIN queries are allowed
- The database contains de-identified patient data
- Follow all UCSF data use policies and HIPAA regulations
- UCSF Network Access: Must be connected to UCSF network or VPN
- Port 3306: MySQL port must be accessible
- DNS Resolution: Must be able to resolve
queryms.ucsf.edu
The UCSF MS medical database contains clinical research data related to Multiple Sclerosis patients, including:
- Patient demographics
- Clinical assessments
- Treatment records
- Disease progression markers
- Lab results
- Imaging data
Use the MSAgent-list_tables tool to explore the complete database schema.
- Check UCSF VPN connection
- Verify network connectivity to queryms.ucsf.edu
- Ensure port 3306 is accessible
- Verify you are connected to UCSF network or VPN
- Check if database server is accessible
- Contact UCSF IT if issues persist
- Use
MSAgent-list_tablesto verify table and column names - Check SQL syntax
- Ensure query is read-only (SELECT statements only)
MIT
Wanjun Gu
- Email: wanjun.gu@ucsf.edu
- Website: https://broccolito.github.io/
MSBaseAgent is designed specifically for authorized medical research personnel at UCSF working with Multiple Sclerosis clinical data. It provides secure, read-only access to clinical databases for research analysis and data exploration.
- UCSF Multiple Sclerosis Center for database access
- Model Context Protocol (MCP) community
- FastMCP framework