Get the FREE Ultimate OpenClaw Setup Guide →

ibm-db2 -by-cdata

This read-only MCP Server allows you to connect to IBM DB2 data from Claude Desktop through CData JDBC Drivers. For full CRUD support, check out our MCP Server for IBM DB2 (https://www.cdata.com/drivers/db2/download/mcp).

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio cdatasoftware-ibm-db2-mcp-server-by-cdata java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/ibm-db2.prp \
  --env JAVA_HOME="Path to the JDK installation"

How to use

This MCP server provides a read-only interface to IBM DB2 data exposed through the CData JDBC Driver. Once running, you can query the live data without writing SQL directly. The server exposes a set of tools that allow you to discover the data model and fetch data via a structured JSON-RPC style interface. Typical tool names are prefixed with the server name (ibm_db2) and include ibm_db2_get_tables to list available tables, ibm_db2_get_columns to list columns for a table, and ibm_db2_run_query to execute a SELECT query. You can use Claude Desktop or any compatible MCP client to discover the tables, inspect columns, and run read-only queries. The server operates over stdio, meaning it must run on the same machine as the client in its current configuration.

How to install

Prerequisites:

  • Java JDK (1.8+)
  • Maven (for building the MCP server)
  • IBM DB2 JDBC Driver from CData and a valid connection string (as described in the setup)

Setup steps:

  1. Clone the repository and navigate into it:
git clone https://github.com/cdatasoftware/ibm-db2-mcp-server-by-cdata.git
cd ibm-db2-mcp-server-by-cdata
  1. Build the MCP server JAR:
mvn clean install

This produces a JAR named something like CDataMCP-jar-with-dependencies.jar in the target folder. 3) Download and install the CData JDBC Driver for IBM DB2 from: https://www.cdata.com/drivers/db2/download/jdbc 4) License the driver (example path steps):

  • Locate the lib folder of the driver: Windows: C:\Program Files\CData\CData JDBC Driver for IBM DB2
    Mac/Linux: /Applications/CData JDBC Driver for IBM DB2/
  • Run the license command:
java -jar cdata.jdbc.db2.jar --license
  • Enter your name, email, and license key (or TRIAL).
  1. Create a .prp file for your JDBC connection (e.g., ibm-db2.prp) with the required properties:
Prefix=db2
ServerName=CDataDB2
ServerVersion=1.0
DriverPath=PATH\\TO\\cdata.jdbc.db2.jar
DriverClass=cdata.jdbc.db2.DB2Driver
JdbcUrl=jdbc:db2:InitiateOAuth=GETANDREFRESH;
Tables=
  1. Run the MCP server using the built JAR and the .prp file:
java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/Salesforce.prp

Note: The server uses stdio, so it must be used with clients that run on the same machine as the server.

Additional notes

Tips and notes:

  • This is a read-only MCP server; full read/write/update/delete capabilities are available in the full MCP Server for IBM DB2 from CData (not this read-only variant).
  • The MCP server uses standard I/O, so use a client on the same machine or configure your client to connect to the local stdio endpoint as described by your client tool.
  • If Claude Desktop or your MCP client cannot discover the server, ensure the server is running and the claude_desktop_config.json (or equivalent) is updated with the ibm_db2 entry and the paths are correct.
  • Ensure your JDBC driver license is properly applied and that the JDBC URL points to your IBM DB2 data source.
  • Tools follow the pattern {servername}_get_tables, {servername}_get_columns, and {servername}_run_query. Replace {servername} with ibm_db2 in your requests.

Related MCP Servers

Sponsor this space

Reach thousands of developers