- Home
- MCP servers
- DB2i
DB2i
- typescript
4
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"strom-capital-mcp-server-db2i": {
"command": "npx",
"args": [
"mcp-server-db2i"
],
"env": {
"DB2I_PORT": "446",
"DB2I_SCHEMA": "MYLIB",
"DB2I_DATABASE": "MYDB",
"DB2I_HOSTNAME": "your-host",
"DB2I_PASSWORD": "your-password",
"DB2I_USERNAME": "your-username"
}
}
}
}This MCP server lets you query IBM DB2 for i data safely and read-only, through a simple API that your AI assistants can use. It connects via JDBC to IBM i databases, enforces read-only access, and provides convenient tools to inspect schemas, tables, views, and constraints. You can run it locally with Docker or invoke it via npx for quick experimentation.
How to use
Connect to the server from your MCP client and start issuing data exploration and read-only query requests. You can inspect schemas, list tables, describe columns, inspect views, and fetch constrained information like primary keys and indexes. The server is designed to be read-only by default, so you can safely query production data without risk.
Key capabilities you can leverage:
- List schemas/libraries with optional pattern filtering
- List and filter tables within a schema
- Describe table columns and view associated indexes and constraints
- List and inspect database views
- Execute read-only SELECT queries with automatic result limiting
- Retrieve primary keys, foreign keys, and unique constraints from the catalog To use these capabilities, connect with an MCP client using one of the provided run methods and supply the necessary IBM i connection details in environment variables.
How to install
Prerequisites you need before installing:
- Node.js 18 or higher
- Java Runtime Environment (JRE) 11 or higher for JDBC
- Access to an IBM i system
You have three common installation paths: npm install, building from source, or running via Docker.
# Option 1: npm (recommended)
# Install globally
npm install -g mcp-server-db2i
If you prefer building from source, clone the repository, install dependencies, and build the project.
# Option 2: From source
git clone https://github.com/Strom-Capital/mcp-server-db2i.git
cd mcp-server-db2i
npm install
npm run build
Option 3 uses Docker to run the server in a container. Build the image first if needed, then run.
# Option 3: Docker
docker build -t mcp-server-db2i .
# Run the container (example)
docker run -i --rm \
-e DB2I_HOSTNAME=your-ibm-i-host \
-e DB2I_USERNAME=your-username \
-e DB2I_PASSWORD=your-password \
mcp-server-db2i:latest
Additional configuration and usage notes
Configure the server using environment variables. Required values are the IBM i hostname, username, and password. Optional settings adjust port, default schema, logging, JDBC options, and rate limiting.
Example environment configuration (variables shown for clarity):
- DB2I_HOSTNAME
- DB2I_USERNAME
- DB2I_PASSWORD Optional: DB2I_PORT, DB2I_DATABASE, DB2I_SCHEMA, DB2I_JDBC_OPTIONS, LOG_LEVEL, NODE_ENV, LOG_PRETTY, LOG_COLORS, RATE_LIMIT_WINDOW_MS, RATE_LIMIT_MAX_REQUESTS, RATE_LIMIT_ENABLED.
Security and usage guidelines
The server enforces read-only access by permitting only SELECT statements. Credentials are provided via environment variables, never embedded in code. Query validation uses AST-based parsing and regex checks to block dangerous operations. Results are capped by a default limit to prevent large payloads. Rate limiting is available to prevent abuse.
Notes on compatibility and environment
Designed to work with IBM i V7R3 and later, with V7R5 recommended. It operates over JDBC, accessible through TCP/IP from any system that can reach the IBM i host.
Examples of common queries
Ask your MCP client to perform actions like listing schemas, listing tables in a schema, describing a table's columns, listing indexes, or retrieving constraints. You can also execute read-only queries such as SELECT * FROM MYLIB.CUSTOMERS WHERE STATUS = 'A' to inspect data.
Available tools
execute_query
Execute read-only SELECT queries against the connected IBM i database, returning result rows with automatic limiting to protect against large results.
list_schemas
List available schemas/libraries, with optional filtering patterns to narrow results.
list_tables
List tables within a specified schema, with optional pattern filtering.
describe_table
Get detailed information about a table’s columns, types, and attributes.
list_views
List views within a schema to explore virtual representations of data.
list_indexes
List SQL indexes for a given table by querying the catalog.
get_table_constraints
Retrieve primary keys, foreign keys, and unique constraints for a table.