Skip to content

l0ginp/remote-mcp-databricks-for-gptdeepresearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Databricks Explorer MCP

Databricks Explorer MCP is a prototype Minimal Command Protocol (MCP) interface designed for deep research and interactive data exploration via ChatGPT. It allows metadata exploration and SQL execution in a Databricks environment using a simplified search/fetch mechanism.

⚠️ Note: This is a conceptual example designed for future integration with ChatGPT. While the structure is functional in a server-hosted context, ChatGPT cannot directly execute SQL or external fetch requests yet. This MCP serves as a foundation for such future capabilities.


πŸ’‘ Purpose

This tool demonstrates how ChatGPT could eventually support real-time, SQL-driven research through simple commands. By building a unified abstraction for metadata discovery and SQL querying, it bridges the gap between conversational interfaces and data platforms like Databricks.


πŸš€ Features

  • πŸ” Search Tool:

    • Discover catalogs, schemas, and tables via keyword search.
    • Detects SQL-like input and creates a placeholder query::<sql> ID.
  • πŸ’₯ Fetch Tool:

    • Executes SQL queries using a fixed warehouse (only in external environments).
    • Returns Unity Catalog metadata for catalog/schema/table IDs.
  • 🧠 SQL-aware Search:

    • Input beginning with sql: or SQL verbs (SELECT, INSERT, etc.) is interpreted as a query stub.
  • 🌐 FastMCP Compatible:

    • Built on the FastMCP framework.
    • Supports SSE transport for interactive use.

βš™οΈ Environment Variables

Variable Description
DATABRICKS_WORKSPACE_URL Databricks workspace base URL
DATABRICKS_TOKEN Personal access token
DATABRICKS_WAREHOUSE_ID Warehouse ID for executing SQL
PORT (Optional) Server port, default 8080
LOG_LEVEL (Optional) Logging level, default DEBUG

πŸ†” ID Format Summary

Type Format
Catalog catalog::<catalog>
Schema schema::<catalog>.<schema>
Table table::<catalog>.<schema>.<table>
SQL query::<SQL statement>

🧩 Architecture

FastMCP
β”‚
β”œβ”€β”€ search(query) β†’ metadata or SQL stub
└── fetch(id)     β†’ SQL result or metadata

⚠️ ChatGPT Limitations

  • ChatGPT cannot currently execute live SQL or access external APIs.
  • This MCP is intended as a proof-of-concept and backend logic must be hosted separately.
  • Useful for simulating integrations and planning future assistant capabilities.

πŸ“¦ Installation & Run

pip install fastmcp requests
python server.py

Then access via:

http://localhost:8080/sse

πŸ§ͺ Development Setup

Create and Activate a Virtual Environment

python3 -m venv .venv
source .venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Run with MCP Inspector (Optional)

You can test the MCP interface using the Model Context Protocol Inspector:

npx @modelcontextprotocol/inspector@latest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages