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., "@mcp-server-db2ilist the columns for the INV_HEADER table in the ERP_DATA schema"
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.
mcp-server-db2i
A Model Context Protocol (MCP) server for IBM DB2 for i (DB2i). This server enables AI assistants like Claude and Cursor to query and inspect IBM i databases using the JT400 JDBC driver.
Architecture
AI clients connect to the MCP Server via stdio (IDEs) or HTTP (agents), which executes read-only queries against DB2 for i using the JT400 JDBC driver.
Features
Read-only SQL queries - Execute SELECT statements safely with automatic result limiting
Schema inspection - List all schemas/libraries with optional filtering
Table metadata - List tables, describe columns, view indexes and constraints
View inspection - List and explore database views
Secure by design - Only SELECT queries allowed, credentials via environment variables
Docker support - Run as a container for easy deployment
HTTP Transport - REST API with token authentication for web/agent integration
Dual Transport - Run stdio and HTTP simultaneously
Quick Start
Installation
Or with Docker:
Configuration
Create a .env file with your IBM i credentials:
Client Setup
Add to your MCP client config (e.g., ~/.cursor/mcp.json):
This uses environment variable expansion to keep credentials out of config files. Set the variables in your shell profile (~/.zshrc or ~/.bashrc).
See the Client Setup Guide for Cursor, Claude Desktop, Claude Code, and Docker setup options.
Available Tools
Tool | Description |
| Execute read-only SELECT queries |
| List schemas/libraries (with optional filter) |
| List tables in a schema (with optional filter) |
| Get detailed column information |
| List views in a schema (with optional filter) |
| List SQL indexes for a table |
| Get primary keys, foreign keys, unique constraints |
Filter Syntax
The list tools support pattern matching:
CUST- Contains "CUST"CUST*- Starts with "CUST"*LOG- Ends with "LOG"
Example Usage
Once connected, you can ask the AI assistant:
"List all schemas that contain 'PROD'"
"Show me the tables in schema MYLIB"
"Describe the columns in MYLIB/CUSTOMERS"
"What indexes exist on the ORDERS table?"
"Run this query: SELECT * FROM MYLIB.CUSTOMERS WHERE STATUS = 'A'"
Documentation
Guide | Description |
REST API with token authentication | |
All environment variables and JDBC options | |
Credentials, rate limiting, query validation | |
Cursor, Claude, Claude Code setup | |
Container deployment | |
Contributing and local setup |
Compatibility
IBM i V7R3 and later (V7R5 recommended)
Node.js 20.6 or higher
Java Runtime Environment (JRE) 11 or higher
Related Projects
IBM ibmi-mcp-server - IBM's official MCP server for IBM i systems. Offers YAML-based SQL tool definitions and AI agent frameworks. Requires Mapepire.
Contributing
Contributions are welcome! See the Development Guide for setup instructions.
License
MIT License - see LICENSE for details.
Acknowledgments
node-jt400 - JT400 JDBC driver wrapper for Node.js
Model Context Protocol - The protocol specification
@modelcontextprotocol/sdk - Official TypeScript SDK