Skip to content
Back to search

mcp

Table of Contents =================

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/databrickslabs--mcp/badge.svg)](/listings/databrickslabs--mcp)

HTML

<a href="/listings/databrickslabs--mcp"><img src="/api/listings/databrickslabs--mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 197 lines
  1. # Databricks MCP servers
  2. ![Test Status](https://github.com/databrickslabs/mcp/actions/workflows/unit_tests.yml/badge.svg)
  3. Table of Contents
  4. =================
  5. - [Databricks MCP servers](#databricks-mcp-servers)
  6. - [Table of Contents](#table-of-contents)
  7. - [Overview](#overview)
  8. - [Unity Catalog Server](#unity-catalog-server)
  9. - [Databricks Managed MCP servers](#databricks-managed-mcp-servers)
  10. - [Overview](#overview-1)
  11. - [Usage (locally via `stdio` transport)](#usage-locally-via-stdio-transport)
  12. - [Supported tools](#supported-tools)
  13. - [Deploying UC MCP server on Databricks Apps](#deploying-uc-mcp-server-on-databricks-apps)
  14. - [Using `databricks bundle` CLI](#using-databricks-bundle-cli)
  15. - [Using `databricks apps` CLI](#using-databricks-apps-cli)
  16. - [Connecting to the UC MCP server deployed on Databricks Apps](#connecting-to-the-uc-mcp-server-deployed-on-databricks-apps)
  17. - [Developer Tools Server](#developer-tools-server)
  18. - [Deploying a custom MCP server on Databricks Apps](#deploying-a-custom-mcp-server-on-databricks-apps)
  19. - [Support](#support)
  20. - [Contributing](#contributing)
  21. ## Databricks Managed MCP servers
  22. Databricks provides ready-to-use MCP servers that let agents query data and access tools in Unity Catalog. Permissions are always enforced, so agents and users can only access the tools and data they’re allowed to. For more info see the Databricks docs [AWS](https://docs.databricks.com/aws/en/generative-ai/agent-framework/mcp#managed-mcp-servers)|[Azure](https://docs.databricks.com/gcp/en/generative-ai/agent-framework/mcp#compute-pricing)|[GCP](https://docs.databricks.com/gcp/en/generative-ai/agent-framework/mcp#managed-mcp-servers).
  23. ## Overview
  24. An experimental collection of [MCP](https://modelcontextprotocol.io/introduction) servers to help AI agents fetch enterprise data from Databricks, automate common developer actions on Databricks, etc:
  25. * ![status: Deprecated](https://img.shields.io/badge/status-Beta-yellow?style=flat-square&logo=databricks)
  26. [Databricks Unity Catalog server](#unity-catalog-server): Fetch data and run tools registered in from Unity Catalog, making agents aware of your enterprise data. Note: this server is deprecated; Databricks recomemnds using [Managed MCP servers](#databricks-managed-mcp-servers) instead
  27. * ![status: Under construction](https://img.shields.io/badge/status-Under_construction-red?style=flat-square&logo=databricks)
  28. [Databricks developer tools server](#developer-tools-server): Perform common developer actions in Databricks, like creating and updating notebooks, running jobs, etc. This server is not yet usable, but contributions are welcome!
  29. Note: if developing from within the Databricks product (e.g. using Databricks notebooks), we recommend using [Databricks Assistant](https://docs.databricks.com/aws/en/notebooks/databricks-assistant-faq)
  30. The set of servers and tools in this repo is fluid and will evolve over time. We welcome contributions to this repo - please first
  31. read the [contributor guidelines](CONTRIBUTING.md) to streamline the process and discover areas where help is needed.
  32. ## Unity Catalog Server
  33. ![status: Beta](https://img.shields.io/badge/status-Beta-yellow?style=flat-square&logo=databricks)
  34. ### Overview
  35. A Model Context Protocol server that exposes structured and unstructured data in Unity Catalog ([vector search indexes](https://docs.databricks.com/gcp/en/generative-ai/vector-search), [functions](https://docs.databricks.com/aws/en/generative-ai/agent-framework/create-custom-tool), and [Genie spaces](https://docs.databricks.com/aws/en/genie/)), as tools.
  36. <img src="docs/images/demo.png" alt="Demo image" height="400px">
  37. ### Usage (locally via `stdio` transport)
  38. 1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
  39. 1. Install Python using `uv python install 3.12`
  40. 1. [Configure Databricks credentials](https://docs.databricks.com/aws/en/dev-tools/cli/authentication) with access to the required APIs
  41. 1. Add the server to your MCP client configuration. For example, to use this server with Claude Desktop, add the following to your `claude_desktop_config.json`:
  42. ```json
  43. {
  44. "mcpServers": {
  45. "databricks_unity_catalog": {
  46. "command": "/path/to/uv/executable/uv",
  47. "args": [
  48. "--directory",
  49. "/path/to/this/repo",
  50. "run",
  51. "unitycatalog-mcp",
  52. "-s",
  53. "your_catalog.your_schema",
  54. "-g",
  55. "genie_space_id_1,genie_space_id_2"
  56. ]
  57. }
  58. }
  59. }
  60. ```
  61. ### Supported tools
  62. The list of tools supported by this server is dynamically inferred at startup time based on the functions and vector search indexes
  63. within the specified Unity Catalog schema, as well as any specified Genie spaces. In particular, the server exposes
  64. the following tools:
  65. * **UC Functions**: for each UC function, the server exposes a tool with the same name, arguments, and return type as the function
  66. * **Vector search indexes**: for each vector search index, the server exposes a tool for querying that vector search index
  67. * **Genie spaces**: for each Genie space, the server exposes tools for managing conversations and sending questions to the space
  68. ### Deploying UC MCP server on Databricks Apps
  69. You can deploy the Unity Catalog MCP server as a Databricks app. To do so, follow the instructions below:
  70. 1. Move into the project directory and build the wheel:
  71. ```bash
  72. cd /path/to/this/repo
  73. uv build --wheel
  74. ```
  75. There are two ways to deploy the server on Databricks Apps: using the `databricks bundle` CLI or using the `databricks apps` CLI. Depending on your preference, you can choose either method.
  76. #### Using `databricks bundle` CLI
  77. To deploy the server using the `databricks bundle` CLI, follow these steps:
  78. 1. Set the env variables for the `schema_full_name` and `genie_space_ids` and run the `bundle deploy` command:
  79. ```bash
  80. BUNDLE_VAR_schema_full_name=catalog.schema BUNDLE_VAR_genie_space_ids=[\"space1\",\"space2\"] \
  81. databricks bundle deploy -p your-profile-name
  82. ```
  83. 2. Deploy the app:
  84. ```bash
  85. BUNDLE_VAR_schema_full_name=catalog.schema BUNDLE_VAR_genie_space_ids=[\"space1\",\"space2\"] \
  86. databricks bundle run mcp-on-apps -p your-profile-name
  87. ```
  88. Please note that `BUNDLE_VAR_genie_space_ids` should be exactly as shown above, with the double quotes escaped, no spaces, and the brackets included.
  89. To connect to your app, use the `Streamable HTTP` transport with the following URL:
  90. ```
  91. https://your-app-url.usually.ends.with.databricksapps.com/api/mcp/
  92. ```
  93. Please note the trailing `/api/mcp/` in the URL. This is required for the server to work correctly,including the trailing slash.
  94. You'll also need to set the `Authorization` header to `Bearer <your_token>` in your client. You can get the token by running the following command:
  95. ```bash
  96. databricks auth token -p your-profile-name
  97. ```
  98. If you are a developer iterating on the server implementation, you can repeat steps #2 and #3 to push your latest modifications to the server to your Databricks app.
  99. Please note that both variables should be provided in both `deploy` and `run` commands. The `schema_full_name` variable is used to determine the schema to use for the server, while the `genie_space_ids` variable is used to determine which Genie spaces to use.
  100. #### Using `databricks apps` CLI
  101. To deploy the server using the `databricks apps` CLI, follow these steps:
  102. 1. Move into the project directory and build the wheel:
  103. ```bash
  104. cd /path/to/this/repo
  105. uv build --wheel
  106. ```
  107. 2. Configure the `app.yml` file in the root of the project directory. You can use the following example as a starting point:
  108. ```yaml
  109. command: ["uvicorn", "databricks.labs.mcp.servers.unity_catalog.app:app"]
  110. env:
  111. - name: SCHEMA_FULL_NAME
  112. value: catalog.schema
  113. - name: GENIE_SPACE_IDS
  114. value: '["space1","space2"]'
  115. ```
  116. 3. Deploy the app using the `databricks apps` CLI:
  117. ```bash
  118. uv build --wheel
  119. databricks sync ./build -p <your-profile-name> /Workspace/Users/my-email@org.com/my-app
  120. databricks apps deploy my-app-name -p <your-profile-name> --source-code-path /Workspace/Users/my-email@org.com/my-app
  121. databricks apps start my-app-name -p <your-profile-name>
  122. ```
  123. ### Connecting to the UC MCP server deployed on Databricks Apps
  124. After the app is deployed, you can connect to it using the `Streamable HTTP` transport in your MCP client, such as Claude Desktop or MCP inspector.
  125. To do this, you need to set the target URL to the URL of your app + `/api/mcp/` postfix. Full URL example:
  126. ```
  127. https://your-app-url.usually.ends.with.databricksapps.com/api/mcp/
  128. ```
  129. **Please note that the URL should end with `/api/mcp/` (including the trailing slash), as this is required for the server to work correctly.**
  130. To connect to the app, you also need to set the `Authorization` header to `Bearer <your_token>`, where `<your_token>` is the token you can get by running the following command:
  131. ```bash
  132. databricks auth token -p your-profile-name
  133. ```
  134. Please note that app service principal should be entitled with necessary permissions to access the Unity Catalog schema and Genie spaces. You can do this by assigning the appropriate permissions to the service principal in Unity Catalog and Genie.
  135. ## Developer Tools Server
  136. This server is currently under construction. It is not yet usable, but contributions are welcome!
  137. ## Deploying a custom MCP server on Databricks Apps
  138. If you would like to deploy a custom MCP server on Databricks Apps, take a look at the reference implementation [here](./examples/custom-server/README.md). It provides a step-by-step guide on how to create a custom MCP server and deploy it on Databricks Apps.
  139. ## Support
  140. Please note that all projects in the `databrickslabs` GitHub organization are provided for your exploration only, and are not formally supported by Databricks with Service Level Agreements (SLAs). They are provided AS-IS and we do not make any guarantees of any kind. Please do not submit a support ticket relating to any issues arising from the use of these projects.
  141. Any issues discovered through the use of this project should be filed as GitHub Issues on the Repo. They will be reviewed as time permits, but there are no formal SLAs for support.
  142. ## Contributing
  143. We welcome contributions :) - see [CONTRIBUTING.md](./CONTRIBUTING.md) for details. Please make sure to read this guide before
  144. submitting pull requests, to ensure your contribution has the best chance of being accepted.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.