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.
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
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 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"ORD*FILE- Starts with "ORD", ends with "FILE"
Installation
Prerequisites
Node.js 18 or higher
Java Runtime Environment (JRE) 11 or higher (for JDBC)
Access to an IBM i system
Option 1: npm (recommended)
Option 2: From source
Option 3: Docker
Configuration
Create a .env file or set environment variables:
Environment Variables
Variable | Required | Default | Description |
| Yes | - | IBM i hostname or IP address |
| Yes | - | IBM i user profile |
| Yes | - | User password |
| No |
| JDBC port (446 is standard for IBM i) |
| No |
| Database name |
| No | - | Default schema/library for tools. If set, you don't need to specify schema in each tool call. |
| No | - | Additional JDBC options (semicolon-separated) |
JDBC Options
Common JDBC options for IBM i (JT400/JTOpen driver):
Option | Values | Description |
|
|
|
|
| Library list for resolving unqualified names |
|
| Date format for date fields |
|
| Time format for time fields |
|
| Level of detail in error messages ( |
|
| Whether to translate binary/CCSID data |
|
| Enable SSL/TLS encryption |
Example: naming=system;date format=iso;errors=full
Usage with Cursor
Add to your Cursor MCP settings (~/.cursor/mcp.json):
Using Docker (recommended)
Using Docker with env file
Using docker-compose
Create a .env file in the project root, then:
The docker-compose.yml automatically reads from .env in the same directory.
Using npx (after npm install)
Local development
Example Queries
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'"
Development
Security
Read-only access: Only SELECT statements are permitted
No credentials in code: All sensitive data via environment variables
Query validation: Dangerous SQL keywords are blocked
Result limiting: Default limit of 1000 rows prevents large result sets
Compatibility
IBM i V7R3 and later (V7R5 recommended)
Works with any IBM i system accessible via JDBC over TCP/IP
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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