An MCP server for DB2 for i
I open-sourced an MCP server that lets Claude, Cursor, and other AI tools talk directly to DB2 for i.
Update, September 2026: the server is at version 2.12 now, with 20 tools. Read what changed in eight months.
I kept copy-pasting table definitions into Cursor. Every time I needed to write a query or understand a schema, I'd open up the database client, grab the column names, and feed them into the chat. This worked, but it felt wrong. The AI should be able to look this up itself.
So I built an MCP server that lets AI assistants talk directly to DB2 for i.
What it does
The mcp-server-db2i package exposes seven tools:
Execute SQL queries. The assistant can run SELECT statements against your IBM i. Ask "show me orders from the last seven days" and it writes the query, executes it, and returns results.
List schemas. "What schemas exist on this system?" becomes a single tool call.
List tables. Browse tables in a schema.
List views. Browse views in a schema.
Describe table structures. Column names, data types, constraints.
List indexes. Shows indexes for a specific table.
Get table constraints. Primary keys, foreign keys, unique constraints.
All read-only. No UPDATE, DELETE, or INSERT. The server refuses to run anything that modifies data.
Setup
Install globally:
npm install -g mcp-server-db2iOr run it through Docker.
Add to your MCP client config:
{
"mcpServers": {
"db2i": {
"command": "mcp-server-db2i",
"args": [],
"env": {
"DB2I_HOSTNAME": "your-ibmi-host.example.com",
"DB2I_USERNAME": "your-username",
"DB2I_PASSWORD": "your-password"
}
}
}
}Under the hood
The server uses the JT400 JDBC driver. Connection pooling keeps things responsive. Results are automatically limited to prevent large result sets.
Limitations
Read-only. Won't write data, modify schemas, or execute stored procedures that change state.
Won't help with RPG programs, CL scripts, or other IBM i artifacts. The scope is database access, not full system administration.
MIT licensed. Fork it if you need more.
Links
- GitHub: github.com/Strom-Capital/mcp-server-db2i
- npm: mcp-server-db2i
More from the blog
AI sessions are contractors. Always-on agents are hires.
A chat or a coding agent session ends when the task is done, when the answer is given or the PR is merged. Grok Bot and OpenAI's dots stay. That changes what you have to give them.

Eight months of an MCP server for Db2 for i
In January the server looked up table definitions so the AI would stop guessing. At 2.12 it checks its SQL against the IBM i, reads your business definitions, and lets colleagues sign in as themselves.

AI-assisted ERP document generation
ERP documents look simple. Underneath, they're conditional logic puzzles that have resisted modernization for decades.
