databricks-mcp-toolkit 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,282 @@
1
+ Metadata-Version: 2.5
2
+ Name: databricks-mcp-toolkit
3
+ Version: 0.2.0
4
+ Summary: Model Context Protocol (MCP) server for Databricks: clusters, jobs, SQL, Unity Catalog, volumes and notebooks.
5
+ Project-URL: Homepage, https://github.com/kshptl/Databricks-MCP-Server
6
+ Project-URL: Repository, https://github.com/kshptl/Databricks-MCP-Server
7
+ Project-URL: Issues, https://github.com/kshptl/Databricks-MCP-Server/issues
8
+ Project-URL: Changelog, https://github.com/kshptl/Databricks-MCP-Server/blob/main/CHANGELOG.md
9
+ Author: Kush Patel
10
+ License-Expression: AGPL-3.0-only
11
+ License-File: LICENSE
12
+ Keywords: ai-agents,claude,databricks,llm,mcp,model-context-protocol,unity-catalog
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Database
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.10
26
+ Requires-Dist: databricks-sdk>=0.40
27
+ Requires-Dist: httpx>=0.27
28
+ Requires-Dist: mcp<3,>=2.3
29
+ Requires-Dist: pydantic>=2.7
30
+ Provides-Extra: dev
31
+ Requires-Dist: build; extra == 'dev'
32
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
33
+ Requires-Dist: pytest>=8; extra == 'dev'
34
+ Requires-Dist: respx>=0.22; extra == 'dev'
35
+ Requires-Dist: ruff>=0.6; extra == 'dev'
36
+ Requires-Dist: twine; extra == 'dev'
37
+ Description-Content-Type: text/markdown
38
+
39
+ # Databricks MCP Toolkit
40
+
41
+ [![PyPI](https://img.shields.io/pypi/v/databricks-mcp-toolkit.svg)](https://pypi.org/project/databricks-mcp-toolkit/)
42
+ [![Python](https://img.shields.io/pypi/pyversions/databricks-mcp-toolkit.svg)](https://pypi.org/project/databricks-mcp-toolkit/)
43
+ [![CI](https://github.com/kshptl/Databricks-MCP-Server/actions/workflows/ci.yml/badge.svg)](https://github.com/kshptl/Databricks-MCP-Server/actions/workflows/ci.yml)
44
+ [![License: AGPL-3.0](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](LICENSE)
45
+
46
+ A [Model Context Protocol](https://modelcontextprotocol.io) server that lets Claude, Cursor, VS Code and other MCP clients work with a Databricks workspace. Through it, the assistant can browse Unity Catalog, run SQL, read and write volume files, manage clusters and jobs, export and import notebooks, and run code on a cluster.
47
+
48
+ - **Current Databricks APIs:** Jobs 2.2, Clusters 2.1, Unity Catalog 2.1, the Files API for volumes, and SQL Statement Execution.
49
+ - **Any Databricks auth method:** personal access tokens, OAuth (user or service principal), `~/.databrickscfg` profiles and Azure CLI, all handled by the official `databricks-sdk`.
50
+ - **Safe to point at real workspaces:** a read-only mode, per-toolset filtering, MCP tool annotations (read-only and destructive hints), no automatic retries of non-idempotent calls, and response size caps so a big result doesn't flood the model's context.
51
+
52
+ ## Quick start
53
+
54
+ You need Python 3.10+ and [uv](https://docs.astral.sh/uv/) (or pipx/pip).
55
+
56
+ ```bash
57
+ # try it without installing
58
+ uvx --from databricks-mcp-toolkit databricks-mcp list-tools
59
+
60
+ # or install it
61
+ pipx install databricks-mcp-toolkit # or: pip install databricks-mcp-toolkit
62
+ databricks-mcp --version
63
+ ```
64
+
65
+ ### Claude Desktop
66
+
67
+ Add this to `claude_desktop_config.json` (Settings → Developer → Edit Config):
68
+
69
+ ```json
70
+ {
71
+ "mcpServers": {
72
+ "databricks": {
73
+ "command": "uvx",
74
+ "args": ["--from", "databricks-mcp-toolkit", "databricks-mcp"],
75
+ "env": {
76
+ "DATABRICKS_HOST": "https://<your-workspace>.cloud.databricks.com",
77
+ "DATABRICKS_TOKEN": "<personal-access-token>",
78
+ "DATABRICKS_WAREHOUSE_ID": "<optional default SQL warehouse id>"
79
+ }
80
+ }
81
+ }
82
+ }
83
+ ```
84
+
85
+ ### Claude Code
86
+
87
+ ```bash
88
+ claude mcp add databricks \
89
+ -e DATABRICKS_HOST=https://<your-workspace>.cloud.databricks.com \
90
+ -e DATABRICKS_TOKEN=<personal-access-token> \
91
+ -- uvx --from databricks-mcp-toolkit databricks-mcp
92
+ ```
93
+
94
+ ### Cursor / VS Code / other clients
95
+
96
+ Use the same command and env vars: `uvx --from databricks-mcp-toolkit databricks-mcp`. To serve over HTTP instead of stdio:
97
+
98
+ ```bash
99
+ databricks-mcp run --transport streamable-http --host 127.0.0.1 --port 8000
100
+ ```
101
+
102
+ ## Authentication
103
+
104
+ Auth is delegated to [Databricks unified auth](https://docs.databricks.com/aws/en/dev-tools/auth/unified-auth), so whatever works for the Databricks CLI works here:
105
+
106
+ | Method | Set |
107
+ |---|---|
108
+ | Personal access token | `DATABRICKS_HOST`, `DATABRICKS_TOKEN` |
109
+ | OAuth service principal (M2M) | `DATABRICKS_HOST`, `DATABRICKS_CLIENT_ID`, `DATABRICKS_CLIENT_SECRET` |
110
+ | OAuth user login (U2M) | Run `databricks auth login --host <url>` once, then set `DATABRICKS_CONFIG_PROFILE` (or nothing for `DEFAULT`) |
111
+ | Config profile | `DATABRICKS_CONFIG_PROFILE=<name>` from `~/.databrickscfg` |
112
+ | Azure | Azure CLI login or the `ARM_*` / `DATABRICKS_AZURE_*` variables |
113
+
114
+ For anything shared or automated, use a service principal that has only the permissions the assistant needs. The server can do anything that identity can do.
115
+
116
+ ## Configuration
117
+
118
+ | Variable | Default | Purpose |
119
+ |---|---|---|
120
+ | `DATABRICKS_WAREHOUSE_ID` | none | Default warehouse for `execute_sql` |
121
+ | `DATABRICKS_MCP_READ_ONLY` | `false` | Only expose tools that can't change anything (also `--read-only`) |
122
+ | `DATABRICKS_MCP_TOOLSETS` | all | Comma-separated subset: `clusters,jobs,workspace,volumes,dbfs,sql,unity_catalog,commands` (also `--toolsets`) |
123
+ | `DATABRICKS_MCP_MAX_RESPONSE_CHARS` | `50000` | Larger tool results are truncated with a note telling the model to narrow the request |
124
+ | `DATABRICKS_MCP_HTTP_TIMEOUT` | `60` | Per-request timeout, in seconds |
125
+ | `DATABRICKS_MCP_MAX_RETRIES` | `3` | Retries for 429s and for 5xx/timeouts on idempotent requests |
126
+ | `DATABRICKS_MCP_LOG_LEVEL` | `WARNING` | Logs go to stderr (stdout carries the MCP protocol) |
127
+ | `DATABRICKS_MCP_TRANSPORT` | `stdio` | `stdio` or `streamable-http` |
128
+
129
+ ### Read-only mode
130
+
131
+ ```bash
132
+ databricks-mcp run --read-only
133
+ ```
134
+
135
+ This hides every tool that creates, changes or deletes something. That includes `execute_sql` and `run_command`, because arbitrary SQL or code can't be guaranteed read-only. What's left is browsing Unity Catalog, volumes, DBFS, the workspace, clusters, jobs, runs and warehouses. For read-only SQL, give a service principal `SELECT`-only grants and run without `--read-only`.
136
+
137
+ ## Tools
138
+
139
+ 48 tools in 8 toolsets. Run `databricks-mcp list-tools` to see what your settings expose.
140
+
141
+ <!-- tools:start -->
142
+
143
+ **Clusters** (`clusters`)
144
+
145
+ | Tool | Read-only | What it does |
146
+ |---|:---:|---|
147
+ | `list_clusters` | ✓ | List pinned and active clusters, plus clusters terminated in the last 30 days. |
148
+ | `get_cluster` | ✓ | Get the full configuration and state of one cluster. |
149
+ | `list_spark_versions` | ✓ | List Databricks Runtime versions (spark_version keys) available for new clusters. |
150
+ | `list_node_types` | ✓ | List instance types (node_type_id values) available in this workspace. |
151
+ | `create_cluster` | | Create an all-purpose cluster. This starts billable compute. |
152
+ | `start_cluster` | | Start a terminated cluster. |
153
+ | `restart_cluster` | | Restart a running cluster. Running commands and notebook state are lost. |
154
+ | `resize_cluster` | | Resize a running cluster to a fixed worker count or an autoscale range. |
155
+ | `terminate_cluster` | | Terminate (stop) a cluster. Its config is kept and it can be started again. |
156
+
157
+ **Jobs** (`jobs`)
158
+
159
+ | Tool | Read-only | What it does |
160
+ |---|:---:|---|
161
+ | `list_jobs` | ✓ | List jobs (summary: id, name, creator, created time). |
162
+ | `get_job` | ✓ | Get a job's full settings (tasks, clusters, schedule, parameters). |
163
+ | `list_job_runs` | ✓ | List job runs, newest first. |
164
+ | `get_run` | ✓ | Get a run's details, including per-task state. |
165
+ | `get_run_output` | ✓ | Get a run's output: notebook exit value, logs, error and trace. For a multi-task run, returns each task's output. |
166
+ | `wait_for_run` | ✓ | Poll a run until it finishes or the timeout passes. Returns its final state. |
167
+ | `run_job` | | Trigger a run of an existing job. Returns run_id. |
168
+ | `submit_run` | | Submit a one-time run without creating a job. Returns run_id. |
169
+ | `cancel_run` | | Cancel an active run. |
170
+
171
+ **Workspace / notebooks** (`workspace`)
172
+
173
+ | Tool | Read-only | What it does |
174
+ |---|:---:|---|
175
+ | `list_workspace` | ✓ | List notebooks, files and folders in a workspace directory. |
176
+ | `get_workspace_object` | ✓ | Get metadata (type, language, ids) for a workspace path. |
177
+ | `export_notebook` | ✓ | Export a notebook's contents as text. |
178
+ | `import_notebook` | | Create or (with overwrite=true) replace a notebook. language is required for SOURCE. |
179
+ | `create_workspace_directory` | | Create a workspace folder, including missing parents. |
180
+
181
+ **Unity Catalog volumes (Files API)** (`volumes`)
182
+
183
+ | Tool | Read-only | What it does |
184
+ |---|:---:|---|
185
+ | `list_volume_directory` | ✓ | List files and folders in a Unity Catalog volume directory. |
186
+ | `read_volume_file` | ✓ | Read the start of a text file in a volume (up to max_bytes). |
187
+ | `write_volume_file` | | Write a text file to a volume. Fails if it exists unless overwrite=true. |
188
+ | `delete_volume_file` | | Delete a file from a volume. |
189
+ | `create_volume_directory` | | Create a directory in a volume, including missing parents. |
190
+
191
+ **DBFS (legacy, read-only)** (`dbfs`)
192
+
193
+ | Tool | Read-only | What it does |
194
+ |---|:---:|---|
195
+ | `list_dbfs` | ✓ | List a legacy DBFS path. Prefer volumes for new data. |
196
+ | `read_dbfs_file` | ✓ | Read the start of a text file on legacy DBFS. |
197
+
198
+ **SQL warehouses & queries** (`sql`)
199
+
200
+ | Tool | Read-only | What it does |
201
+ |---|:---:|---|
202
+ | `list_sql_warehouses` | ✓ | List SQL warehouses with their id, state and size. |
203
+ | `get_sql_warehouse` | ✓ | Get one SQL warehouse's full configuration and state. |
204
+ | `start_sql_warehouse` | | Start a stopped SQL warehouse. |
205
+ | `stop_sql_warehouse` | | Stop a SQL warehouse. Running queries on it are cancelled. |
206
+ | `execute_sql` | | Run a SQL statement on a SQL warehouse and return columns + rows. If it outlives timeout_seconds you get a statement_id to poll with get_sql_statement. |
207
+ | `get_sql_statement` | ✓ | Get the state and (if finished) results of a SQL statement. |
208
+ | `cancel_sql_statement` | | Cancel a running SQL statement. |
209
+
210
+ **Unity Catalog** (`unity_catalog`)
211
+
212
+ | Tool | Read-only | What it does |
213
+ |---|:---:|---|
214
+ | `list_catalogs` | ✓ | List Unity Catalog catalogs you can see. |
215
+ | `list_schemas` | ✓ | List schemas in a catalog. |
216
+ | `list_tables` | ✓ | List tables and views in a schema (names and types; use get_table for columns). |
217
+ | `get_table` | ✓ | Get a table's columns, types, comments, format and storage location. |
218
+ | `list_volumes` | ✓ | List Unity Catalog volumes in a schema. |
219
+
220
+ **Run code on a cluster** (`commands`)
221
+
222
+ | Tool | Read-only | What it does |
223
+ |---|:---:|---|
224
+ | `run_command` | | Run one snippet of code on a running cluster and return its result. Creates and destroys a throwaway context; use create_execution_context to keep state between calls. |
225
+ | `create_execution_context` | | Create a stateful execution context on a running cluster. Returns its id. |
226
+ | `execute_command` | | Run code in an existing context; variables persist between calls. |
227
+ | `get_command_status` | ✓ | Get a command's status and, when finished, its results. |
228
+ | `cancel_command` | | Cancel a running command. |
229
+ | `destroy_execution_context` | | Destroy an execution context and free its resources on the cluster. |
230
+
231
+ <!-- tools:end -->
232
+ ## Databricks API versions used
233
+
234
+ | Area | Endpoint |
235
+ |---|---|
236
+ | Jobs | `/api/2.2/jobs/*` (current version; queues runs by default, pages tasks past 100) |
237
+ | Clusters | `/api/2.1/clusters/*` |
238
+ | Unity Catalog | `/api/2.1/unity-catalog/*` |
239
+ | Volumes | Files API `/api/2.0/fs/files`, `/api/2.0/fs/directories` |
240
+ | SQL | `/api/2.0/sql/statements`, `/api/2.0/sql/warehouses` |
241
+ | Workspace | `/api/2.0/workspace/*` |
242
+ | Commands | `/api/1.2/contexts/*`, `/api/1.2/commands/*` (still the current version) |
243
+ | DBFS | `/api/2.0/dbfs/*` (legacy; read-only here) |
244
+
245
+ Files API 3.0 is still in beta. It needs an admin preview toggle and a regional hostname, so the server stays on 2.0 for now.
246
+
247
+ ## Upgrading from 0.1.x
248
+
249
+ 0.2.0 is a rewrite, and several things changed:
250
+
251
+ - **Install and command:** install with `pip install databricks-mcp-toolkit`, then run `databricks-mcp` (or `python -m databricks_mcp`). Clone-and-`pip install -e .` is no longer needed, and the old `start_mcp_server.sh` and `.ps1` scripts are gone.
252
+ - **Tool arguments:** tools now take typed, named arguments. Before, every tool took one opaque `params` object.
253
+ - **Renamed tools:**
254
+ - `list_notebooks` → `list_workspace`
255
+ - `list_files` → `list_dbfs`
256
+ - `submit_single_run` → `submit_run`
257
+ - `wait_for_run_completion` → `wait_for_run`
258
+ - `execute_command_simple` → `run_command`
259
+ - `get_context_status` was removed
260
+ - **MCP SDK:** it now requires `mcp>=2.3`. The 0.1.x code imported `FastMCP`, which doesn't exist in MCP 2.x, so a fresh install of 0.1.x fails to start.
261
+
262
+ ## Development
263
+
264
+ ```bash
265
+ git clone https://github.com/kshptl/Databricks-MCP-Server
266
+ cd Databricks-MCP-Server
267
+ python -m venv .venv && source .venv/bin/activate
268
+ pip install -e ".[dev]"
269
+ pytest # unit tests; HTTP is mocked, so no workspace is needed
270
+ ruff check src tests && ruff format --check src tests
271
+ ```
272
+
273
+ See [CONTRIBUTING.md](CONTRIBUTING.md) and [ARCHITECTURE.md](ARCHITECTURE.md). Releases are covered in [RELEASING.md](RELEASING.md).
274
+
275
+ ## License
276
+
277
+ Dual-licensed:
278
+
279
+ - **[AGPL-3.0-only](LICENSE)** for open-source use. If you run a modified version as a network service, you must offer its source to the service's users.
280
+ - **Commercial license** if the AGPL terms don't fit your use. Open an issue or contact the author through their GitHub profile.
281
+
282
+ This project is not affiliated with or endorsed by Databricks, Inc.
@@ -0,0 +1,21 @@
1
+ databricks_mcp/__init__.py,sha256=jPfz8_GWdn0USujrxFaufygn4KTt58vSDDuMGi4Ong4,308
2
+ databricks_mcp/__main__.py,sha256=dBqv_lxHHG-u5Vf0DJgURddYNr-xFY9k9ea8U1iAEio,291
3
+ databricks_mcp/cli.py,sha256=4KooaHQcqnsrM1bTLbHDOSEJdKt5ysInrJTqnYfZVLU,3863
4
+ databricks_mcp/client.py,sha256=cIrolD4kmSDvUrQYK_6G4gTu8MyuXrtOFnw4_yN6YWE,7379
5
+ databricks_mcp/config.py,sha256=HmXYv7QYKOkV7EBRktEuI5y7SBzlKvYVnc49qTrIJFc,1899
6
+ databricks_mcp/server.py,sha256=rhL5wpH5jTy8zzZsJ71xi0N5pa_2GTcWATmx38XAS_0,27269
7
+ databricks_mcp/api/__init__.py,sha256=ARHHhWrKk62Y1wAAQo0Rv-Ug5IyEz3o-ZGmTs2Hc7sg,640
8
+ databricks_mcp/api/clusters.py,sha256=B7YAZMNdKE1PTU6JIRZ85L7B-85hFs4VTln7sY0V0Es,2689
9
+ databricks_mcp/api/command_execution.py,sha256=u5YukjQ-TTUj88TC9iCwoD9AY3IA8tKbB_vQ-wF6RwY,3406
10
+ databricks_mcp/api/dbfs.py,sha256=Eqiw0nS17eA5CMRoBCk9DhjX7SBM3ffjAwbAikADmeY,1488
11
+ databricks_mcp/api/files.py,sha256=8uFbCIeYE6Tw4NZSRyncSbj-25qnHF9pzU0keHoEXLM,3386
12
+ databricks_mcp/api/jobs.py,sha256=55mkkC3VRRSq8E6_ctYq35Oc7UAeY0OVQnBRbXZZfJw,5143
13
+ databricks_mcp/api/sql.py,sha256=biqmJa44xnwpngCV03nB5vGEDi5UIVX3rvfZWcSVQgw,3512
14
+ databricks_mcp/api/unity_catalog.py,sha256=H4pTQjJ0q-abXKTyrEzofU3BSrH-XyCO3evnKGZVjEs,2204
15
+ databricks_mcp/api/warehouses.py,sha256=LGgJfyebuNlrSuhHQ3rgrC2GvB3XJ1k8uW2cuQlrhLA,1075
16
+ databricks_mcp/api/workspace.py,sha256=gVUpoXOSixvN3frE4MIZCvihDHEuTEJE68483kxrgsg,2298
17
+ databricks_mcp_toolkit-0.2.0.dist-info/METADATA,sha256=XcTkdNndJf3hK9NDt1gfLX0jPStEDidIqhdNyeV_Y3A,14111
18
+ databricks_mcp_toolkit-0.2.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
19
+ databricks_mcp_toolkit-0.2.0.dist-info/entry_points.txt,sha256=J1Ofzc4HRj1EZlJ3A4jjSPwqGt1G55BffLqb5lB2J3s,59
20
+ databricks_mcp_toolkit-0.2.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
21
+ databricks_mcp_toolkit-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ databricks-mcp = databricks_mcp.cli:main