health-example
Provides read-only access to InterSystems IRIS data, including parameterized patient searches, bounded traversal of allowlisted globals, namespace global-size monitoring, and redacted application error summaries.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@health-exampleFind patients due for a preventive care visit"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Data Exposure Toolkit
Technical architecture, credentials, role configuration, and request flow: dev.md.
Secure templates exposing synthetic preventive-care outreach data and basic IRIS namespace health through MCP. One ToolSet demonstrates parameterized SQL, bounded global traversal, global-size monitoring, and redacted application-error summaries. No arbitrary SQL or global name is accepted.
Why this fulfills the idea
The idea asks for reusable examples that use AI Hub to discover and expose enterprise IRIS data through MCP while controlling access to sensitive information. This project provides that complete path:
%AI.Toolmethods define small, typed operations over IRIS data.%AI.ToolSetgroups those operations and makes their schemas discoverable.%AI.MCP.Servicepublishes the ToolSet as an MCP endpoint.iris-mcp-serverexposes that native AI Hub service to any compatible MCP client or agent.AI Hub authorization and audit policies control and record every tool call.
The project includes templates for IRIS data shapes:
SQL:
SearchPatientsreads the imported 500-record healthcare dataset through one fixed parameterized query.Globals:
ReadGlobalDatatraverses the^ERRORSglobal with bounded depth and result count.Operational data:
LargestGlobalsuses native%SYS.GlobalQuery, whileRecentApplicationErrorsreturns a redacted view of the application error log.
These are examples, not a generic database gateway. A developer can copy a tool and replace its fixed query or allowlisted global with an enterprise-specific resource. The same ToolSet, policy, MCP service, and authentication structure remains reusable.
Related MCP server: mcp-health-server
Why the MCP bridge is required
The ObjectScript classes and iris-mcp-server have separate responsibilities. %AI.MCP.Service defines the native AI Hub service inside IRIS, connects it to the ToolSet, and keeps execution under IRIS authorization. It does not by itself provide the Streamable HTTP transport expected by external MCP clients.
iris-mcp-server is the AI Hub EAP binary that provides that transport. It accepts MCP requests over HTTP, connects to IRIS through the native protocol on port 1972, and forwards calls to the registered %AI.MCP.Service. An equivalent transport component is therefore required for external clients; this project uses the official binary instead of implementing a custom gateway.
The binary runs in the separate mcp sidecar container. This is not a second IRIS instance and not an IRIS web application. The sidecar keeps bridge startup, logs, health, and restarts separate from the database process:
MCP client
-> http://localhost:8280/mcp/health-example
-> iris-mcp-server in the mcp container (port 8080)
-> IRIS service iris:1972
-> MCPData.Service.HealthExample
-> MCPData.ToolSet.HealthExampleThe same binary could run in the IRIS container or on the host, but that would not remove the bridge. The sidecar is the smallest deployment that follows the official AI Hub template.
Security model
Sensitive access is controlled at several layers:
Clients connect through
iris-mcp-server(the MCP bridge), not directly to IRIS. This isolates the native IRIS protocol port and provides a more secure, controlled transport layer.The endpoint user receives only the
MCPDataReaderrole.The role receives
SELECTonly onMCPData_Data.Patient; database-resource access alone does not bypass IRIS SQL privileges.The authorization policy permits only five named tools.
Clients cannot submit arbitrary SQL.
Clients cannot choose an arbitrary global name.
Query results, traversal depth, and monitoring results have hard limits.
Monitoring stays inside the
MCP_EXAMPLEnamespace and cannot inspect the full IRIS instance.The audit policy records tool name, status, duration, and bounded result metadata.
This combination demonstrates both discovery and least-privilege exposure: an agent can discover what is available through MCP, but it can execute only the narrow operations deliberately published by the application.
Run
A development .env.example is included locally, you can just rename to .env and launch the build and everything should work properly.
VS Code users: Open this project folder and run the MCP - Docker: Build and Start task from Tasks: Run Task.
Command line users: Run from the project directory:
docker compose up -d --buildIRIS Portal: http://localhost:9292/csp/sys/UtilHome.csp (default credentials: username
_SYSTEM, passwordSYS).
The MCP URL is a protocol endpoint, not a browser user interface. Test it with VS Code or another MCP client using the configurations in dev.md.
Exact local client connection
After running the build task, verify the IRIS container is running and the user defined in the APP_USER variable of .env has the MCPDataReader role.
A correct connection discovers these five public MCP tool names:
mcp_health-example_ListResources
mcp_health-example_SearchPatients
mcp_health-example_ReadGlobalData
mcp_health-example_LargestGlobals
mcp_health-example_RecentApplicationErrorsAn optional Python smoke test verifies authentication, checks that all five tools are discoverable, invokes every tool with small bounded inputs, and prints each structured response:
uv venv --python 3.12
source .venv/bin/activate
uv pip install -r requirements.txt
set -a
source .env
set +a
python test_mcp.pySuccessful output reports five discovered tools followed by results for resource discovery, three synthetic Diabetes patients, the ^ERRORS global, the five largest namespace globals, and up to five recent application errors. The bridge exposes each tool with the mcp_health-example_ prefix, and the test verifies those exact public MCP names. It exits with status 1 when credentials, discovery, or invocation fail.
VS Code users can also run MCP - Docker: Cleanup Everything or MCP - Open: IRIS Management Portal from Tasks: Run Task. Cleanup removes containers, networks, and project volumes.
Exposed tools
ListResources: declares exact read-only surface.SearchPatients: searches imported patient records by diagnosis, diabetic status, smoker status, and age range. It accepts scalar filters only and returns at most 50 rows.ReadGlobalData: reads the^ERRORSglobal with bounded depth and result count.LargestGlobals: top 1-20 globals visible inMCP_EXAMPLE, using native%SYS.GlobalQuery; system globals and mapped subscript ranges are excluded.RecentApplicationErrors: latest 1-20MCP_EXAMPLEapplication errors from^ERRORS; returns only ID, timestamp, and error text. Stack, variables, usernames, and object data stay hidden.
Data is synthetic and contains patient codes, not names.
Tool invocation prompts
Tool | Prompt to invoke |
| "List all available resources and tools from the MCP server." |
| "Find diabetic patients aged 60 or older with a Diabetes diagnosis. Return at most 10 records. Use the tools exposed by the MCP server." |
| "Read the ERRORS global at path ^ERRORS with depth 2 and limit 20. Use the MCP server tools." |
| "Show me the 5 largest globals in the MCP_EXAMPLE namespace. Use the MCP server." |
| "Get the 10 most recent application errors from MCP_EXAMPLE. Use the tools exposed by the MCP server." |
Output supports operational outreach only. Monitoring is read-only and namespace-scoped, not an unrestricted whole-instance diagnostic API. Authorization and audit policies attach at ToolSet level.
Agent scope examples
The following prompts demonstrate the security boundaries enforced by the MCP server. Agents can discover and use only the explicitly exposed tools and resources.
✅ Allowed: Discover and use exposed resources
Capability | Example Prompt | Result |
List available tools | "List all available resources and tools from the MCP server." | Returns tool list with 5 discoverable tools |
Query patient data | "Find diabetic patients aged 60 or older with a Diabetes diagnosis. Return at most 10 records. Use the tools exposed by the MCP server." | Returns filtered patient results (max 50 rows) |
Read error log | "Get the 10 most recent application errors from MCP_EXAMPLE. Use the tools exposed by the MCP server." | Returns redacted errors (ID, timestamp, text only) |
Read ^ERRORS global | "Read the ERRORS global at path ^ERRORS with depth 2 and limit 20. Use the MCP server tools." | Returns bounded global traversal |
Monitor namespace | "Show me the 5 largest globals in the MCP_EXAMPLE namespace. Use the MCP server." | Returns top globals by size |
❌ Denied: Access to non-allowlisted resources
Attempt | Example Prompt | Result |
Arbitrary SQL | "Run SELECT * FROM MCPData_Data.Patient. Use the MCP server." | Denied: Tool not allowlisted (no arbitrary SQL) |
Non-allowlisted global | "Read the ^MCPData.Care global. Use the MCP server tools." | Denied: Only ^ERRORS global is allowed |
Cross-namespace access | "Show me the 5 largest globals in the USER namespace. Use the MCP server." | Denied: Monitoring stays inside MCP_EXAMPLE namespace |
Unbounded results | "Find all patients without a limit. Use the MCP server." | Denied: Results clamped to max 50 rows |
Arbitrary table access | "List all tables in the database. Use the MCP server." | Denied: No schema discovery tools exposed |
Key principle: Agents can discover what is available through MCP, but can execute only the narrow operations deliberately published by the application. All access is read-only, namespace-scoped, and bounded.
Synthetic patient dataset
The project imports all 500 records from data/synthetic_healthcare_data.csv during container installation. The source is Synthetic Healthcare Patient Records Dataset by dnation on Kaggle.
Each record contains age, gender, BMI, blood pressure, cholesterol level, smoker and diabetic status, diagnosis, treatment cost, admission and discharge dates, and outcome. The data is synthetic and contains no real patient information, making it suitable for this open MCP example.
MCPData.Data.Patient is the only patient class and persistent IRIS table. It imports the CSV used by SearchPatients, separates blood pressure into systolic and diastolic numeric columns, and converts dates and yes/no fields to native IRIS types. This gives agents a realistic SQL discovery example without exposing protected health information.
Example request:
Find diabetic patients aged 60 or older with a Diabetes diagnosis.
Return at most 10 records.
Do not search the local workspace or use other data sources.
Use the tools exposed by the MCP server.WG_USERandWG_PASSidentify the bridge when it opens its internal native-protocol connection to IRIS on port1972. This project uses the built-in, privilegedCSPSystemaccount. These infrastructure credentials stay inside the bridge and must never be configured in an MCP client.APP_USERandAPP_PASSidentify the MCP client at the published endpoint.MCPData.Setup.ConfigureUsers()creates this IRIS application user asmcp_readerand assigns only theMCPDataReaderrole.
MCP client
-- HTTP Basic with APP_USER and APP_PASS --> iris-mcp-server
-- native connection with WG_USER and WG_PASS --> IRISNever reuse gateway credentials as endpoint credentials. Compromise of the limited application account must not expose the privileged bridge identity.
Reuse
Adapt SearchPatients by replacing its fixed query and scalar filters. Adapt global exposure by changing exact allowlist, never by accepting arbitrary global names. Project ../my-first-agent includes optional client configuration for this endpoint.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceRead-only MCP server for licensed Healthpoint HL7 FHIR API access.101Apache 2.0
- AlicenseAqualityBmaintenanceA Claude-compatible MCP server that exposes health-domain tools over 100% synthetic data, built with security and compliance in mind.4MIT
- AlicenseBqualityBmaintenanceA deliberately small MCP server that demonstrates security hardening against the OWASP MCP Top 10 with tools for file search, record queries, and document fetching, each defended against path traversal, SQL injection, and SSRF.4MIT
- FlicenseNot gradedqualityBmaintenanceRead-only MCP server providing 5 tools for hybrid search, clause retrieval, policy versioning, code lookup, and plan rider override queries over a synthetic medical-policy corpus.
Related MCP Connectors
Hosted MCP server exposing US hospital procedure cost data to AI assistants
MCP server for AI access to Swagger by SmartBear.
MCP server for medicare-coverage
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pietrodileo/iris-mcp-data-exposure-toolkit'
If you have feedback or need assistance with the MCP directory API, please join our Discord server