logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mcp-databricks-access-gateway

A Model Context Protocol adapter facilitating secure interaction with the Databricks unified analytics platform. It permits natural language requests to execute arbitrary SQL, retrieve operational job inventories, and ascertain the current state of asynchronous workflows within the designated Databricks workspace.

Author

mcp-databricks-access-gateway logo

JordiNeil

No License

Quick Info

GitHub GitHub Stars 41
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

databrickscloudservicesdatabricks serverdatabricks apidatabricks environment

Databricks MCP Interface Adapter

This component functions as an MCP server endpoint, establishing a bidirectional communication channel with the Databricks REST API. This capability allows Language Models to programmatically issue data manipulation/query commands, inspect the catalog of defined data pipelines (jobs), and obtain real-time status updates for those computations.

Core Functionalities

  • Execute arbitrary SQL statements against designated Databricks SQL computing endpoints.
  • Generate a comprehensive manifest of all scheduled and ad-hoc Databricks workflows.
  • Query the precise execution status associated with any given Databricks job identifier.
  • Fetch exhaustive metadata pertaining to a specified Databricks job execution.

System Requirements

  • Requires Python interpreter version 3.7 or newer.
  • Access to a configured Databricks environment, necessitating:
    • A valid Personal Access Token (PAT).
    • The network address and identifier for an active SQL endpoint/warehouse.
    • Appropriate IAM permissions to initiate queries and enumerate job resources.

Deployment Procedure

  1. Clone the source code repository.
  2. Establish and activate an isolated Python environment (highly recommended):

    python -m venv .venv source .venv/bin/activate # Use .venv\Scripts\activate on Windows OS

  3. Install required library dependencies:

    pip install -r requirements.txt

  4. Populate the configuration file named .env in the project root with the following essential environment variables:

    DATABRICKS_HOST=your-databricks-instance.cloud.databricks.com DATABRICKS_TOKEN=your-personal-access-token DATABRICKS_HTTP_PATH=/sql/1.0/warehouses/your-warehouse-id

  5. (Optional, yet advised) Validate network connectivity and credential integrity:

    python test_connection.py

Credential Acquisition Guidance

  1. Workspace Hostname: Provide the root URL of your Databricks deployment (e.g., mycompany.cloud.databricks.com).
  2. Access Token: Generate a PAT within the Databricks UI:
    • Navigate to User Settings (top-right profile menu).
    • Select the 'Developer' pane.
    • Under the 'Access tokens' heading, click 'Manage'.
    • Generate a fresh token and secure its value immediately upon creation.
  3. Warehouse HTTP Path: Locate this path within the SQL Warehouses management section:
    • Select the target SQL Endpoint.
    • Examine the connection details pane to retrieve the required HTTP Path string.

Initiating the Service

Launch the MCP server application:

python main.py

Verification of server responsiveness can be performed using the official MCP inspection utility:

npx @modelcontextprotocol/inspector python3 main.py

Exposed MCP Interface Functions

The following methods are registered and callable by compliant LLM agents:

  1. execute_sql(query_string: str) - Submits and runs a declarative query against the operational SQL compute cluster.
  2. enumerate_workflows() - Fetches a list of all defined automated tasks (jobs) within the Databricks environment.
  3. check_workflow_status(identifier: int) - Retrieves the current state (e.g., RUNNING, SUCCESS, FAILED) for a job identified by its unique ID.
  4. fetch_workflow_metadata(identifier: int) - Returns comprehensive configuration and historical run data for a specified job ID.

Contextual Integration Examples (LLM Interaction)

When coupled with an LLM supporting the MCP specification, this gateway enables sophisticated data interaction via natural prose:

  • "What schemas are accessible via the default catalog?"
  • "Generate a count of entries in the 'transaction_logs' table."
  • "Provide a full inventory of all configured ETL pipelines."
  • "Determine if workflow ID 123 has finished execution."
  • "Display the parameters used for the pipeline identified as #456."

Diagnostics and Problem Resolution

Connectivity Faults

  • Confirm the host value omits scheme prefixes like http://.
  • Ensure the target SQL warehouse cluster is presently active and not paused.
  • Validate the PAT possesses the minimal necessary scope permissions.
  • Re-run the integrated validation script: python test_connection.py

Security Posture Notes

  • The Databricks PAT grants high-level access; treat it as a critical secret.
  • The .env file must be excluded from any source control repositories (e.g., Git).
  • Implement least-privilege principles when defining the token's operational scope.
  • Deploy this adapter within a hardened, access-controlled network segment.

See Also

`