Overview
What is MCP Server for Databricks Interaction?
The MCP Server for Databricks Interaction acts as an interface to a Databricks workspace, exposing tools to query and retrieve metadata about schemas, tables, table samples, and job results via MCP commands. It is built with FastMCP and uses the Databricks SDK and CLI for backend communication, targeting users who need simplified metadata retrieval through an MCP interface.
How to use MCP Server for Databricks Interaction?
Install prerequisites (Python 3.x, uv, and the latest databricks-cli from the official site), clone the repo, create a virtual environment with uv venv, run uv sync, and execute python init.py to configure the workspace URL, authenticate via OAuth, select a SQL Warehouse, and set the sample size. Then add the server to an MCP client (e.g., Cursor) by specifying the uv command with arguments pointing to main.py in the project directory.
Key features of MCP Server for Databricks Interaction
- Retrieves schemas and tables in a specified catalog
- Returns detailed table metadata with column info and sample data
- Provides schema metadata including comments and table details
- Fetches results from the latest job run (or last failed run)
- Uses Databricks CLI OAuth profile for authentication
Use cases of MCP Server for Databricks Interaction
- Explore all schemas and tables within a catalog for data discovery
- Inspect table structure, comments, and sample rows for schema understanding
- Quickly retrieve the output of the most recent Databricks job run
- Debug by filtering for the last failed run of a specific job
FAQ from MCP Server for Databricks Interaction
What are the prerequisites?
Python 3.x, uv (package installer), and the latest databricks-cli (version 0.18 from PyPI is too old; install directly from Databricks).
How is authentication handled?
The server uses a Databricks CLI profile named mcp_server_for_databricks. The init.py script initiates an OAuth login flow; the server obtains tokens via subprocess calls to databricks auth login and databricks auth token.
What MCP tools are provided?
Four tools: get_schemas(catalog), get_table_sample_tool(catalog, schema_name, table), get_schema_metadata(catalog_name, schema_name), and get_job_run_result(job_name, filter_for_failed_runs=False).
How is the connection configured?
The init.py script saves the workspace URL, selected SQL Warehouse ID/name, and sample size into a config.yaml file. The server reads this file on startup.
Can I use this server with Cursor IDE?
Yes. In Cursor Settings > Features > MCP, add a new server with command /path/to/uv and args including --directory /PATH/TO/THIS/REPO run main.py.