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
The advantage nobody wrote down
Most companies use AI and few earn from it. I think the missing piece is a layer between the model and the work, holding what the company knows, and that most companies haven't written it yet.

The data warehouse shrinks to a document
An agent connected straight to the ERP answers the one-off question in minutes. What it still needs from the data warehouse isn't the plumbing. It's the meaning.

In open source, the code is the cheap part
Agents can rebuild a code base from its test suite. They can't copy the people who answer for it.
