mainframe-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MAINFRAME_HOST | No | Override mainframe.host | |
| MAINFRAME_MODE | No | READ | WRITE | TEST | READ |
| MAINFRAME_DEBUG | No | 0 | 1 | 0 |
| MAINFRAME_CONFIG | No | Path to config.yaml | ./config.yaml |
| MAINFRAME_USERID | Yes | RACF userid for this session |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| connectA | Open a TN3270 connection to the configured host. Idempotent. Does NOT log in; call |
| loginA | Log in to TSO as Set the password once via Args: userid: RACF userid. |
| disconnectA | Close the TN3270 session cleanly. |
| statusA | Return a one-line status: host, connected flag, userid, mode. |
| reconnectB | Force a disconnect + reconnect. Re-logs in if a userid was previously set. |
| force_cleanupA | Force-reset the host-side session for the configured userid. Use when a prior dirty disconnect (or external session) is holding the userid as "IN USE" and blocking new logons. Steps:
Returns a single-line status that the AI can echo verbatim. |
| get_screenA | Return the current 3270 screen, row-numbered (24 rows x 80 cols). |
| find_textB | Return all (row, col) coordinates where the literal pattern appears on the current screen. Args: pattern: Exact text to search for. Case-sensitive. |
| get_text_atA | Return text at a specific screen position. Args: row: 1-based row index (1-24). col: 1-based column index (1-80). length: Number of characters to read. |
| analyze_screen_fieldsA | Return a per-row inventory of non-blank content on the current screen. Heuristic only: returns each non-empty stripped line with its row number so the AI can locate input fields by neighboring labels. |
| identify_screenA | Identify the current screen against known signatures. Returns a screen_id like TSO_READY, ISPF_PRIMARY, ISPF_DSLIST, ISPF_EDIT, SDSF_HOME, or UNKNOWN. |
| check_for_errorsA | Scan the current screen for abend codes or error markers. Trips lockout if abend found. |
| send_enterA | Send the ENTER AID key. Returns the resulting screen. |
| send_pfC | Send a PF key (1-24). Returns the resulting screen. Args: number: PF key number (1-24). |
| send_paB | Send a PA key (1-3). Returns the resulting screen. Args: number: PA key number (1-3). |
| send_clearA | Send the CLEAR AID key. Returns the resulting screen. |
| send_keysA | Type text into the current input field at the cursor position. Does NOT submit. Use send_enter / send_pf afterwards to submit. Do NOT use for passwords; the login tool fetches them from the OS keychain. Args: text: Characters to type. |
| wait_for_textB | Block until Args: pattern: Literal text to wait for (case-insensitive). timeout: Seconds to wait. Default 10. |
| wait_for_screen_changeB | Block until the screen changes from its last observed state, or timeout elapses. Args: timeout: Seconds to wait. Default 10. |
| list_datasetsA | List MVS datasets whose name matches Uses ISPF 3.4 or z/OS FTP depending on Args:
pattern: Fully-qualified dataset name with wildcards ( |
| list_membersB | List members of a PDS (e.g. Args:
pds: PDS dataset name without trailing |
| read_memberA | Read a PDS member as text. Args:
pds_member: |
| get_dataset_infoA | Return DCB attributes (RECFM, LRECL, BLKSIZE, DSORG, volume) for a dataset. Args: dataset: Fully-qualified dataset name. |
| check_jobA | Return the current JES state of a job. States: Args:
job_id: JES job id (e.g. |
| fetch_sysoutA | Fetch a job's SYSOUT and surface RC + abend if present. Detects abends inside the returned spool body and trips the abend
lockout the same way a screen-side Args:
job_id: JES job id, or |
| list_my_jobsA | List jobs owned by the current userid (TSO |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 26 tools
Each tool targets a distinct action or resource: session management, screen inspection, screen input, dataset retrieval, and job monitoring all have specific tools with clear boundaries. Even similar helpers like find_text and wait_for_text are differentiated by intent (scan vs wait), preventing confusion.
The majority of tool names follow a consistent snake_case verb-first pattern (list_datasets, get_screen, check_job). Minor deviations like 'status' (a noun rather than get_status) and 'reconnect' (no underscore) are acceptable and do not obscure meaning.
26 tools is slightly above the typical comfortable range, but the complexity of mainframe interaction justifies a large set covering session control, screen access, and specific operations. Still, some tools like send_clear and send_enter could potentially be consolidated, making it feel a bit heavy.
The tool set covers read-oriented workflows well (listing members, reading datasets, checking jobs, fetching SYSOUT), but lacks write operations such as dataset creation/update, job submission, or file upload. This leaves notable gaps for any workflow requiring modifications rather than just inspection.