@iris-mcp/data
v1.1.0
Published
IRIS Data & Analytics MCP Server
Maintainers
Readme
@iris-mcp/data
IRIS Data & Analytics MCP Server -- DocDB document database, DeepSee analytics (MDX queries and cube management), and REST API management via the Model Context Protocol.
Part of the IRIS MCP Server Suite.
Installation
npm install -g @iris-mcp/dataOr run directly without installing:
npx -y @iris-mcp/data@1Configuration
All servers use the same environment variables:
| Variable | Default | Description |
|----------|---------|-------------|
| IRIS_HOST | localhost | IRIS hostname or IP |
| IRIS_PORT | 52773 | IRIS web server port |
| IRIS_USERNAME | (required) | IRIS username. There is no default: a server that starts without it fails, naming the variable. |
| IRIS_PASSWORD | (required) | IRIS password |
| IRIS_NAMESPACE | USER | Default IRIS namespace |
| IRIS_HTTPS | false | Use HTTPS instead of HTTP |
| IRIS_ACCEPT_LANGUAGE | en-US,en;q=0.9 | Optional. Accept-Language header sent on every request, pinning %Status error text to a predictable language instead of whatever locale an unspecified header resolves to. IRIS also chooses the message language per request, by matching this header against the languages the instance has, so a localized prefix can still appear when the header names one — existing prefix-stripping is unaffected. Details: suite README. |
Multiple servers & the server parameter
Optionally, set IRIS_PROFILES (a JSON map of named IRIS instances) and IRIS_GOVERNANCE (a JSON tool-action policy) to target several instances from one server and restrict which actions are allowed. Every tool accepts an optional server parameter (a profile name from IRIS_PROFILES) that selects which instance the call targets; omit it to use the default profile. It composes with the existing per-call namespace override. Both variables are optional and additive — omit them and this server behaves exactly as a single-instance, fully-enabled install. Full model, escaping, and worked examples: Multiple Servers & Governance.
Optionally, set IRIS_GOVERNANCE_FILE to the path of a JSON file of the same shape as IRIS_GOVERNANCE to load policy from a file shared across several MCP clients instead of inline JSON. Optional and additive — unset (the default) means inert: no file is ever read and behavior is byte-for-byte unchanged. An IRIS_GOVERNANCE env value always wins over the file. Details: Governance file.
Tool Visibility (IRIS_TOOLS_PRESET)
This server's 7 tools are already inside the researched 5-15-tool sweet spot, so IRIS_TOOLS_PRESET=core and =developer both keep all 8 runtime tools (7 + iris_server_profiles) visible — iris-data-mcp is unaffected by any preset. IRIS_TOOLS_DISABLE/IRIS_TOOLS_ENABLE still work here to hide/force-show individual tools independent of the preset. Full model and the payload-size measurements: Tool Visibility Presets.
Audit Logging (IRIS_AUDIT_LOG)
For regulated deployments, set IRIS_AUDIT_LOG=/path/to/audit.jsonl to record every MCP tool call this server handles — success, error, or governance denial — as one secrets-free JSON line (session, sequence, tool, action, outcome, redacted parameter keys). It is off by default (unset ⇒ a mechanical no-op, zero filesystem writes) and framework-wide — the same interceptor covers every tool on this server. IRIS_AUDIT_LOG_MAX_MB (default 50) sets the single-generation rotation size; IRIS_AUDIT_LOG_PARAMS=true additionally records (redacted) parameter values. Because it is server-side configuration — not a governed tool action — an AI client cannot disable its own audit trail; only an operator with server-environment access can. Full record shape, redaction rules, and how it differs from IRIS's own security-audit tools: Compliance & Auditability.
Server Manager connections (IRIS_SERVER_MANAGER)
Set IRIS_SERVER_MANAGER=auto to import IRIS connection definitions straight from the InterSystems Server Manager VS Code extension's intersystems.servers settings — one curated roster instead of re-typing host/port/username into every MCP client's config. IRIS_SERVER_MANAGER is framework configuration, not a tool — it applies identically across all five servers in the suite. Omit (or set "off", the default) for today's behavior: no settings file is ever read. A password-less imported definition is completed via an OS-keychain / IRIS_CREDENTIAL_HELPER credential chain (see the iris-mcp-credentials CLI — Server Manager passwords themselves are never readable outside VS Code, by design); iris_server_profiles reports where each profile's connection fields came from via source ("env"/"server-manager") and sourceFile. The companion variables are all optional, each with its own default: IRIS_SM_SERVERS (unset — import all), IRIS_SM_SETTINGS_PATHS (unset — normal discovery), IRIS_SM_WORKSPACE (unset — the process CWD) and IRIS_CREDENTIAL_HELPER (unset). Full model, discovery precedence, and the SecretStorage boundary explained plainly: Server Manager connections.
MCP Client Configuration
Claude Code (.mcp.json)
{
"mcpServers": {
"iris-data-mcp": {
"command": "npx",
"args": ["-y", "@iris-mcp/data@1"],
"env": {
"IRIS_HOST": "localhost",
"IRIS_PORT": "52773",
"IRIS_USERNAME": "_SYSTEM",
"IRIS_PASSWORD": "SYS",
"IRIS_NAMESPACE": "USER"
}
}
}
}Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"iris-data-mcp": {
"command": "npx",
"args": ["-y", "@iris-mcp/data@1"],
"env": {
"IRIS_HOST": "localhost",
"IRIS_PORT": "52773",
"IRIS_USERNAME": "_SYSTEM",
"IRIS_PASSWORD": "SYS",
"IRIS_NAMESPACE": "USER"
}
}
}
}Cursor
{
"iris-data-mcp": {
"command": "npx",
"args": ["-y", "@iris-mcp/data@1"],
"env": {
"IRIS_HOST": "localhost",
"IRIS_PORT": "52773",
"IRIS_USERNAME": "_SYSTEM",
"IRIS_PASSWORD": "SYS",
"IRIS_NAMESPACE": "USER"
}
}
}Note: Replace
"SYS"with your actual IRIS password. Avoid committing real credentials to version control.
Prerequisites
In addition to the standard prerequisites, the four DocDB tools require the %Service_DocDB service to be enabled on the IRIS instance. %Service_DocDB is disabled by default on IRIS. Enable it through the Management Portal under System Administration > Security > Services > %Service_DocDB, or via the iris_service_manage tool (action="enable", name="%Service_DocDB" — that tool is provided by the @iris-mcp/admin server) — note that action is itself governance-default-disabled and needs an IRIS_GOVERNANCE override such as {"global": {"iris_service_manage:enable": true}}. While the service is disabled, every DocDB call fails with ERROR #822: Access Denied; the tools detect this case and return an actionable error naming both remedy routes. The detection performs one follow-up check of the live service state via the suite's custom ExecuteMCPv2 REST endpoint — on an instance without that endpoint deployed, the raw ERROR #822 passes through unchanged.
Tool Reference
Framework Tools
Provided by the shared framework and available on every suite server (Epic 19).
| Tool | Description | Key Parameters | Annotations |
|------|-------------|----------------|-------------|
| iris_server_profiles | Call this first. Reports the configured server-profile roster (non-secret connection metadata — password is never included) and the effective governance policy (which actions are enabled/disabled). | profile?, allProfiles? | readOnly, idempotent |
iris_server_profiles is a read tool, enabled by default. It reports in-memory config and does not connect to IRIS. Use it to choose the right server profile and avoid governance-disabled actions before invoking other tools.
Document Database (DocDB) Tools
| Tool | Description | Key Parameters | Annotations |
|------|-------------|----------------|-------------|
| iris_docdb_manage | Create, drop, or list document databases | action, database?, namespace? | destructive |
| iris_docdb_document | Insert, get, update, or delete documents | action, database, id?, document?, namespace? | destructive |
| iris_docdb_find | Query documents with filter criteria | database, filter, namespace? | readOnly, idempotent |
| iris_docdb_property | Create, drop, or index properties | action, database, property, type?, namespace? | destructive |
All four DocDB tools require
%Service_DocDBto be enabled on the instance (disabled by default on IRIS) — see Prerequisites. With the service disabled they return an actionableERROR #822: Access Deniederror naming both remedy routes.
Analytics Tools
| Tool | Description | Key Parameters | Annotations |
|------|-------------|----------------|-------------|
| iris_analytics_mdx | Execute MDX queries against DeepSee | query, namespace? | readOnly, idempotent |
| iris_analytics_cubes | List, build, or synchronize DeepSee cubes | action, cube?, namespace? | -- |
REST API Management Tools
| Tool | Description | Key Parameters | Annotations |
|------|-------------|----------------|-------------|
| iris_rest_manage | List, get details, or delete REST applications | action, scope?, application?, fullSpec?, namespace? | destructive |
iris_rest_manage scope values:
| scope | Returns |
|---------|---------|
| "spec-first" (default) | OpenAPI/spec-first apps only (via IRIS Management API) |
| "legacy" | Hand-written %CSP.REST subclasses only |
| "all" | Union of spec-first + legacy (deduplicated by name) |
Breaking change (pre-release): The former
scope:"all"(legacy-only) has been renamedscope:"legacy". The newscope:"all"returns the full union of both types.
iris_rest_manage get action — fullSpec parameter:
When action:"get", the OpenAPI spec can be a large JSON document (50 KB+). By default (fullSpec:false) the tool returns a compact envelope in which the full spec is replaced by a swaggerSpec summary (and name/namespace fall back to the requested application path and resolved namespace when the spec body carries none):
{
"name": "/api/myapp",
"dispatchClass": null,
"namespace": "USER",
"swaggerSpec": {
"basePath": "/api/myapp",
"pathCount": 12,
"definitionCount": 5,
"description": "...",
"title": "My REST API",
"version": "1.0"
}
}Pass fullSpec:true to receive the complete OpenAPI spec object (returned as-is). When the application has no resolvable spec, swaggerSpec is null.
iris_rest_manage get action — legacy names (Story 35.6):
get resolves every name list returns. For a legacy %CSP.REST name (which the IRIS Management API does not know — it covers spec-first apps only), get falls back to the legacy webapp list and returns the legacy detail with an explanation field; swaggerSpec stays null (a legacy app has no OpenAPI spec by design) and fullSpec has no effect:
{
"name": "/api/executemcp/v2",
"dispatchClass": "ExecuteMCPv2.REST.Dispatch",
"namespace": "HSCUSTOM",
"swaggerSpec": null,
"explanation": "Legacy hand-written %CSP.REST application — resolved via the ExecuteMCPv2 webapp list ..."
}A name found in neither scope fails with an accurate not-found naming BOTH scopes checked — never the CSP gateway's misleading "Check the IRIS web server configuration" 404 text. If the legacy webapp list itself cannot be queried, the error says the legacy scope could not be checked (with the reason) rather than claiming the name is absent from it.
iris_rest_manage delete action: removes spec-first REST applications only. Deleting a legacy %CSP.REST name fails with an explanation pointing at iris_webapp_manage:delete (the correct tool for removing a legacy web application — there are no spec classes to remove).
Prompts
No prompts in v1 (Epic 25). See the Workflow Prompts & Agent Skills section of the suite README for the prompts shipped by the other four servers.
Tool Examples
Input:
{
"action": "list"
}Output:
{
"items": [
{ "name": "People", "count": 150 },
{ "name": "Products", "count": 42 }
],
"count": 2
}Input:
{
"action": "create",
"database": "Customers"
}Output:
{
"database": "Customers",
"status": "created"
}Input:
{
"action": "insert",
"database": "Customers",
"document": {
"name": "John Smith",
"email": "[email protected]",
"age": 35
}
}Output:
{
"id": "1",
"status": "inserted"
}Input:
{
"action": "get",
"database": "Customers",
"id": "1"
}Output:
{
"%DocumentId": "1",
"name": "John Smith",
"email": "[email protected]",
"age": 35
}Input:
{
"database": "Customers",
"filter": {
"age": { "$gt": 30 }
}
}Output:
{
"items": [
{ "%DocumentId": "1", "name": "John Smith", "email": "[email protected]", "age": 35 }
],
"count": 1
}Filter translation: MongoDB-style operators are translated to IRIS DocDB restriction predicates.
Supported: $eq (=), $ne (!=), $lt (<), $lte (<=), $gt (>), $gte (>=).
Multiple fields are combined with AND. Example: {"age": {"$gt": 26}, "active": true} translates to
[["age", 26, ">"], ["active", true, "="]] and is sent as {restriction: [...]} in the request body.
Properties must be defined on the database (via iris_docdb_property) and the property type must match the
comparison operator for filtering to work correctly (e.g., use %Integer for numeric $gt/$lt comparisons).
Input:
{
"action": "create",
"database": "Customers",
"property": "age",
"type": "%Integer"
}Output:
{
"Name": "age",
"Type": "%Library.Integer"
}Type encoding note: The IRIS DocDB API reads type from a URL query parameter, not the JSON body.
IRIS type names begin with % (e.g. %Integer, %String). The tool encodes these correctly using
split/join encoding that preserves the % prefix as a literal % in the URL — standard encodeURIComponent
would convert %Integer to %25Integer, causing IRIS to look for class %Library.25Integer.
Input:
{
"action": "index",
"database": "Customers",
"property": "email"
}Output:
{
"property": "email",
"indexed": true
}Input:
{
"query": "SELECT [Measures].[Count] ON 0, [Product].[Product Category].Members ON 1 FROM [Sales]"
}Output:
{
"columns": ["Count"],
"rows": [
{ "label": "Electronics", "values": [1200] },
{ "label": "Clothing", "values": [850] },
{ "label": "Books", "values": [2100] }
],
"rowCount": 3,
"columnCount": 1
}Input:
{
"action": "list"
}Output:
{
"cubes": [
{
"name": "Sales",
"sourceClass": "MyApp.Fact.Sales",
"factCount": 50000,
"lastBuildTime": "2026-04-06T22:00:00.000Z",
"lastBuildTimeRaw": "67300,79200.000"
}
],
"count": 1
}Each cube entry carries both a human-readable ISO 8601 lastBuildTime and
the original $HOROLOG string under lastBuildTimeRaw, so clients can
cross-check against $ZDATETIME or round-trip the raw value when needed.
Malformed or missing horolog values yield lastBuildTime: "" without
throwing; the raw value is still preserved when it is a string.
Input:
{
"action": "build",
"cube": "Sales"
}Output:
{
"cube": "Sales",
"action": "build",
"status": "completed",
"recordCount": 50000
}Input (default — spec-first apps only):
{
"action": "list"
}Output (spec-first):
{
"items": [
{
"name": "HS.FHIRServer.Management.REST.v1",
"dispatchClass": "HS.FHIRServer.Management.REST.v1.disp",
"swaggerSpec": "/api/mgmnt/v2/HSCUSTOM/HS.FHIRServer.Management.REST.v1"
}
],
"count": 1
}The default scope: "spec-first" matches the SMP REST listing and routes
to IRIS's built-in Management API (/api/mgmnt/v2/{ns}/), which returns only
OpenAPI-spec-first dispatch classes (the ones with a .spec companion).
Hand-written %CSP.REST subclasses (for example, ExecuteMCPv2.REST.Dispatch)
are excluded by design of the IRIS Management API.
Input (hand-written %CSP.REST subclasses only):
{
"action": "list",
"scope": "legacy",
"namespace": "HSCUSTOM"
}Output (scope: "legacy"):
{
"items": [
{
"name": "/api/executemcp/v2",
"dispatchClass": "ExecuteMCPv2.REST.Dispatch",
"namespace": "HSCUSTOM",
"swaggerSpec": null
}
],
"count": 1
}scope: "legacy" uses the ExecuteMCPv2 webapp endpoint and filters entries
with a non-empty dispatchClass. Hand-written dispatch classes have no
companion spec class, so swaggerSpec is null for them.
Input (all REST applications — spec-first + hand-written):
{
"action": "list",
"scope": "all",
"namespace": "HSCUSTOM"
}scope: "all" fetches both spec-first (via IRIS Management API) and legacy
(via ExecuteMCPv2 webapp endpoint) in parallel and returns the deduplicated union.
Note: The former
scope:"all"(pre-release, before the Story 12.5 rename) only returned hand-written classes. That behavior is nowscope:"legacy". Update any existing calls accordingly.
Input:
{
"action": "get",
"application": "/api/myapp"
}Output:
{
"name": "/api/myapp",
"dispatchClass": "MyApp.REST.Dispatch",
"routes": [
{ "method": "GET", "url": "/items", "call": "GetItems" },
{ "method": "POST", "url": "/items", "call": "CreateItem" }
]
}For a legacy %CSP.REST name (e.g. /api/executemcp/v2, which list with scope:"legacy" or "all" returns), get falls back to the legacy webapp list and returns {name, dispatchClass, namespace, swaggerSpec: null, explanation} — see get action — legacy names above. A name in neither scope returns an accurate not-found naming both scopes checked.
Namespace Scoping
All 7 tools in this package accept the optional namespace parameter to target a specific IRIS namespace. If omitted, the configured default namespace (IRIS_NAMESPACE environment variable) is used.
DocDB tools use the IRIS built-in DocDB REST API at /api/docdb/v1/{namespace}/.... The namespace is included directly in the API URL path.
Analytics tools use the custom REST endpoint and pass namespace as a request parameter.
REST management tools use the IRIS built-in Management API at /api/mgmnt/v2/{namespace}/....
Important: DocDB tools require the %Service_DocDB service to be enabled in the target IRIS instance (it is disabled by default on IRIS). Without this service, DocDB operations fail with ERROR #822: Access Denied — the tools detect this case and return an actionable error naming the cause and both remedy routes (Management Portal, or iris_service_manage action="enable" under an IRIS_GOVERNANCE override).
Error Handling
Common Errors
| Error | Cause | Resolution |
|-------|-------|------------|
| IRIS connection refused | IRIS web server not running or wrong host/port | Verify IRIS_HOST and IRIS_PORT settings |
| 401 Unauthorized | Invalid credentials | Check IRIS_USERNAME and IRIS_PASSWORD |
| ERROR #822: Access Denied (from /api/docdb/v1/...) | %Service_DocDB not enabled (disabled by default on IRIS) — the DocDB tools translate this into an actionable error naming both remedies | Enable the service via the Management Portal (System Administration > Security > Services > %Service_DocDB), or iris_service_manage action="enable" (itself governance-default-disabled; needs an IRIS_GOVERNANCE override) |
| Database not found | DocDB database does not exist | Use iris_docdb_manage with action list to check available databases |
| Document not found | Invalid document ID | Verify the document ID with iris_docdb_find |
| Cube not found | DeepSee cube does not exist | Use iris_analytics_cubes with action list to see available cubes |
| MDX syntax error | Invalid MDX query | Check MDX syntax; ensure the cube and dimension names are correct |
| REST application not found | Invalid application path | Use iris_rest_manage with action list to see available applications |
Error Response Format
{
"content": [{ "type": "text", "text": "Error querying documents: <details>" }],
"isError": true
}