ibmi-mcp-server
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., "@ibmi-mcp-serverConnect to IBM i and show me the main menu"
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.
π₯οΈ IBM i (AS/400) MCP Server
An MCP (Model Context Protocol) server that enables AI agents to interact with IBM i (AS/400) systems for RPA automation. Provides 37 tools across three transport layers.
β¨ What This Does
Gives any MCP-compatible AI agent (Amazon Quick, Claude Desktop, etc.) the ability to:
π₯οΈ Navigate 5250 green screens β Login, select menu options, fill fields, press F-keys
β‘ Execute CL commands via SSH β WRKACTJOB, DSPLIB, CALL PGM, and more
ποΈ Query DB2/400 via ODBC β SQL queries, program calls, IBM i Services
π Manage jobs, spool files, IFS, data queues, and message queues
Related MCP server: IBM i MCP Server
Architecture
βββββββββββββββββββββββ ββββββββββββββββββββββββββββββββ ββββββββββββββββ
β AI Agent β β IBM i MCP Server β β IBM i β
β (MCP Client) ββββββΆβ (stdio transport) ββββββΆβ (AS/400) β
β β β β β β
β Tools: β β ββββββββββββββββββββββββββ β β ββββββββββ β
β β’ ibmi_connect_* β β β TN5250 Session Manager βββΌββββββΌβββΆβ 5250 β β
β β’ ibmi_send_keys β β ββββββββββββββββββββββββββ€ β β ββββββββββ€ β
β β’ ibmi_read_screenβ β β SSH Session Manager βββΌββββββΌβββΆβ SSHD β β
β β’ ibmi_run_cl β β ββββββββββββββββββββββββββ€ β β ββββββββββ€ β
β β’ ibmi_query β β β ODBC Connection Pool βββΌββββββΌβββΆβ DB2 β β
β β’ ...37 tools β β ββββββββββββββββββββββββββ β β ββββββββββ β
βββββββββββββββββββββββ ββββββββββββββββββββββββββββββββ ββββββββββββββββπ Quick Start
1. Clone the repo
git clone https://github.com/YOUR_USERNAME/ibmi-mcp-server.git
cd ibmi-mcp-server2. Install dependencies
Windows:
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txtLinux / macOS:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtOr just run the setup script:
# Windows
setup.bat
# Linux/macOS
chmod +x setup.sh && ./setup.sh3. Configure
Copy the example environment file and fill in your IBM i connection details:
cp .env.example .envEdit .env:
IBMI_HOST=your-ibmi-host.example.com
IBMI_PORT=23
IBMI_SSH_PORT=22
IBMI_USER=YOUR_USER
IBMI_PASSWORD=YOUR_PASSWORD4. Register with your MCP client
Amazon Quick
Go to Settings β Capabilities β Connections β Add MCP Server and paste:
{
"name": "IBM i (AS/400)",
"command": "/path/to/ibmi-mcp-server/.venv/bin/python3",
"args": ["/path/to/ibmi-mcp-server/server.py"],
"env": {
"IBMI_HOST": "your-host.example.com",
"IBMI_USER": "YOUR_USER",
"IBMI_PASSWORD": "YOUR_PASSWORD"
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"ibmi": {
"command": "/path/to/ibmi-mcp-server/.venv/bin/python3",
"args": ["/path/to/ibmi-mcp-server/server.py"],
"env": {
"IBMI_HOST": "your-host.example.com",
"IBMI_USER": "YOUR_USER",
"IBMI_PASSWORD": "YOUR_PASSWORD"
}
}
}
}5. Test
Once registered, ask your AI agent:
"Connect to IBM i and show me the main menu"
π Tools Reference
5250 Terminal (Interactive Green-Screen)
Tool | Description |
| Connect via TN5250 (auto-detects plain telnet vs binary protocol) |
| Login with user/password on the sign-on screen |
| Send text + function key (ENTER, F1-F24, PAGEUP, etc.) |
| Read current screen (raw/structured/fields) |
| Move cursor to row/col position |
| Close the terminal session |
SSH/Command (CL & Shell)
Tool | Description |
| Connect via SSH |
| Execute a CL command (e.g., WRKACTJOB, DSPLIB) |
| Execute PASE/QShell command |
ODBC/SQL (Database & Programs)
Tool | Description |
| Connect to DB2/400 via ODBC |
| Execute SQL (SELECT, INSERT, CALL, etc.) |
| Call RPG/COBOL program via QCMDEXC |
Spool File Management
Tool | Description |
| List spool files for a user |
| Read content of a spool file |
| Delete a spool file |
Job Monitoring & Control
Tool | Description |
| List active jobs (filter by subsystem, user, type) |
| Get detailed job info |
| Retrieve job log messages |
| Hold (pause) a job |
| Release a held job |
| End a job (*CNTRLD or *IMMED) |
Data Queue Operations
Tool | Description |
| Send message to a data queue |
| Receive/peek message from a data queue |
| Clear all messages |
IFS File Operations
Tool | Description |
| List files/directories in the IFS |
| Read a text file |
| Write text to a file |
| Delete a file |
| Download file via SFTP |
Message Queue Operations
Tool | Description |
| List messages on a queue (QSYSOPR, etc.) |
| Send message to a queue or user |
| Reply to an inquiry message |
Object Management
Tool | Description |
| List objects in a library |
| Check if object exists |
| Get object metadata |
| List libraries |
Utility
Tool | Description |
| Check all connection statuses |
π Security
Command Blocklist
By default, these dangerous CL commands are blocked:
PWRDWNSYSβ Power Down SystemDLTLIBβ Delete LibraryRSTLIBβ Restore LibraryINZSYSβ Initialize SystemENDSYSβ End SystemENDSBS *ALLβ End All Subsystems
Configure via IBMI_COMMAND_BLOCKLIST environment variable.
Best Practices
Use a dedicated user profile with minimal authority for automation
Set command blocklists to prevent destructive operations
Enable audit journaling (QAUDJRN) on the IBM i for traceability
Use SSL/TLS when possible (port 992 for 5250, key-based auth for SSH)
Never store credentials in code β use environment variables or a secrets manager
Never commit
.envβ it's in.gitignoreby default
π§ͺ Testing with Mock Server
A mock AS/400 telnet server is included for testing without a real IBM i system:
python mock_as400_server.py --port 2323Connect to it with:
IBMI_HOST=localhost
IBMI_PORT=2323
IBMI_USER=QSECOFR
IBMI_PASSWORD=QSECOFRAvailable mock users:
User | Password | Authority |
QSECOFR | QSECOFR |
|
DEVUSER | DEV123 |
|
TESTUSER | TEST123 |
|
π Project Structure
ibmi-mcp-server/
βββ server.py β Main MCP server (auto-detects plain telnet vs TN5250)
βββ tools_extended.py β Extended tool definitions (spool, jobs, IFS, etc.)
βββ handlers_extended.py β Extended tool implementations
βββ mock_as400_server.py β Mock server for testing (optional)
βββ requirements.txt β Python dependencies
βββ .env.example β Configuration template (safe to commit)
βββ .gitignore β Excludes .env, .venv, __pycache__
βββ setup.bat β Windows setup script
βββ setup.sh β Linux/macOS setup script
βββ LICENSE β MIT Licenseπ€ Contributing
Contributions welcome! Areas that need work:
Full TN5250E protocol implementation (currently supports plain telnet + basic TN5250)
Connection pooling for multi-session support
Screen signature registry for automatic screen identification
JT400 (Java Toolkit) integration via JPype bridge
Integration tests with a real IBM i partition
Docker container for easy deployment
π How It Works
The server auto-detects the connection type:
Plain Telnet β If the IBM i (or mock) sends UTF-8 text on connect, the server switches to line-based I/O mode (sends
\r\nfor ENTER, reads text responses)Binary TN5250 β If the server starts with IAC bytes (0xFF), full TN5250 negotiation and EBCDIC encoding is used
This makes it compatible with both real IBM i systems and simple telnet-based mock servers.
π License
MIT License β see LICENSE for details.
π Acknowledgments
Built with research from:
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.
Latest Blog Posts
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/nemu90/ibmi-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server