🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@notharshhaa/mainframe-mcp-server

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@notharshhaa/mainframe-mcp-server

An enterprise-grade Model Context Protocol (MCP) server for IBM z/OS environments, built on the IBM Zowe SDK.

latest
Source
npmnpm
Version
2.5.0
Version published
Weekly downloads
88
8.64%
Maintainers
1
Weekly downloads
 
Created
Source

mainframe-mcp-server

MCP Server for IBM z/OS using Zowe APIs

An enterprise-grade Model Context Protocol (MCP) server for IBM z/OS environments.
Bridges MCP-compatible AI agents with mainframe resources — jobs, datasets, USS, and operational diagnostics — using IBM Zowe SDK as the connectivity layer.

mainframe-mcp-server — Bridge AI agents with IBM z/OS via MCP and Zowe SDK

What it does

mainframe-mcp-server exposes z/OS capabilities as Model Context Protocol tools. An AI agent can list jobs, read datasets, inspect USS paths, submit JCL, and run operational diagnostics — without you writing Zowe CLI commands by hand.

Connectivity is handled by the IBM Zowe SDK over z/OSMF REST. This project adds the MCP tool layer, input validation, safety limits, and AI-friendly response formatting on top.

How it's different

mainframe-mcp-serverZowe CLICloud MCP tools (K8s, AWS, GitHub…)
InterfaceMCP tools for AI agentsTerminal commandsMCP tools for cloud-native stacks
z/OS coverageJobs, datasets, USS, diagnosticsFull Zowe command setNone
WorkflowNatural-language ops ("why did PAYJOB01 fail?")Manual CLI scriptingN/A for mainframe
OutputStructured text tuned for LLM reasoningRaw terminal outputN/A

This is not a replacement for Zowe CLI or IBM Z Open Editor — it is an MCP bridge so AI assistants can drive those same z/OSMF APIs.

Tools

Jobs

ToolDescription
list_jobsList jobs by owner, prefix, or status
get_job_statusStatus and return code for a job
get_job_outputSpool inventory or DD content
submit_jclSubmit inline JCL
analyze_job_failureAbend code, failing step, and suggested fix
get_job_jclRetrieve submitted JCL from job spool

Datasets

ToolDescription
list_datasetsList datasets matching an HLQ pattern
read_datasetRead a sequential dataset or PDS member
search_datasetSearch datasets by pattern
search_membersSearch or list PDS members
get_dataset_infoCatalog attributes without reading content

USS

ToolDescription
list_uss_directoryList a USS directory
read_uss_fileRead a USS file
search_uss_filesSearch files under a USS path

Operations

ToolDescription
find_failed_jobsFailed jobs in a time window
summarize_abendsAbend code breakdown across recent jobs
system_health_summaryActive, queued, and failed job snapshot
investigate_incidentFull incident bundle for a job
lookup_abend_codeAbend reference lookup (S0C7, S806, S222, S0C4, …)
verify_zosmf_connectionTest z/OSMF connectivity and auth
compare_jobsSide-by-side comparison of two jobs
get_user_jobs_summaryJob counts by status for an owner

CICS

ToolDescription
list_cics_regionsList CICS regions via CMCI REST
get_cics_region_statusStatus and attributes of a CICS region
list_cics_transactionsTransaction definitions in a region

Db2

ToolDescription
list_db2_subsystemsList Db2 locations via Db2 REST
search_db2_catalogSearch catalog tables and views

SMF / Security

ToolDescription
get_smf_metricsSMF/RMF performance metrics snapshot
query_racf_auditQuery RACF audit records from a log source
security_posture_summaryReport active security controls and recommendations

Intelligence

ToolDescription
analyze_root_causeDeep root-cause analysis with correlation and action items
predict_batch_failuresPredictive risk scoring for recurring batch failures

See docs/tools-reference.md for full input/output details.

Enterprise security

Yes — this server is designed for enterprise use, with controls big companies typically require. Security is enforced at the MCP server layer (in addition to RACF/z/OSMF permissions on the mainframe itself).

ControlEnv variablePurpose
Read-only modeSECURITY_READ_ONLY=trueBlocks submit_jcl and other write tools
Tool allowlistSECURITY_ALLOWED_TOOLSOnly permit specific tools (least privilege)
Tool blocklistSECURITY_BLOCKED_TOOLSExplicitly deny dangerous tools
Dataset boundariesSECURITY_ALLOWED_DATASET_PATTERNSRestrict dataset access by HLQ pattern
USS boundariesSECURITY_ALLOWED_USS_PATHSRestrict USS paths by prefix
Audit loggingSECURITY_AUDIT_LOGGING=trueLog every tool call (credentials redacted)
JCL size limitSECURITY_MAX_JCL_BYTESCap inline JCL submit size
TLS verificationZOSMF_REJECT_UNAUTHORIZED=trueEnforce certificate validation

Use security_posture_summary to inspect which controls are active and get hardening recommendations.

Important: Enterprise deployment also requires:

  • A dedicated service account on z/OS with least-privilege RACF profiles
  • Secrets in a vault (not plain env vars in production)
  • Network restrictions (z/OSMF behind API gateway / VPN)
  • SSE transport placed behind auth proxy if exposed beyond localhost

The mainframe still enforces the final authorization — this server adds guardrails so AI agents cannot exceed configured boundaries.

Phase 3 capabilities (require optional enterprise configuration):

  • CICS region tools — CMCI REST integration (CMCI_CONTEXT, CMCI_HOST, CMCI_PORT)
  • Db2 catalog tools — Db2 REST SQL queries (DB2_LOCATION, DB2_HOST, DB2_PORT)
  • SMF metrics exposure — z/OSMF RMF and/or SMF_SUMMARY_DATASET
  • RACF audit integration — parse audit logs from RACF_AUDIT_USS_PATH or RACF_AUDIT_DATASET
  • AI-assisted root cause analysisanalyze_root_cause with confidence scoring and correlated incidents
  • Predictive batch failure detectionpredict_batch_failures with risk levels and trends

Operational intelligence

Phase 2 capabilities built into the server:

  • USS tools — list, read, and search USS paths
  • investigate_incident — status, root-cause analysis, spool inventory, and diagnostic excerpt in one call
  • system_health_summary — HEALTHY / DEGRADED / CRITICAL snapshot with top abend codes
  • Abend code lookup — curated reference for common system and user abends via lookup_abend_code
  • Structured responses — numbered sections and tables designed for AI agent parsing
  • Integration tests — optional sandbox suite (RUN_INTEGRATION=1 npm run test:integration)

Quick start

Requirements: Node.js 18+, a reachable z/OSMF endpoint, and valid z/OS credentials.

Install via npm

npx -y @notharshhaa/mainframe-mcp-server

When you add this server in your IDE (Cursor, VS Code, Claude Desktop, etc.), the installer prompts for connection settings (driven by server.json). Those values are stored in your MCP config file — not in a .env file.

Example MCP config (see also config/mcp-client.example.json):

{
  "mcpServers": {
    "mainframe": {
      "command": "npx",
      "args": ["-y", "@notharshhaa/mainframe-mcp-server"],
      "env": {
        "ZOSMF_HOST": "your-zosmf-host.internal",
        "ZOSMF_PORT": "443",
        "ZOSMF_USER": "your-username",
        "ZOSMF_PASSWORD": "your-password"
      }
    }
  }
}

Run from source

git clone https://github.com/NotHarshhaa/mainframe-mcp-server.git
cd mainframe-mcp-server
npm install
npm run build

Point your IDE at dist/index.js and set env in MCP config (copy from config/mcp-client.example.json), or export variables in your shell before npm start.

Environment variables

VariableRequiredDescription
ZOSMF_HOSTyesz/OSMF hostname
ZOSMF_USER / ZOSMF_PASSWORDyes*Basic auth credentials
ZOSMF_TOKENyes*Token auth (alternative to user/password)
ZOSMF_PORTnoHTTPS port (default 443)
ZOSMF_REJECT_UNAUTHORIZEDnoTLS verification (default true)

* Provide either user/password or a token.

Full configuration reference: docs/configuration.md

Examples

Why did a job fail?

User:  Why did PAYJOB01 fail?
Agent: analyze_job_failure({ jobId: "JOB01234" })
Job:     PAYJOB01 (JOB01234)
Status:  ABEND S806
Step:    STEP030 - LOADPGM
Reason:  Program load failure — module PAYRPTX not found
Fix:     Verify PAYRPTX is compiled and linked into the correct load library.

Failed jobs in the last 24 hours

User:  Show me all failed jobs from the last 24 hours
Agent: find_failed_jobs({ hours: 24 })

Read a dataset member

User:  Show me SYS1.PROCLIB(IKJEFT01)
Agent: read_dataset({ dsn: "SYS1.PROCLIB", member: "IKJEFT01" })

What does abend S0C7 mean?

User:  What is abend S0C7?
Agent: lookup_abend_code({ code: "S0C7" })

Predict which batch jobs might fail next

User:  Which batch jobs are at risk of failing?
Agent: predict_batch_failures({ hours: 168 })

Documentation

License

MIT — see LICENSE

Keywords

mcp

FAQs

Package last updated on 08 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts