db2-zos-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
db2-zos-mcp
MCP (Model Context Protocol) server for IBM DB2 for z/OS. Lets any MCP client (Claude Desktop, Claude Code, VS Code / GitHub Copilot, Cursor, …) query a DB2 z/OS subsystem, browse the catalog and — with an explicit two-step confirmation — run write/DDL statements.
Prerequisites
Node.js 18+
Network access to the DB2 z/OS DRDA port (often 446).
A DB2 Connect license for z/OS targets (the
db2consv_*.licfile in the driver'slicensefolder), as required by IBM.
ibm_db downloads the IBM CLI driver automatically on install. To use an existing driver instead, set IBM_DB_HOME to its path before installing.
Related MCP server: database-remote-mcp
Quick start
npx -y db2-zos-mcpThe server talks over stdio, so normally the MCP client starts it for you with the configuration below.
Client configuration
Claude Desktop / Cursor / most clients (mcpServers)
{
"mcpServers": {
"db2-zos": {
"command": "npx",
"args": ["-y", "db2-zos-mcp"],
"env": {
"DB2_URL": "db2://db2.example.com:446/LOCATION",
"DB2_USERNAME": "myuser",
"DB2_PASSWORD": "mypassword",
"DB2_SCHEMA": "MYSCHEMA"
}
}
}
}VS Code / GitHub Copilot (.vscode/mcp.json)
{
"inputs": [
{ "id": "db2-password", "type": "promptString", "description": "DB2 password", "password": true }
],
"servers": {
"db2-zos": {
"command": "npx",
"args": ["-y", "db2-zos-mcp"],
"env": {
"DB2_HOST": "db2.example.com",
"DB2_PORT": "446",
"DB2_DATABASE": "LOCATION",
"DB2_USERNAME": "myuser",
"DB2_PASSWORD": "${input:db2-password}",
"DB2_CURRENT_SCHEMA": "MYSCHEMA"
}
}
}
}Claude Code
claude mcp add db2-zos -e DB2_URL=db2://db2.example.com:446/LOCATION -e DB2_USERNAME=myuser -e DB2_PASSWORD=mypassword -- npx -y db2-zos-mcpAvoid committing passwords: use your client's secret/input mechanism where available.
Environment variables
Variable | Required | Default | Description |
| ✅ (or HOST + DATABASE) | — |
|
| ✅ if no URL | — | Hostname or IP |
| ❌ |
| DRDA port (ignored when |
| ✅ if no URL | — | DB2 location name (ignored when |
| ✅ | — | User ID |
| ✅ | — | Password (special characters such as |
| ❌ | — | Default schema for |
| ❌ | — | Sets the |
| ❌ |
| Use TLS ( |
| ❌ | — | Path to the server CA certificate ( |
| ❌ |
| Connection timeout, seconds |
| ❌ |
| Query timeout, seconds |
Tools
Tool | Description |
| Run a |
| Run |
| List tables, views and aliases from |
| Column definitions from |
| List non-system schemas |
| Check connectivity and show location, |
Safety
db2_readaccepts only single read statements;SELECT … FROM FINAL/NEW/OLD TABLE (INSERT/UPDATE/DELETE …)is rejected because it changes data.Keywords inside string literals and comments are ignored by the checks, so
WHERE NOTE = 'a; DROP'is not misread.Catalog lookups use bound parameters, never string concatenation.
For real protection, connect with a user whose DB2 privileges match what the assistant should be allowed to do — the guards above are a convenience, not a security boundary.
Development
npm install
npm testReleasing
Publishing is automated by .github/workflows/publish.yml via npm Trusted Publishing:
npm version patch # or minor / major — bumps package.json and creates the vX.Y.Z tag
git push --follow-tagsLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
DBRE-grade SQL analysis inside any MCP client. No connection. No install. Paste a query.
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
Paid remote MCP for governed database query review, SQL simulation, approvals, and audits.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables SQL query execution and database structure browsing via MCP tools and resources.MIT
- FlicenseNot gradedqualityDmaintenanceEnables remote database access (RDBMS and MongoDB) through MCP tools, supporting read/write queries, schema management, and more.-
- FlicenseNot gradedqualityCmaintenanceEnables MCP clients to dynamically connect to MySQL, MariaDB, and PostgreSQL databases via connection URLs, and to administer databases, tables, and records.-
- AlicenseAqualityCmaintenanceEnables MCP clients to securely query databases, list tables, inspect table schemas, and test connections across Oracle, SQL Server, MySQL, PostgreSQL, and SQLite using read-only SQL tools.4MIT