MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

O
Oracle MCP Agent Tuning

MCP server by krzysztof-i-cabaj

Created 12/10/2025
Updated 3 days ago
Repository documentation and setup instructions

🤖 Autonomous Oracle DBA Agent (MCP + SQLcl Experiment)

Experiment: Can AI autonomously diagnose, fix, and report performance issues in an Oracle Database?

This project demonstrates a true Agentic Workflow, where an AI model (Claude Haiku 4.5) is connected to an Oracle Database 26ai instance via the Model Context Protocol (MCP) and SQLcl.

The Agent was given full database access and a single high-level command: "Find slow queries and fix them." I did not manually write a single line of remedial SQL code.


📊 Live Demo Results

The Agent autonomously generated the following reports as proof of work. These are hosted directly from this repository:

🚀 VIEW FULL TECHNICAL REPORT (HTML)

Interactive dashboard with Chart.js visualizations showing "Before" and "After" analysis.

📄 VIEW EXECUTIVE SUMMARY (HTML)

Business-ready version of the report, formatted for print/PDF export.


📉 Key Agent Achievements

In a single 5-minute autonomous session, the Agent achieved the following:

| Issue Detected | Agent's Diagnosis | Solution Applied | CBO Cost Impact | Improvement | | :--- | :--- | :--- | :--- | :--- | | Query 2 (VIP Join) | Missing FK indexes, Full Table Scan | Created index IDX_DEMO_CUSTOMERS_SEGMENT | 2,200 ➔ 414 | -81.2% 📉 | | Query 3 (Top-N Sort) | Expensive in-memory sorting (PGA) | Created index IDX_ORDER_ITEMS_UNIT_PRICE_DESC | 11,492 ➔ 3 | -99.97% 🚀 |


🛠️ Solution Architecture

This is not just "Text-to-SQL". It is a system where AI executes commands in a live runtime environment.

  • Database: Oracle Database 26ai (Free Developer Release)
  • Interface: VS Code + GitHub Copilot (acting as the MCP Client)
  • Tooling: Oracle SQLcl (running with the -mcp flag)
  • Logic: Autonomous Decision Loop (OODA: Observe, Orient, Decide, Act)

Workflow:

  1. Analyze: Agent runs EXPLAIN PLAN for the provided workload.
  2. Decide: It detects TABLE ACCESS FULL operations and blocking functions in WHERE clauses.
  3. Act: It executes DDL (CREATE INDEX...) directly on the database.
  4. Verify: It re-runs tests to compare metrics.
  5. Report: It generates HTML/JSON files with the results.

📂 Repository Structure

  • /docs - HTML reports generated by the AI (publicly accessible via GitHub Pages).
  • /sql - SQL scripts used for environment setup and workload simulation.
  • /metrics - Raw CSV data containing performance metrics.

📞 Contact / About

This project was created to test the limits of current LLMs in database engineering tasks.

https://www.linkedin.com/in/krzysztof-cabaj-16b6a52/

Quick Setup
Installation guide for this server

Installation Command (package not published)

git clone https://github.com/krzysztof-i-cabaj/oracle-mcp-agent-tuning
Manual Installation: Please check the README for detailed setup instructions and any additional dependencies required.

Cursor configuration (mcp.json)

{ "mcpServers": { "krzysztof-i-cabaj-oracle-mcp-agent-tuning": { "command": "git", "args": [ "clone", "https://github.com/krzysztof-i-cabaj/oracle-mcp-agent-tuning" ] } } }