Read-only SQL queries and schema inspection for IBM Db2 for i over ODBC, JT400 or Mapepire (SSH).
This MCP server provides read-only access to IBM DB2 for i (AS/400) by running SQL queries and performing schema inspection. It requires Java to operate and is intended for use with the MCP tool ecosystem to retrieve DB2 for i information without writing changes.
🛠️ Key Features
Read-only SQL queries
Schema inspection for IBM DB2 for i (AS/400)
Requires Java
🚀 Use Cases
Inspect DB2 for i schema details
Query DB2 for i data with read-only operations
Support developer workflows that need DB2 for i metadata and query results
⚡ Developer Benefits
Limits interaction to read-only SQL queries
Enables schema discovery for IBM DB2 for i
⚠️ Limitations
Read-only access only (no data modification implied)
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.
Listed in the MCP Registry as io.github.Strom-Capital/mcp-server-db2i.
Architecture
AI clients connect to the MCP Server via stdio (IDEs) or HTTP (agents), which executes read-only queries against DB2 for i using the JT400 JDBC driver.
graph LR
subgraph clients ["AI Clients"]
claude("Claude")
cursor("Cursor IDE")
agents("Custom Agents")
end
subgraph server ["MCP Server"]
stdio["stdio"]
http["HTTP + Auth"]
tools[["MCP Tools"]]
jdbc["JT400 JDBC"]
end
subgraph ibmi ["IBM i"]
db2[("DB2 for i")]
end
claude & cursor -->|MCP Protocol| stdio
agents -->|REST API| http
stdio & http --> tools
tools --> jdbc
jdbc -->|JDBC| db2
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
HTTP Transport - REST API with token authentication for web/agent integration
Current MCP spec - Speaks 2026-07-28 and still serves stateless 2025-era clients
Dual Transport - Run stdio and HTTP simultaneously
Tool selection - Enable or disable individual tools, e.g. a metadata-only mode without execute_query
Business SQL tools - Load read-only ERP queries and table notes from YAML, and check the files with mcp-server-db2i validate-tools before the server starts. See Business SQL tools
Compact responses - Compact JSON by default, or markdown tables to save tokens
Statement checks and DDL - Validate object names, return the SQL that recreates an object, and list what depends on a table
Path to a YAML file of IBM i systems. When set, it replaces the DB2I_* connection variables
QUERY_ALLOWED_SCHEMAS
Comma-separated schemas the server may read. Empty disables the check.
DB2I_DRIVERdefault odbc
Database driver: odbc (default, IBM i Access ODBC driver, no Java), jt400 (optional node-jt400 package, needs a JDK at install and a JRE at runtime) or mapepire (Mapepire over SSH, needs Java on the IBM i only)
DB2I_JDBC_OPTIONS
Extra JT400 JDBC properties, semicolon-separated (jt400 and mapepire drivers)
DB2I_ODBC_OPTIONS
Extra IBM i Access ODBC connection keywords, semicolon-separated (odbc driver)
DB2I_MAPEPIRE_OPTIONS
SSH and Mapepire settings, semicolon-separated, e.g. hostKey=SHA256:...;maxJobs=2 (mapepire driver)