Ask your IBM i
in plain language.

Give Claude, Cursor and other AI assistants read-only access to Db2 for i. It connects through the host servers your IBM i already runs, or over SSH, so there is nothing new to install on the system.

Get started
npx mcp-server-db2i
At a glance
Transport
stdio · HTTP
Auth
OAuth 2.1
Database
Db2 for i
Drivers
ODBC · JT400 · Mapepire
On the IBM i
No server install
Access
READ ONLY

Example

One question, from plain language to rows.

01 / QuestionClaude

Which customers have the most open orders right now?

02 / Tool callsmcp-server-db2i
describe_tableMYLIB.ORDERHDR

Table note: STATUS = 'O' means open.

execute_queryread-only
SELECT C.NAME, COUNT(*) AS OPEN_ORDERS
FROM MYLIB.ORDERHDR H
JOIN MYLIB.CUSTOMERS C ON C.CUSTNO = H.CUSTNO
WHERE H.STATUS = 'O'
GROUP BY C.NAME
ORDER BY OPEN_ORDERS DESC
FETCH FIRST 3 ROWS ONLY
03 / Result3 rows

Three customers account for most of the open orders.

CustomerOpen orders
Acme Tools14
Birch Supply9
Harbor Parts7

What you get

Built for production IBM i systems.

The read-only checks are always on. The allowlist, masking and audit log are one setting each. Every control is documented, so your IBM i team can see exactly what is enforced and where.

How it fits together

From a question to Db2 for i and back.

The server sits between your AI assistant and the IBM i. Every request passes the same checks, whichever client or driver you use.

  1. Client

    AI assistant

    Claude, Cursor, Claude Code, or any client that speaks the Model Context Protocol.

  2. Server

    mcp-server-db2i

    stdio on your machine, or HTTP with OAuth for a team.

  3. Policy

    Checks on every call

    • Read-only SQL validation ON
    • Library allowlist ON
    • Column masking OPT
    • Rate limits and audit log OPT
  4. Driver

    ODBC, JT400 or Mapepire

    Host server ports, or SSH only.

  5. System

    Db2 for i

    Runs with the user's own authority. Exit programs still apply.

Install

Pick how you run it.

The default ODBC driver needs unixODBC and the IBM i Access ODBC Driver on the machine that runs the server. Nothing is installed on the IBM i.

Add the server to your MCP client config. Claude Desktop, Cursor and Claude Code all use this shape.

{
  "mcpServers": {
    "db2i": {
      "command": "npx",
      "args": ["-y", "mcp-server-db2i@latest"],
      "env": {
        "DB2I_HOSTNAME": "ibmi.example.com",
        "DB2I_USERNAME": "${env:DB2I_USERNAME}",
        "DB2I_PASSWORD": "${env:DB2I_PASSWORD}",
        "QUERY_ALLOWED_SCHEMAS": "MYLIB"
      }
    }
  }
}

Other options

Which MCP server fits you.

IBM maintains its own open-source MCP server for IBM i. Both are free, and they start from different places. Here is how to choose.

This server

A good fit when:

  • You would rather not install or run a server on the IBM i. It uses the database host servers your system already runs, or an SSH login that starts Mapepire as your own user, with no daemon.
  • You want reads only, enforced by the server: a read-only connection, a SQL validator and a library allowlist.
  • Several people share one server and sign in with their own IBM i profiles.
Get started

IBM's MCP server for IBM i

A good fit when:

  • The Mapepire server already runs on your IBM i, or you are happy to install it.
  • You want its ready-made SQL tool sets for performance, jobs, security and storage.
  • You are building agents with Agno, LangChain or Google ADK, or want its ibmi command-line tool next to the server.
IBM/ibmi-mcp-server on GitHub

Open source

Free, open source, and yours to run.

MIT licensed. It runs on your own machines and talks only to your IBM i. Questions, ideas and bug reports are welcome on GitHub.