Get the FREE Ultimate OpenClaw Setup Guide →

mcp -db2i

MCP server for IBM DB2 for i (DB2i) database queries and metadata inspection

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio strom-capital-mcp-server-db2i npx mcp-server-db2i \
  --env DB2I_SCHEMA="${env:DB2I_SCHEMA}" \
  --env DB2I_HOSTNAME="${env:DB2I_HOSTNAME}" \
  --env DB2I_PASSWORD="${env:DB2I_PASSWORD}" \
  --env DB2I_USERNAME="${env:DB2I_USERNAME}"

How to use

This MCP server provides read-only access to IBM DB2 for i data via the Model Context Protocol. It supports two transports: stdio for AI clients running locally (e.g., Claude or Cursor IDE) and HTTP via a REST API for web or agent integrations. The available tools include querying data, inspecting schemas, listing tables and views, and retrieving metadata such as column details and constraints. Credentials are kept secure by using environment variables, and all queries are restricted to read-only operations to safeguard the underlying DB2i instance. To connect, configure a client with the db2i MCP server entry and point it to the npx-based invocation, ensuring your IBM i credentials are supplied through environment variables.

Examples of typical interactions include listing schemas, describing a table, listing indexes, and running a safe SELECT query against public views. The tools provided enable practical AI-assisted database exploration and answer generation without exposing write capabilities.

How to install

Prerequisites:

  • Node.js 20.6 or higher
  • npm (comes with Node.js)
  • Access to an IBM i (DB2 for i) database

Installation steps:

  1. Install the MCP server globally via npm:
npm install -g mcp-server-db2i
  1. Prepare environment variables for DB2i access (example in a .env file):
DB2I_HOSTNAME=your-ibm-i-host.com
DB2I_USERNAME=your-username
DB2I_PASSWORD=your-password
DB2I_SCHEMA=your-default-schema  # optional
  1. Run the MCP server using npx (as the default configuration expects):
# This will invoke the MCP server via npx as configured in mcp_config
# You can also run directly if you prefer:
npx mcp-server-db2i
  1. Optional: Build and run via Docker (Dockerfile provided in the project):
docker build -t mcp-server-db2i .
docker run -e DB2I_HOSTNAME=... -e DB2I_USERNAME=... -e DB2I_PASSWORD=... -e DB2I_SCHEMA=... -p 8080:8080 mcp-server-db2i
  1. Verify installation by requesting the server status or listing available tools via your MCP client or HTTP API.

Additional notes

Tips:

  • Credentials must be supplied through environment variables; avoid hard-coding them in config files.
  • The server enforces read-only queries for safety; attempting non-SELECT statements will be rejected.
  • If using the HTTP transport, ensure token authentication is configured as described in the documentation.
  • For Docker users, you can leverage the provided dockerfile and builder commands to containerize the server.
  • The DB2I_SCHEMA variable is optional; if omitted, the server may default to a standard schema in your environment.
  • Compatible clients include Cursor, Claude Desktop, Claude Code, and other MCP-enabled agents capable of stdio or REST communication.

Related MCP Servers

Sponsor this space

Reach thousands of developers