# IBM Db2 for i

> IBM Db2 for i is an open-source MCP server for databases. Read-only SQL and schema inspection for IBM Db2 for i, with allowlists and audit log. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted, API
- **Website:** https://db2i-mcp.com
- **Repository:** https://github.com/strom-capital/mcp-server-db2i
- **MCP Registry name:** io.github.Strom-Capital/mcp-server-db2i
- **Categories:** databases
- **Listing updated:** 2026-11-14

## About

IBM i shops get a way to put an assistant in front of Db2 for i without giving it write access. A read-only connection and a SQL validator that accepts only queries guard every call, and a timeout cancels runaway statements on the IBM i itself. A `validate_query` tool parses a statement on the system and checks each table and column against the catalog before anything runs.

You can restrict queries and catalog browsing to chosen libraries, and mask sensitive columns or show only their last four characters. It connects through the IBM i Access ODBC driver by default, JT400 over JDBC, or Mapepire over SSH when only port 22 is open, and one server can reach several systems such as development, test and production, each with its own driver, credentials and allowlist.

It runs over stdio, or over Streamable HTTP at /mcp with OAuth 2.1 so people sign in with their own IBM i profile. Business definitions can be written in YAML, vetted queries become named tools, and every tool call goes to a JSON-line audit log with the SQL hashed by default.

## Features

- **Read-only enforcement:** Read-only connection plus a validator that accepts only queries.
- **Library allowlist and masking:** Limit access to chosen libraries and redact sensitive columns.
- **Three drivers:** ODBC by default, JT400 JDBC, or Mapepire over SSH.
- **Multiple systems:** Dev, test and production profiles with separate credentials.
- **OAuth 2.1 sign-in:** People use their own IBM i profile over HTTP.
- **Audit log:** Each tool call written as one JSON line, SQL hashed by default.
- **Custom business tools:** Turn vetted queries into named tools with bound parameters.

## Good for

- Ask which customers have the most open orders
- Search tables and columns across libraries
- Read DDL and look up procedures and functions
- Give analysts safe read access to production data
- Pipe tool-call audit lines into a log system

## Install

### Claude Code (Terminal)

```sh
claude mcp add mcp-server-db2i --env DB2I_HOSTNAME='<DB2I_HOSTNAME>' --env DB2I_USERNAME='<DB2I_USERNAME>' --env DB2I_PASSWORD='<DB2I_PASSWORD>' -- npx -y mcp-server-db2i
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-server-db2i": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-db2i"
      ],
      "env": {
        "DB2I_HOSTNAME": "<DB2I_HOSTNAME>",
        "DB2I_USERNAME": "<DB2I_USERNAME>",
        "DB2I_PASSWORD": "<DB2I_PASSWORD>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-server-db2i": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-db2i"
      ],
      "env": {
        "DB2I_HOSTNAME": "<DB2I_HOSTNAME>",
        "DB2I_USERNAME": "<DB2I_USERNAME>",
        "DB2I_PASSWORD": "<DB2I_PASSWORD>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mcp-server-db2i": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-db2i"
      ],
      "env": {
        "DB2I_HOSTNAME": "<DB2I_HOSTNAME>",
        "DB2I_USERNAME": "<DB2I_USERNAME>",
        "DB2I_PASSWORD": "<DB2I_PASSWORD>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-server-db2i": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-db2i"
      ],
      "env": {
        "DB2I_HOSTNAME": "<DB2I_HOSTNAME>",
        "DB2I_USERNAME": "<DB2I_USERNAME>",
        "DB2I_PASSWORD": "<DB2I_PASSWORD>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp-server-db2i": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-db2i"
      ],
      "env": {
        "DB2I_HOSTNAME": "<DB2I_HOSTNAME>",
        "DB2I_USERNAME": "<DB2I_USERNAME>",
        "DB2I_PASSWORD": "<DB2I_PASSWORD>"
      }
    }
  }
}
```

## Tools

- `validate_query`: Parses a statement on the IBM i and checks tables and columns against the catalog before running.

## FAQ

### Can it change data?

No. It is read-only by design, with a validator that only accepts queries.

### Does anything need installing on the IBM i?

The site says no server install is needed; it uses the host servers already running or SSH.

### Which drivers are supported?

IBM i Access ODBC (default), JT400 and Mapepire over SSH.

### What licence is it under?

The README badge shows MIT.

### How do users authenticate?

Over HTTP it supports OAuth 2.1 or a bearer token; over stdio it uses the DB2I_* environment variables.

### Is IBM Db2 for i free?

Yes. IBM Db2 for i is open source, so you can use and self-host it for free.

### How do I add IBM Db2 for i to Claude Code?

Run this command in your terminal: claude mcp add mcp-server-db2i --env DB2I_HOSTNAME='<DB2I_HOSTNAME>' --env DB2I_USERNAME='<DB2I_USERNAME>' --env DB2I_PASSWORD='<DB2I_PASSWORD>' -- npx -y mcp-server-db2i

### What are the best alternatives to IBM Db2 for i?

The closest alternatives to IBM Db2 for i are Midplane, PlatypusDB, Lorebase, Sovaria and model2data studio.

## Alternatives

- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [PlatypusDB](https://ai-powered.com/mcp/platypusdb): PlatypusDB is an open-source MCP server for databases.
- [Lorebase](https://ai-powered.com/mcp/lorebase): Lorebase is an open-source MCP server for knowledge and memory.
- [Sovaria](https://ai-powered.com/mcp/sovaria): Sovaria is a freemium MCP server for databases.
- [model2data studio](https://ai-powered.com/mcp/model2data-studio): model2data studio is a freemium MCP server for databases.
- [semlayer](https://ai-powered.com/mcp/semlayer): semlayer is a free MCP server for databases.
- [bricksentry](https://ai-powered.com/mcp/bricksentry): bricksentry is an open-source MCP server for databases.
- [MCP Toolbox for Databases](https://ai-powered.com/mcp/mcp-toolbox-for-databases-2): MCP Toolbox for Databases is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/ibm-db2-for-i
