Skip to main content
DBTools MCP Server is a legacy proof-of-concept server. For new MySQL HeatWave or MySQL AI projects, use the MySQL MCP Server instead. For Oracle Database, consider the Oracle DB MCP Toolkit.
A FastMCP-based server that provides tools for managing OCI database resources through Database Tools connections, including autonomous databases, SQL execution, and HeatWave ML/AI features.
This MCP server is not intended for production use but as a proof of concept for exploring models using MCP Servers.

Overview

The DBTools MCP Server bridges the Model Context Protocol with Oracle Cloud Infrastructure’s Database Tools service, enabling:
  • Database operations through OCI DBTools connections
  • Autonomous Database management
  • HeatWave ML and RAG capabilities
  • Report management with vector similarity search
  • OCI Object Storage integration

When to Use This Server

Use DBTools MCP Server if:
  • You have existing OCI Database Tools connections configured
  • You need to manage Autonomous Databases via OCI
  • You’re exploring legacy HeatWave ML features
Instead, consider:

Features

Compartment Management

  • list_all_compartments: List all compartments in tenancy
  • get_compartment_by_name_tool: Get compartment details by name

Database Operations

  • list_autonomous_databases: List databases in specific compartments
  • list_all_databases: List all databases across tenancy
  • execute_sql_tool: Execute SQL scripts on database connections
  • get_table_info: Retrieve table information (Oracle and MySQL)
  • list_tables: List all tables in a database

Database Tools Connection Management

  • list_dbtools_connection_tool: List connections in a compartment
  • list_all_connections: List all database connections
  • get_dbtools_connection_by_name_tool: Get connection details by name

Report Management

  • bootstrap_reports: Ensure report_definitions table exists
  • create_report: Create new report definition with SQL
  • execute_report: Execute report with bind values
  • get_report: Retrieve report definition
  • delete_report: Delete report definition
  • list_reports: List all reports for a connection
  • find_matching_reports: Vector similarity search for reports
  • ragify_column: Create and populate vector columns for RAG

HeatWave ML and AI Tools

MySQL AI is not compatible with DBTools MCP Server. Use MySQL MCP Server for MySQL AI.
  • heatwave_ask_help: Ask questions about HeatWave ML (AutoML)
  • heatwave_ask_ml_rag: Retrieval-augmented generation on vector stores
  • heatwave_load_vector_store: Load documents from Object Storage into vector stores

Object Storage

  • object_storage_list_buckets: List accessible buckets
  • object_storage_list_objects: List objects in a bucket

Prerequisites

  • Python 3.x
  • OCI SDK (installed via requirements.txt)
  • FastMCP (installed via requirements.txt)
  • Valid OCI configuration file (~/.oci/config) with credentials
OCI SDK Configuration Documentation

Installation

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt
  1. Configure OCI credentials at ~/.oci/config

Configuration

MCP Client Configuration (Claude Desktop)

Windows:
{
  "mcpServers": {
    "dbtools": {
      "command": "C:\\Python\\python.exe",
      "args": [
        "C:\\path\\to\\dbtools-mcp-server\\dbtools-mcp-server.py"
      ]
    }
  }
}
macOS/Linux:
{
  "mcpServers": {
    "dbtools": {
      "command": "python",
      "args": [
        "/path/to/dbtools-mcp-server/dbtools-mcp-server.py"
      ]
    }
  }
}

Environment Variables

VariableDescriptionDefault
PROFILE_NAMEOCI configuration profile nameDEFAULT
TENANCY_ID_OVERRIDEOverride tenancy ID from configNone
MODEL_NAMEEmbedding model nameMINILM_L12_V2
MODEL_EMBEDDING_DIMENSIONVector embedding dimension384
Example with Environment Variables:
{
  "mcpServers": {
    "dbtools": {
      "command": "python",
      "args": [
        "/path/to/dbtools-mcp-server/dbtools-mcp-server.py"
      ],
      "env": {
        "TENANCY_ID_OVERRIDE": "ocid1.tenancy.oc1...",
        "PROFILE_NAME": "PRODUCTION",
        "MODEL_NAME": "ADMIN.MINILM_L12_V2"
      }
    }
  }
}
The MODEL_NAME may need to be prefixed with the database schema (e.g., ADMIN.MINILM_L12_V2) depending on your database user.

Supported Database Types

  • Oracle Database (including Autonomous Database)
  • MySQL (including HeatWave)
MySQL AI is not supported. Use MySQL MCP Server instead.

Usage Examples

Database Administration

"List all databases in my tenancy"
"Show me the databases in the production compartment"
"Get all database connections"
"What tables exist in the marketing database?"

Creating and Managing Tables

"Create an employee table in the HR database with columns for ID, name, email, and salary"
"Show me all tables in the finance database"
"Add a department column to the employee table"

Querying Data

"What's the average salary of employees by department?"
"Show me all employees hired in the last 6 months"
"List the top 5 departments by headcount"
"Get all projects with status 'In Progress'"

HeatWave ML Tools

"Ask ml_rag: What is the most prestigious Grand Prix?"
"How can I train a model to predict food delivery times?"
"Create a vector store from files in my bucket"

Compartment Management

"Show me all compartments"
"List databases in the development compartment"
"Get details of the production compartment"

Object Storage

"What buckets do I have?"
"List objects in my bucket"
Replace placeholder names (like “HR database”, “production compartment”) with your actual Database Tools connection names and compartment names.

Complete Tool Reference

ToolParametersDescription
list_all_compartmentsNoneLists all compartments in tenancy
get_compartment_by_name_toolnameGet compartment details by name
list_autonomous_databasescompartment_nameList databases in compartment
list_all_databasesNoneList all databases in tenancy
list_dbtools_connection_toolcompartment_nameList DBTools connections
list_all_connectionsNoneList all database connections
get_dbtools_connection_by_name_tooldisplay_nameGet connection by name
execute_sql_tooldbtools_connection_display_name, sql_scriptExecute SQL
get_table_infodbtools_connection_display_name, table_nameGet table info
list_tablesdbtools_connection_display_nameList all tables
bootstrap_reportsdbtools_connection_display_nameCreate report_definitions table
create_reportdbtools_connection_display_name, name, sql_query, description, bind_parametersCreate report
execute_reportdbtools_connection_display_name, report_name, bind_valuesExecute report
get_reportdbtools_connection_display_name, report_nameGet report definition
delete_reportdbtools_connection_display_name, report_nameDelete report
list_reportsdbtools_connection_display_nameList all reports
find_matching_reportsdbtools_connection_display_name, search_text, limitVector similarity search
ragify_columndbtools_connection_display_name, table_name, column_names, vector_column_nameCreate vector embeddings
heatwave_ask_helpdbtools_connection_display_name, questionAsk about HeatWave ML
heatwave_ask_ml_ragdbtools_connection_display_name, questionRAG query on vector stores
heatwave_load_vector_storedbtools_connection_display_name, namespace, bucket_name, document_prefix, schema_name, table_nameLoad documents from Object Storage
object_storage_list_bucketscompartment_idList Object Storage buckets
object_storage_list_objectsnamespace, bucket_nameList objects in bucket
The DBTools MCP Server includes a unique report management system with vector similarity search:

1. Bootstrap Reports

Create the report_definitions table:
"Bootstrap reports for my database connection"

2. Create Reports

Define reusable SQL queries:
"Create a report called 'Monthly Sales' that shows total sales by month"

3. Execute Reports

Run saved reports with optional parameters:
"Execute the 'Monthly Sales' report"
"Execute the 'Employee Salary' report for department 'Engineering'"

4. Find Similar Reports

Use vector similarity search to find related reports:
"Find reports similar to 'sales analysis'"
"Show me reports about employee data"

5. Create Vector Embeddings

Generate embeddings for text columns:
"Create embeddings for the 'description' column in the reports table"

Migration Guide

From DBTools MCP Server to MySQL MCP Server

If you’re using DBTools for MySQL HeatWave: Old (DBTools):
"Ask ml_rag using my_dbtools_connection: What is the refund policy?"
New (MySQL MCP):
"Ask ml_rag: What is the refund policy?" (using configured connection)
View MySQL MCP Server Migration \u2192

From DBTools MCP Server to Oracle DB Toolkit

If you need custom tools or production deployment for Oracle Database: Benefits:
  • YAML-based custom tool framework
  • HTTP deployment with OAuth2
  • No OCI dependency for core features
  • Better performance analysis tools
View Oracle DB Toolkit \u2192

Security

The server uses OCI’s built-in authentication:
  • OCI config file-based authentication: Uses ~/.oci/config
  • Signer-based authentication: For specific endpoints
  • IAM policies: Controlled by OCI IAM

Limitations

  • Not production-ready: Proof of concept only
  • No MySQL AI support: Use MySQL MCP Server for MySQL AI
  • OCI dependency: Requires OCI Database Tools connections
  • No custom tools: Cannot define custom SQL tools (use Oracle DB Toolkit)
  • stdio only: No HTTP deployment mode

Troubleshooting

OCI Configuration Errors

Symptom: “Could not load OCI config” Solutions:
  • Verify ~/.oci/config exists
  • Check API key file path and permissions
  • Ensure tenancy, user, and fingerprint are correct

Connection Not Found

Symptom: “No connection found with name ‘X’” Solutions:
  • List all connections: "Show me all database connections"
  • Check connection name spelling
  • Verify connection exists in OCI Database Tools

HeatWave ML Errors

Symptom: HeatWave tools not working Solutions:
  • Ensure you’re using HeatWave (not MySQL AI)
  • Verify HeatWave cluster is active
  • Check MODEL_NAME environment variable
  • For MySQL AI, use MySQL MCP Server

Next Steps

MySQL MCP Server

Recommended for new MySQL projects

Oracle DB Toolkit

For Oracle Database with custom tools

Database Servers

Compare all database servers

OCI Configuration

Set up OCI credentials

Build docs developers (and LLMs) love