IBM Db2

IBM Db2

Where DBAs and data experts come together to stop operating and start innovating. Connect, share, and shape the AI era with us.


#Data


#Data
#Databases
#Operatingsystems
#Db2
#Databasesolutions

 View Only

IBM's Genius Hub MCP AI Agents– A Hands-On Guide with a Real Use Case

By Aadesh Rasal posted 07/13/26 01:54 PM

  

Introduction 

The latest release of Db2 Genius Hub 1.1.3 introduces the Genius Hub MCP Server—an interface between Genius Hub and AI agents that brings Db2 monitoring, diagnostics, and analysis capabilities directly into conversational and autonomous workflows. 

Before diving into the setup, it is worth exploring the value this capability can provide to users across different roles. Teams responsible for managing, monitoring, and supporting database environments often need quick access to reliable operational insights when investigating performance issues, analyzing resource utilization, identifying contention scenarios, validating system health, or reviewing backup and disaster recovery readiness. 

Having timely access to this information enables teams to detect potential risks early and make informed operational decisions. While Db2 Genius Hub already provides the data and alerts required for these investigations, obtaining answers frequently involves navigating multiple interfaces, running targeted queries, and manually correlating information across different views and tools. 

The Db2 Genius Hub MCP Server simplifies this experience by exposing these capabilities through the Model Context Protocol (MCP), enabling external AI agents to interact with Db2 monitoring and diagnostic functions in a structured, reusable, and consistent manner. This allows users to access operational insights more efficiently, streamline investigations, and accelerate problem resolution through natural language interactions and automated workflows. 

In this article, we will focus on setting up the MCP Server and demonstrate its capabilities through practical examples. 

The Setup 

For this guide I am using IBM’s in-house AI agent Bob as the MCP client to connect to the Genius Hub MCP server. Before wiring the server to Bob, it is useful to verify that the MCP service is running and reachable. This avoids configuration issues later and confirms that the server is ready before the client tries to discover its tools. 

 

Step 1 – Verify the service is running 

The first step is to confirm that all Db2 Genius Hub components, including the MCP service, are running correctly. This can be done from the command line. 

Once Db2 Genius Hub v1.1.3 is installed, navigate to the bin directory: ibm_db2GeniusHub/bin 

Then run the status script: ./status.sh 

This triggers a full product status check and lists all running services along with the ports they are listening on. The number of services shown can vary depending on the license. The output below confirms that Genius MCP Service is listening on port 8000. 

========================================== 
IBM Db2 Genius Hub - Product Status Check 
========================================== 
 
-~/ibm-db2GeniusHub/bin# ./status.sh 
 
Component Status Summary: 
Liberty Server            RUNNING         PID: 2782189 | Port(s): 11100(HTTP),11101(HTTPS) 
Agentic AI Service        RUNNING         PID: 2783147 | Port(s): 11108 
Anomaly Detection Service RUNNING         PID: 2783238 | Port(s): 11109 
DRS Agent Service         RUNNING         PID: 2782614 | Port(s): 11096 
Job Scheduler Service     RUNNING         PID: 2782691 | Port(s): 11107 
Redis Service             RUNNING         PID: 2782866 | Port(s): 6379 
Genius MCP Service        RUNNING         PID: 2820152 | Port(s): 8000 
 
Overall Status: [OK] All components are running 

Step 2 – Confirm the MCP endpoint is reachable 

After confirming that the service is up, verify that the server is responding on its configured endpoint. At this stage the goal is not to test every database capability but simply to confirm that the MCP endpoint is reachable and returning a valid response. Send a request to the /health endpoint using curl: 

curl https://<your-genius-hub-url>:8000/health 

If the server is healthy and listening on the expected endpoint, the response will look like this: 

{ 
  "status": "healthy", 
  "server": "genius-mcp", 
  "version": "0.1.0", 
  "deployment_mode": "multi_tenant", 
  "connection_pool": { 
    "total_connections": 2, 
    "active_pools": 1 
  } 
} 

The deployment_mode field indicates that this MCP server instance supports multiple tenant connections — the same server can serve multiple Genius Hub profiles without requiring separate deployments. The connection_pool reflects active database connections managed by the server at the time of the health check. 

Step 3 – Register the server with the MCP client 

With the server validated, the next step is to register it with the client through the MCP configuration file so the agent can discover the available tools and invoke them on request. The location of the configuration file depends on which MCP client you are using. For Bob, the config file is located under the .bob directory with the name mcp.json. If this is the first MCP server you are setting up, the file may not exist yet — in that case, simply create it manually at that path. 

Once the file is in place, add the following server entry: 

{ 
  "mcpServers": { 
    "db2-genius-mcp": { 
      "type": "streamable-http", 
      "url": "https://<your-genius-hub-url>:8000/mcp", 
      "headers": { 
        "X-Genius-Hub-Hostname":     "<your-genius-hub-host>", 
        "X-Genius-Hub-Port":         "<your-genius-hub-port>", 
        "X-Genius-Hub-Protocol":     "<protocol-used-by-genius-hub>", 
        "X-Genius-Hub-Token":        "<ibm-genius-hub-token>", 
        "X-Genius-Hub-Profile-Name": "<default-db-profile>" 
      }, 
      "disabled": false 
    } 
  } 
} 

A few notes on the configuration fields: 

  • type: streamable-http — the transport type used by this MCP server. Genius Hub MCP uses HTTP-based streaming, which keeps the connection open for multi-step tool calls. 

  • X-Genius-Hub-Token — the authentication token issued by Genius Hub. This is the same token used to authenticate against the Genius Hub REST API. The token can be issued by using following api call from remote machine  

    • Remote machine: - curl -X POST 'https://<genius-hub-hostname>:11101/dbapi/v4/auth/tokens' -H 'Content-Type: application/json' -d '{"userid": "your-genius-hub-username", "password": "your-corresponding-password"}' --cacert  <path-to-genius-hub-ca-cert.pem> 

    • Host machine: - curl -X POST 'http://<genius-hub-hostname>:11100/dbapi/v4/auth/tokens' -H 'Content-Type: application/json' -d '{"userid": "your-genius-hub-username", "password": "your-corresponding-password"}'  

  • X-Genius-Hub-Profile-Name — the default database profile the agent will work with unless overridden at runtime. If left empty, the agent will need to explicitly select a profile before invoking any database tools. 

Once this configuration is saved, restart Bob (or whichever client you are using) so it picks up the new server entry. The client will connect to the MCP endpoint, fetch the tool manifest, and make those tools available in conversations. 

The Interaction and Use Case 

Assuming the setup was successful and the client is connected to the MCP server, let’s explore what the toolset looks like in practice. The following examples walk through some basic diagnostic flows before moving to the main use case. 

Listing database profiles 

Starting with a simple prompt to list the database profiles registered in the Genius Hub instance. The agent calls the fetch-dic-db-profiles tool and returns the available profile names. 

Prompt: "List the db profiles." 

 

Connecting to a profile 

With the profile list in hand, the next step is to connect to one of them. The agent calls the connect-to-profile tool, passing the profile name as an argument. In this example the agent connected to the profile steven-spilldb, and the connection was established successfully. 

Prompt: "Connect to the profile steven-spilldb." 

 

With the connection active, the agent can now run diagnostic queries against that database conversationally. The following prompts illustrate a sample of what is available. 

Example diagnostic prompts 

The agent queries fetch_tables tool and returns a ranked table list with page counts and tablespace assignments. 

Prompt: "Get me the list of tables sorted by tablespace usage in descending order." 

 

The agent runs get_explain_plan tool on the provided SQL against the connected profile and returns the access plan — including estimated cost, whether a table scan or index access is used, and any sort operations involved. 

Prompt: "Get the explain plan for this query: SELECT * FROM BDI50.CUSTOMER WHERE C_BIRTH_YEAR > 1990" 

 

The agent queries get buffer pool statistics and surfaces the tables with the lowest hit ratios — the ones most likely to benefit from additional memory allocation or index tuning. 

Prompt: "List the top 10 tables sorted by buffer pool hit ratio." 

 

The agent scans the catalog and identifies tables where RUNSTATS has never been executed or where the last statistics collection date is missing. This is a common diagnostic step before investigating query optimizer plan regressions. 

Prompt: "List all the tables for which statistics have not been collected." 

 

The examples above cover a cross-section of the available tools. There are many more to explore — lock analysis, backup status checks, HADR state inspection, and more. Each of these can be invoked through natural language and combined in multi-step workflows. The next section walks through a concrete end-to-end use case: generating a full capacity planning report for a live database instance. 

Use Case — Capacity Planning Report for SPILLDB 

To exercise a more realistic workflow, the following prompt was sent to the agent asking for a detailed capacity planning report on the connected database instance (profile: steven-spilldb / database: SPILLDB): 

 

Prompt: "Generate a detailed capacity planning report for the connected database. Include tablespace utilization, the top space-consuming tables, an I/O activity summary, space exhaustion projections, and actionable recommendations." 

The agent executed a sequence of tool calls behind the scenes — fetching tablespace utilization metrics, enumerating the largest tables by size, pulling buffer pool and I/O statistics from SYSIBMADM views — and synthesised all of that data into a structured HTML report. 

What the report found 

The report surfaced a critical finding immediately: USERSPACE1 was at 99.8% capacity, with only approximately 8–9 MB of free space remaining on both members (0 and 1). Auto-resize was enabled, but the tablespace max size was set to Unlimited, meaning it would auto-extend only if the underlying filesystem had space available — a condition that required immediate verification at the OS level. 

The top space consumers driving this situation were three TPC-DS fact tables: 

  • BDI50.STORE_SALES — 4.26 GB (~38% of the tablespace allocation) 

  • BDI50.CATALOG_SALES — 3.39 GB (~30%) 

  • BDI50.INVENTORY — 1.81 GB (~16%) 

Together these three tables accounted for over 84% of the allocated tablespace. 

On the I/O side, the buffer pool hit ratio for IBMDEFAULTBP was 99.68% over the last seven days, indicating that the read workload was being served almost entirely from memory and physical disk pressure was low. The package cache hit ratio was 0%, consistent with either a recently restarted instance or a workload dominated by ad-hoc queries that do not reuse compiled plans. 

The report also flagged that table statistics for all BDI50 tables were stale — last collected more than three months prior — which can cause the query optimizer to generate sub-optimal access plans, particularly relevant for the large fact tables already identified as storage hotspots. 

Recommendations generated by the agent 

Immediate actions: 

  • Verify filesystem space on the auto-storage path — USERSPACE1 will auto-extend but needs OS-level disk space to be available. 

  • If the filesystem is also near full, proactively add storage containers or extend the tablespace before space is exhausted. 

  • Run REORG on the large tables to reclaim reclaimable extents (reclaimable space was confirmed enabled on USERSPACE1). 

Short-term actions (within one week): 

  • Enable auto-resize on TS4MONITOR — currently disabled; set an explicit max size cap to avoid unbounded growth. 

  • Run RUNSTATS on all BDI50 tables to refresh the optimizer’s view of data distribution. 

  • Evaluate whether a data archival or purge policy is feasible for STORE_SALES and CATALOG_SALES if a retention policy exists. 

Monitoring recommendations: 

  • Enable RTMON event monitors (CONFIG, DDL, UTILITY) to establish a proper historical metrics baseline. 

  • Configure alerts in IBM Data Console for USERSPACE1 > 80% utilization. 

  • Monitor the auto-storage path disk usage weekly given the current near-full state. 

  • Keep an eye on TEMPSPACE1 filesystem free space — sort-heavy TPC-DS workloads can spill significant data to temporary tablespace. 

The generated report 

The full output rendered by the agent is shown below. It includes the tablespace detail table, top space consumer breakdown with visual utilization bars, growth projections at different data ingestion rates, the 7-day I/O activity summary, the prioritised recommendation sections, and quick-reference SQL snippets the DBA can run directly: 

 

 

 
Quick-reference SQL included in the report: 

-- Check filesystem auto-storage path usage 
SELECT STORAGE_GROUP_NAME, DB_STORAGE_PATH, FS_TOTAL_SIZE, FS_USED_SIZE, 
       DECIMAL(FS_USED_SIZE * 100.0 / NULLIF(FS_TOTAL_SIZE,0), 5, 2) AS PCT_USED 
FROM SYSIBMADM.STORAGE_PATHS; 
 
-- Reorg to reclaim space in USERSPACE1 
REORG TABLE BDI50.STORE_SALES ALLOW WRITE ACCESS RECLAIM EXTENTS; 
 
-- Refresh statistics on the largest tables 
RUNSTATS ON TABLE BDI50.STORE_SALES WITH DISTRIBUTION AND INDEXES ALL; 
RUNSTATS ON TABLE BDI50.CATALOG_SALES WITH DISTRIBUTION AND INDEXES ALL; 
RUNSTATS ON TABLE BDI50.INVENTORY WITH DISTRIBUTION AND INDEXES ALL; 

This use case illustrates a key practical benefit of the MCP integration: the agent does not just fetch a single metric. It orchestrates multiple tool calls, correlates results across tablespace views, I/O monitors, and catalog statistics, and produces an actionable structured output. The same workflow would typically require a DBA to run several queries manually, cross-reference multiple system views, inspect I/O monitor data, and write up the findings. Here, that entire sequence is driven by a single natural-language prompt. 

Closing Thoughts 

Db2 Genius Hub MCP is not an abstraction layer that merely simplifies queries — it is a direct bridge that lets your AI agent work with the same diagnostic data a DBA would use, through a protocol designed for multi-step, conversational workflows. The tools exposed cover tablespace utilization, buffer pool performance, query explain plans, index analysis, lock monitoring, HADR state, backup status, and more. 

The setup is straightforward: verify the service is running, confirm the /health endpoint responds, add a single JSON block to your client’s MCP configuration, and the tools are immediately available in your agent’s conversation. From there, the depth of analysis possible — as the capacity planning use case demonstrates — is determined by how you combine those tools through natural language. 

About Author

Aadesh Rasal: Aadesh is a Software Engineer with 5 years of experience in developing backend services for enterprise software. In IBM He has worked on building solutions for Db2’s Native Cloud Object Storage vertical and is currently part of the DB2 Agentic AI Evaluation team. His current focus is on developing automated evaluation pipelines for AI agents across multiple domains and ensuring consistent performance through benchmarking and inference validation across different Cloud and vLLM platforms. 

 

0 comments
56 views

Permalink