A powerful Model Context Protocol (MCP) server for executing Databricks SQL queries and comparing table data.
⚠️ This project is purely meant for demo purposes - use at your own risk!
| Execute SQL Queries | Run any SQL query on Databricks with configurable result limits |
| Table Information | Get detailed information about tables including schema and row counts |
| Table Comparison | Compare two tables by downloading their data and running CLI diff |
| Quick Comparison | Fast metadata-only comparison of tables |
| Python | 3.11 or higher |
| Databricks | Workspace access |
| Token | Personal access token |
Set the following environment variables or create a .env file:
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate -
Install dependencies:
pip install -r requirements.txt -
Run the server:
python databricks_server.py
| execute_query | Execute SQL queries | query, limit |
| get_table_info | Get table metadata | table_name, catalog, schema |
| compare_tables | Full data comparison | table1, table2, diff_lines |
| quick_compare_tables | Metadata comparison | table1, table2 |
Execute a SQL query on Databricks.
Parameters:
- query (str): SQL query to execute
- limit (int, optional): Maximum rows to return (default: 1000)
Example:
Get information about a Databricks table.
Parameters:
- table_name (str): Name of the table
- catalog (str, optional): Catalog name
- schema (str, optional): Schema name
Example:
Compare data between two tables by downloading full data and running diff.
Parameters:
- table1 (str): First table name
- table2 (str): Second table name
- catalog1 (str, optional): Catalog for table1
- schema1 (str, optional): Schema for table1
- catalog2 (str, optional): Catalog for table2
- schema2 (str, optional): Schema for table2
- diff_lines (int, optional): Number of diff context lines (default: 10)
Example:
Quick metadata-only comparison without downloading data.
Parameters:
- table1 (str): First table name
- table2 (str): Second table name
- catalog1 (str, optional): Catalog for table1
- schema1 (str, optional): Schema for table1
- catalog2 (str, optional): Catalog for table2
- schema2 (str, optional): Schema for table2
Example:
Add this configuration to your VS Code settings (mcp.json):
Click to expand VS Code configurationThis project is licensed under the MIT License.
Made with ❤️ for the Databricks community
.png)

