home / mcp / ibm i mcp server

IBM i MCP Server

MCP server for IBM i systems

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ibm-ibmi-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@ibm/ibmi-mcp-server@latest",
        "--transport",
        "http",
        "--tools",
        "./tools/performance/performance.yaml"
      ],
      "env": {
        "DB2i_HOST": "your-ibmi-host.com",
        "DB2i_PASS": "your-password",
        "DB2i_PORT": "8076",
        "DB2i_USER": "your-username",
        "DB2i_IGNORE_UNAUTHORIZED": "true"
      }
    }
  }
}

You can run the IBM i MCP Server to let AI agents query and manage Db2 for i data through YAML-defined SQL tools. This setup provides secure, streaming access for agents and workflows, enabling real-time system monitoring, reporting, and automation against IBM i databases.

How to use

You use an MCP client to connect to the MCP Server that runs on your IBM i environment. Once connected, you load or reference YAML-based tools that define the SQL queries the AI agents can execute. The server returns results in a way that streams to the agent, enabling real-time monitoring and automation tasks across your Db2 for i data.

How to install

Prerequisites: Mapepire must be running on IBM i and listening on port 8076. You also need Node.js version 18 or newer installed on the machine you use to start the MCP Server.

1. Clone the MCP server repository and navigate into it.

2. Set up your IBM i connection details in an environment file.

3. Start the MCP Server using the npm/npx command shown in the example.

# 1. Clone the MCP server repository
git clone https://github.com/IBM/ibmi-mcp-server.git
cd ibmi-mcp-server

# 2. Configure your IBM i connection
cat > .env << 'EOF'
DB2i_HOST=your-ibmi-host.com
DB2i_USER=your-username
DB2i_PASS=your-password
DB2i_PORT=8076
DB2i_IGNORE_UNAUTHORIZED=true
EOF

# 3. Start the MCP Server
npx -y @ibm/ibmi-mcp-server@latest \
   --transport http \
   --tools ./tools/performance/performance.yaml

Configuration and runtime notes

- The server uses an HTTP transport by default and loads tool configurations from YAML files (for example, ./tools/performance/performance.yaml). - The Mapepire gateway port is 8076; ensure the port is open in firewalls and used consistently in your environment configuration.

- Environment variables control the IBM i connection and security behavior. You can define them in a .env file and reference them when starting the server. Typical variables include DB2i_HOST, DB2i_USER, DB2i_PASS, DB2i_PORT, and DB2i_IGNORE_UNAUTHORIZED.

Security and production tips

- Use TLS/HTTPS in production deployments and enable authentication for clients connecting to the MCP Server. - Limit access to the IBM i system by restricting network access to the MCP Server endpoint and Mapepire gateway. - Regularly update the MCP Server and its tool configurations to reflect new security and performance improvements.

Examples of tools and how they work

The server is designed to run YAML-defined SQL tools that perform queries against Db2 for i. A common example is a tool that returns overall system status, CPU usage, memory pools, and active jobs. Tools are organized into toolsets (for example, performance) so AI agents can load related queries together.

Available tools

system_status

Overall system performance statistics with CPU, memory, and I/O metrics

system_activity

Live activity view of system processes and running jobs