IRIS Operations & Monitoring MCP Server

v1.3.0
io.github.jbrandtmse/iris-ops-mcp Checked 7 hours ago Published 4 days ago

IRIS Operations & Monitoring MCP Server

All servers use the same environment variables: 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.

Summary extracted from the README.

@iris-mcp/ops

IRIS Operations & Monitoring MCP Server -- Composite health check, system metrics, jobs, locks, process control, journals, mirrors, audit events, database integrity, database maintenance operations, backups, licensing, ECP, task scheduling, system configuration, and alert management via the Model Context Protocol.

Part of the IRIS MCP Server Suite.


Installation

npm install -g @iris-mcp/ops

Or run directly without installing:

npx -y @iris-mcp/ops@1

Configuration

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)

Set IRIS_TOOLS_PRESET=core to trim this server's tools/list to a 10-tool runtime roster (9 package tools + iris_server_profiles) — monitoring-persona basics: health check, system metrics, alert metrics, jobs/locks/processes, tasks, license. IRIS_TOOLS_PRESET=developer trims to a DIFFERENT 10-tool runtime roster (9 + iris_server_profiles) — the runtime debugging slice (interop metrics + task history for scheduled jobs); no backup/mirror/ECP/config surface. Same COUNT, different MEMBERSHIP — core swaps iris_metrics_alerts/iris_license_info for developer's iris_metrics_interop/iris_task_history. Omit (or set "full") for today's behavior — every tool visible, byte-for-byte. IRIS_TOOLS_DISABLE/IRIS_TOOLS_ENABLE hide/force-show individual tools independent of the preset. This is orthogonal to IRIS_GOVERNANCE above (visibility = does the agent know a tool exists; governance = is an already-visible call allowed). Full model, exact per-tool roster, and the payload-size measurements: Tool Visibility Presets.

Prompt-pack limitation. The run-external-backup prompt calls iris_journal_info and iris_backup_manage — both are hidden under BOTH core and developer, so this prompt only works under full (or with IRIS_TOOLS_ENABLE=iris_journal_info,iris_backup_manage). The check-system-health prompt's interpretation guidance also names iris_journal_info/iris_database_check/iris_mirror_status (hidden under both presets) and, under developer only, iris_license_info/iris_metrics_alerts — the composite iris_health_check call itself always works, but the FOLLOW-UP drill-down tool for some findings may be hidden depending on preset.


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. This MCP-call audit trail is distinct from this server's iris_audit_events tool, which reads IRIS's own %SYS.Audit* security-audit database — full record shape, redaction rules, and that disambiguation: Compliance & Auditability.

What the safety settings protect: the safety settings (governance, the presets, the confirmation dialogs, the audit log, the data policy, the SQL safety settings and the document write guards) guard the agent that uses this server, not the IRIS account, whose privileges are the boundary. See What the safety settings protect.

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-ops-mcp": {
      "command": "npx",
      "args": ["-y", "@iris-mcp/ops@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-ops-mcp": {
      "command": "npx",
      "args": ["-y", "@iris-mcp/ops@1"],
      "env": {
        "IRIS_HOST": "localhost",
        "IRIS_PORT": "52773",
        "IRIS_USERNAME": "_SYSTEM",
        "IRIS_PASSWORD": "SYS",
        "IRIS_NAMESPACE": "USER"
      }
    }
  }
}

Cursor

{
  "iris-ops-mcp": {
    "command": "npx",
    "args": ["-y", "@iris-mcp/ops@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.


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.

Health Check Tool

Tool Description Key Parameters Annotations
iris_health_check Recommended first call of any diagnostic session. Composite health check across up to 9 instance areas in one round-trip; returns a structured verdict (healthy/warning/critical) with a per-area finding explaining why. areas?, thresholds? readOnly, idempotent

iris_health_check is a read tool, enabled by default under IRIS_GOVERNANCE. See Tool Examples below for the full contract (areas, thresholds, verdict computation).

Metrics & Monitoring Tools

Tool Description Key Parameters Annotations
iris_metrics_system System metrics in Prometheus format (none) readOnly, idempotent
iris_metrics_alerts Active system alerts with severity (none) readOnly, idempotent
iris_metrics_interop Interoperability volume and interface metrics namespace? readOnly, idempotent
iris_alerts_manage Manage system alert state (reset counter) action destructive, idempotent

Process & Lock Tools

Tool Description Key Parameters Annotations
iris_jobs_list List all running IRIS jobs/processes (none) readOnly, idempotent
iris_locks_list List all current system locks (none) readOnly, idempotent
iris_process_manage Inspect one process by PID, or terminate/suspend/resume it (control actions opt-in via governance, default-disabled; self/critical jobs refused) action, pid, namespace? destructive

Infrastructure Tools

Tool Description Key Parameters Annotations
iris_journal_info Journal file status and directory info (none) readOnly, idempotent
iris_mirror_status Mirror configuration and membership status (none) readOnly, idempotent
iris_audit_events Audit log events with filters beginDate?, endDate?, username?, eventType?, maxRows? readOnly, idempotent
iris_database_check Database status (mounted, encrypted, size) name? readOnly, idempotent
iris_database_action Runtime database maintenance: mount/dismount/compact/defragment/truncate/expandVolume by directory (all mutating, opt-in via governance, default-disabled) action, directory, readonly?, percentFull?, targetSize?, newVolDir?, initialSize?, namespace? destructive
iris_backup_manage Run a user-defined backup task, freeze/thaw the instance, or list backup history (write actions opt-in via governance, default-disabled; restore not supported) action, taskName?, backupType?, jobbackup?, device?, logFile?, description?, username?, password?, namespace? destructive
iris_license_info License type, capacity, usage, expiration (none) readOnly, idempotent
iris_ecp_status ECP connection status (none) readOnly, idempotent

Task Scheduling Tools

Tool Description Key Parameters Annotations
iris_task_manage Create, modify, or delete a scheduled task action, id?, name?, taskClass?, namespace?, suspended? destructive
iris_task_list List all scheduled tasks with details (none) readOnly, idempotent
iris_task_run Trigger immediate task execution id destructive
iris_task_history View task execution history taskId?, maxRows? readOnly, idempotent

System Configuration Tools

Tool Description Key Parameters Annotations
iris_config_manage Get, set, or export system configuration action, section?, properties? destructive (set)

Prompts

Workflow-shaped MCP prompts (Epic 25) served via prompts/list/prompts/get. Prompts are a separate protocol capability from tools — they carry no governance key and do not change this server's tool count.

Prompt Description
check-system-health Runs iris_health_check, interprets every non-ok finding, and names the fixing tool for each one.
run-external-backup Freezes the instance for an external (OS/SAN-level) snapshot and thaws it safely afterward — thaw always runs, even if the snapshot step failed.

Also installable as Agent Skills.


Tool Examples

Runs a composite health check across up to 9 IRIS instance areas in ONE round-trip and returns a structured verdict (healthy / warning / critical) with a per-area finding explaining why. Replaces 6+ separate calls (iris_metrics_system, iris_journal_info, iris_mirror_status, iris_locks_list, iris_license_info, iris_database_check, iris_metrics_alerts, iris_metrics_interop) with documented, overridable thresholds.

The ObjectScript endpoint (/monitor/health, Story 23.1) returns raw per-area values only -- every threshold, per-area level rule, and the overall verdict are computed here in TypeScript (architecture.md ADR H5), so tuning a threshold never needs a bootstrap bump.

Areas (9): system, databases, journal, mirror, locks, license, ecp, alerts, interop. memory is NOT a valid area -- it was REMOVED in Story 23.0 (no reliable instance-wide memory-health signal exists in IRIS); it is dropped entirely, not folded into system or any other area, and passing it is rejected by the input schema.

Threshold-checked areas (defaults shown; every threshold can be overridden independently):

Area Direction Warn Crit Notes
journal ascending (% full) 80 92 High is bad.
databases descending (% free) 10 3 Low is bad. Per-DB freePct computed only for maxSize-configured, mounted databases; unlimited-maxSize or unmounted databases report notApplicable (v1 has no volume-level disk-exhaustion signal for those -- see iris_database_check). The worst database drives the area's level; the full per-DB breakdown stays in raw.
license ascending (% used) 80 95 Prefers the IRIS-authoritative dashboard figure (SYS.Stats.Dashboard.LicenseCurrentPct) over a CSP-user-count fallback. notApplicable when no user limit is configured (core/unlimited-user license) and no authoritative figure is available.
locks ascending (% of lock table utilized) 50 85 notApplicable when usable+used is 0.
alerts (state mapping, no numeric threshold) -- -- Numeric $SYSTEM.Monitor state: -1 (Hung) = critical, 1 (Warning) / 2 (Alert) = warning, 0 (OK) = ok.

Informational areas (no ok/warning threshold in v1 -- raw values only; always ok, or notApplicable when not configured): system, mirror, ecp, interop.

A failed probe for one area yields level: "error" for that area only (sanitized message in explanation) -- every other area stays intact, and an error finding counts as warning severity for the overall verdict (it never escalates the verdict to critical by itself). A notApplicable finding (e.g. no mirror membership, no Interoperability classes in this namespace) never affects the verdict.

Input (no args -- check all 9 areas):

{}

Input (subset + threshold override):

{
  "areas": ["journal", "license"],
  "thresholds": { "journalPctCrit": 95 }
}

Output (structuredContent):

{
  "verdict": "warning",
  "checkedAt": "2026-07-08T12:00:00.000Z",
  "findings": [
    {
      "area": "journal",
      "level": "warning",
      "metric": "journalSpacePct",
      "value": 85.2,
      "threshold": 80,
      "explanation": "Journal directory is 85.2% full (warning threshold 80%). Purge or expand journal space."
    },
    {
      "area": "license",
      "level": "ok",
      "metric": "licensePct",
      "value": 12.5,
      "threshold": 80,
      "explanation": "License is 12.5% used (IRIS-authoritative dashboard figure) -- ok threshold 80%."
    }
  ],
  "raw": {
    "journal": { "volumeFreeBytes": 148000000, "volumeTotalBytes": 1000000000, "state": "Open" },
    "license": { "currentCSPUsers": 1, "userLimit": 8, "licenseCurrent": 1, "licenseCurrentPct": 12.5 }
  }
}

iris_health_check is a read tool (mutates: "read"), enabled by default under IRIS_GOVERNANCE.

Input:

{}

Output (Prometheus text format):

# HELP iris_process_count Number of IRIS processes
# TYPE iris_process_count gauge
iris_process_count 42
# HELP iris_global_references_total Total global references since startup (instance-wide, from SYS.Stats.Global)
# TYPE iris_global_references_total counter
iris_global_references_total 1640566217
# HELP iris_routine_commands_total Total routine commands since startup (instance-wide, from SYS.Stats.Routine)
# TYPE iris_routine_commands_total counter
iris_routine_commands_total 5083780047
# HELP iris_db_size_mb Database size in megabytes
# TYPE iris_db_size_mb gauge
iris_db_size_mb{db="USER"} 11
iris_db_size_mb{db="IRISSYS"} 80

iris_global_references_total and iris_routine_commands_total are instance-wide counters sampled from SYS.Stats.Global (sum of RefLocal + RefPrivate + RefRemote) and SYS.Stats.Routine.RtnCommands respectively. These are the same counters that power the Management Portal System Dashboard, and both increase monotonically across all processes on the instance — not per-process snapshots.

Input:

{}

Output:

{
  "state": 0,
  "stateText": "OK",
  "alertCount": 0,
  "alerts": [],
  "lastAlert": ""
}

Input:

{
  "namespace": "USER"
}

Output:

{
  "namespaces": [
    {
      "namespace": "USER",
      "productionName": "MyApp.Production",
      "productionState": "Running",
      "productionStateCode": 1,
      "queueDepth": 5,
      "errorCount24h": 2,
      "messageCount24h": 1500
    }
  ],
  "count": 1
}

errorCount24h counts Event Log entries of type Error and messageCount24h counts message headers, each over the 24 hours before the call, measured in UTC (a read, enabled by default).

Single supported action: reset — calls $SYSTEM.Monitor.Clear() in %SYS to clear the in-memory alert counter and system state. Counterpart to iris_metrics_alerts.

Scope-down note (Epic 12): Only reset is supported. Actions clear (per-alert by index) and acknowledge are NOT available — IRIS has no native API for either. Both are deferred to Epic 13 if demand materialises. reset does NOT truncate alerts.log; historical entries remain on disk for audit.

Input:

{
  "action": "reset"
}

Output:

{
  "action": "reset",
  "clearedAt": "2026-04-22T10:50:00Z"
}

clearedAt is the time of the reset in UTC (ISO 8601, to the second).

Input:

{}

Output:

{
  "jobs": [
    {
      "pid": 1234,
      "namespace": "USER",
      "routine": "MyApp.Service",
      "state": "RUN",
      "userName": "_SYSTEM",
      "commandsExecuted": 50000,
      "globalReferences": 12000,
      "cpuTime": 45.2
    }
  ],
  "count": 1
}

Input:

{}

Output:

{
  "locks": [
    {
      "lockName": "^MyGlobal(\"key1\")",
      "ownerPid": 1234,
      "owner": "1234",
      "mode": "Exclusive",
      "flags": "",
      "counts": "1"
    }
  ],
  "count": 1
}

Input:

{}

Output:

{
  "currentFile": "C:\\InterSystems\\IRIS\\mgr\\journal\\20260407.001",
  "primaryDirectory": "C:\\InterSystems\\IRIS\\mgr\\journal",
  "alternateDirectory": "C:\\InterSystems\\IRIS\\mgr\\journal2",
  "fileCount": 15,
  "currentOffset": 524288,
  "freeSpaceBytes": 53687091200,
  "state": "Enabled"
}

Input:

{}

Output:

{
  "isMember": false,
  "mirrorName": "",
  "memberType": "Not Member",
  "isPrimary": false,
  "isBackup": false,
  "isAsyncMember": false,
  "status": "This instance is not a mirror member"
}

Input:

{
  "username": "_SYSTEM",
  "maxRows": 5
}

Output:

{
  "events": [
    {
      "timestamp": "2026-04-07 10:30:00",
      "username": "_SYSTEM",
      "eventSource": "%System",
      "eventType": "Login",
      "event": "LoginSuccess",
      "description": "User logged in",
      "clientIPAddress": "127.0.0.1",
      "namespace": "%SYS"
    }
  ],
  "count": 1,
  "maxRows": 5
}

Input:

{
  "name": "USER"
}

Output:

{
  "databases": [
    {
      "name": "USER",
      "directory": "C:\\InterSystems\\IRIS\\mgr\\user",
      "mounted": true,
      "readOnly": false,
      "encrypted": false,
      "journalState": 2,
      "sizeMB": 256,
      "maxSizeMB": 0
    }
  ],
  "count": 1
}

Input:

{}

Output:

{
  "customerName": "InterSystems",
  "licenseCapacity": "Community",
  "expirationDate": "2027-01-01",
  "connectionLimit": 0,
  "userLimit": 5,
  "coresLicensed": 4,
  "cpusLicensed": 1,
  "currentCSPUsers": 2
}

Input:

{}

Output:

{
  "configured": false,
  "status": "ECP not configured"
}

Input:

{
  "action": "create",
  "name": "Daily Purge",
  "taskClass": "MyApp.Tasks.PurgeOldData",
  "namespace": "USER"
}

Output:

{
  "action": "create",
  "id": 42,
  "name": "Daily Purge"
}

Input:

{}

Output:

{
  "tasks": [
    {
      "id": 42,
      "name": "Daily Purge",
      "taskClass": "MyApp.Tasks.PurgeOldData",
      "namespace": "USER",
      "suspended": "0",
      "priority": "Normal",
      "runInterval": "Daily"
    }
  ],
  "count": 1
}

Input:

{
  "id": 42
}

Output:

{
  "triggered": true,
  "id": 42,
  "message": "Task triggered for immediate execution"
}

Input:

{
  "taskId": 42,
  "maxRows": 100
}

maxRows defaults to 100 and is capped at 1000 to keep responses bounded on busy systems.

Output:

{
  "history": [
    {
      "taskName": "Daily Purge",
      "lastStart": "2026-04-07 02:00:00",
      "completed": "2026-04-07 02:00:15",
      "status": "Completed",
      "result": "Success",
      "namespace": "USER",
      "username": "_SYSTEM",
      "taskId": "42"
    }
  ],
  "count": 1,
  "total": 1,
  "maxRows": 100,
  "truncated": false
}

total is the row count the query produced before capping; truncated is true when total > count.

Input:

{
  "action": "get",
  "section": "config"
}

Output:

{
  "section": "config",
  "properties": {
    "globals": 400,
    "routines": 256,
    "locksiz": 16777216,
    "MaxServerConn": 1
  }
}

When section is "locale", properties includes a current field with the active IRIS locale code (resolved via %SYS.NLS.Locale.%New().Name) alongside the existing availableLocales enumeration and localeCount:

{
  "section": "locale",
  "properties": {
    "current": "enuw",
    "availableLocales": ["enuw", "araw", "deuw", "fraw", ...],
    "localeCount": 36
  }
}

Namespace Scoping

Most operations tools are system-level and do not require a namespace parameter. They operate across the entire IRIS instance.

Tools where namespace has a real effect:

  • iris_metrics_interop -- optionally filter interop metrics to a single namespace
  • iris_task_manage -- specify the execution namespace for a new task

Tools that accept namespace but IGNORE it (the operation is %SYS-scoped; the param is retained only for backward compatibility and has no effect):

  • iris_process_manage -- process inspection/control runs against the system-wide process table
  • iris_database_action -- SYS.Database keys on the directory path and runs in %SYS
  • iris_backup_manage -- backup/freeze/thaw are instance-wide via Backup.General in %SYS

Tools that do NOT accept namespace (system-wide scope):

  • iris_metrics_system, iris_metrics_alerts, iris_alerts_manage
  • iris_jobs_list, iris_locks_list
  • iris_journal_info, iris_mirror_status, iris_audit_events
  • iris_database_check, iris_license_info, iris_ecp_status
  • iris_task_list, iris_task_run, iris_task_history
  • iris_config_manage

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 or insufficient privileges Check credentials; ops operations may require %Admin_Operate or %Admin_Manage resources
ECP not configured No ECP setup on this instance This is an informational response, not an error
Mirror not configured No mirror setup on this instance This is an informational response, not an error
Task not found Invalid task ID Use iris_task_list to find valid task IDs
Configuration section not found Invalid section name Valid sections: config, startup, locale
Custom REST endpoint not found Bootstrap has not completed The server auto-bootstraps on first connection; save the web app via SMP if 404 persists

Error Response Format

{
  "content": [{ "type": "text", "text": "Error retrieving system metrics: <details>" }],
  "isError": true
}

Back to IRIS MCP Server Suite