What you will be able to do
- Pick a managed, external or custom MCP server to meet a given application requirement
- Name the URL pattern, permission and OAuth scope each server type needs
- Connect agent code to any MCP server with DatabricksMCPClient, then list and call its tools
Key concept
One MCP interface, three kinds of server — Databricks agents reach tools through the Model Context Protocol. A server can be hosted by Databricks (managed), registered from a third party (external), or built and run by you on Databricks Apps (custom). All three expose the same interface, so the agent code stays the same. What you choose is who runs the server, which URL the agent calls, and which permission controls access.
1.Why an agent connects to MCP servers
Model Context Protocol (MCP) is how a Databricks agent gets its tools: querying data, searching documents and calling outside services. You don't write a separate integration for each tool. The agent connects to a server and uses the tools that server publishes. In the workspace, Unity Gateway > MCPs lists the servers available to you, and it is also where you register or build new ones.
There are three kinds of server, and the difference is who runs it. Managed servers are hosted by Databricks and give access to your own Unity Catalog data and functions. External servers are third-party or self-hosted servers that you register so Unity Gateway can govern them. Custom servers are your own code, running as a Databricks app. To the agent they all look the same. Only three things change: the URL, the authentication, and the permission that decides who may call it.
When you choose a server, you also choose the tool descriptions the model will read. An MCP server publishes each tool's name and description, and the LLM uses that text to decide which tool to call and in what order. For why this matters, see Tool names and descriptions as the LLM's ordering signal. Before you connect a server, read its tool descriptions: unclear descriptions from a server lead to unclear tool choices by the agent.
Checkpoint 1 of 9· Match them up
Match each kind of MCP server to who runs it and what it provides.
Tap a term, then the definition that fits it.
The difference between the three is who runs the server: Databricks runs managed servers, a third party or your own infrastructure runs external servers that you register, and you run custom servers on Databricks Apps. The agent uses the same MCP interface for all three.
“Databricks-managed servers, external MCP servers registered as MCP Services, and custom servers hosted as Databricks apps.”Source: docs.databricks.com
2.Managed MCP servers: governed access to data you already have
A managed server is the right choice when the data or logic already lives in Databricks. That covers Unity Catalog functions, AI Search (Vector Search) indexes, Genie and SQL. Databricks hosts the server and handles authentication, so there is nothing to deploy. Unity Catalog enforces permissions, so an agent can reach only the functions, indexes and tables its caller has been granted.
| Server | Use case | URL pattern | OAuth scope |
|---|---|---|---|
| Genie One | Natural-language analytics across your workspace | https://<workspace-hostname>/ai-gateway/mcp-services/system.ai.genie_one_mcp | ai-gateway |
| Genie Agent | Natural-language analytics scoped to one Genie Agent | https://<workspace-hostname>/api/2.0/mcp/genie/{genie_space_id} | genie |
| AI Search | Retrieval over unstructured documents | https://<workspace-hostname>/api/2.0/mcp/ai-search/{catalog}/{schema}/{index_name} | ai-search |
| Databricks SQL | Developer queries and data engineering | https://<workspace-hostname>/api/2.0/mcp/sql | sql |
| Unity Catalog functions | Predefined SQL logic as tools | https://<workspace-hostname>/api/2.0/mcp/functions/{catalog}/{schema}/{function_name} | unity-catalog |
The Unity Catalog functions server turns functions you have already registered into tools. If you point the URL at a catalog and schema, every function in that schema becomes available as a tool. If you add a function name, only that one function is exposed. Who can run each function is still decided by Unity Catalog grants. You don't build an app or create a connection. The system.ai schema adds ready-made functions such as the code interpreter system.ai.python_exec, which the agent calls through this same server.
The Genie servers are one more example of the managed pattern. For analytics questions, Databricks recommends starting with Genie One rather than having the agent write SQL. Genie resolves business terms through its governed semantic layer, which gives more accurate answers than SQL written against raw tables. Use the Databricks SQL server when you already have the query you want to run. For how multi-agent systems use Genie, see Genie MCP server.
With on-behalf-of-user authentication, the scope does real work. The application must request the OAuth scope that belongs to each managed server it calls: ai-search for AI Search, unity-catalog for functions, genie for a Genie Agent, sql for Databricks SQL. The token then carries the user's identity to the server, and Unity Catalog permissions still apply. That is how each user ends up seeing only their own documents. You don't need an admin token, and you don't switch off Unity Catalog enforcement.
Managed servers accept two kinds of parameters. Tool call arguments are generated by the LLM from the user's request. **_meta parameters** are set in your agent code, so that part of the behaviour is fixed instead of left to the model. Billing follows the feature behind the server. Unity Catalog functions use serverless general compute pricing, Genie Agents use serverless SQL pricing, Databricks SQL uses Databricks SQL pricing, and AI Search uses AI Search pricing.
Checkpoint 2 of 9· Check yourself
A team has registered several governed SQL functions in the Unity Catalog schema main.tools. Their agent should call only main.tools.lookup_customer, and existing Unity Catalog grants should decide who may run it. Which setup fits?
The managed Unity Catalog functions server already turns registered functions into tools, with nothing to deploy, and Unity Catalog grants still control who can run them. Adding the function name to the URL exposes only that function. A URL that stops at the schema exposes every function in main.tools.
“Governed: Unity Catalog enforces permissions, so agents and users access only the tools and data you grant them.”Source: docs.databricks.com
Checkpoint 3 of 9· Exam question
A team is building an agent that must run governed Unity Catalog SQL functions as predefined tools, without standing up any new infrastructure. The workspace already has the functions registered in a catalog and schema, and the team wants Unity Catalog permissions to govern which users can invoke each function. Which approach best satisfies this requirement?
Correct answer: A — Point the agent at the managed MCP endpoint /api/2.0/mcp/functions/{catalog}/{schema}, with EXECUTE grants on each function deciding which users can call it.
- A. Databricks hosts a managed Unity Catalog Functions MCP server at this workspace path. It exposes the functions in a catalog and schema as ready-made tools, so nothing new has to be deployed. Unity Catalog checks EXECUTE on each function for the calling user, so access is governed per function.
- B. A custom MCP server in a Databricks App could expose the functions as tools, and EXECUTE grants could still apply. But it means building, deploying and running a new app and its wrapper code. The team ruled out new infrastructure, and the managed Unity Catalog Functions server already serves these functions without it.
- C. Unity Catalog connections to external MCP servers are meant for servers hosted outside Databricks. Functions already registered in a schema in this workspace are served by the managed server, not through a third-party connection. USE CONNECTION is also granted on the connection as a whole, so it cannot decide which users may invoke each individual function.
- D. Running the functions through the SQL Statement Execution API with one shared service principal means Unity Catalog only ever sees that principal. Every user of the agent gets the same function access, so EXECUTE grants cannot decide which users call each function. The team would also have to hand-build the tool layer that the managed server already provides.
Checkpoint 4 of 9· Exam question
An engineer is configuring an agent to call a Databricks-managed AI Search MCP server using on-behalf-of-user authentication, so that each end user's own permissions determine which documents are retrievable. Which configuration detail is required for this authentication mode to work correctly?
Correct answer: A — Request the ai-search OAuth scope when the user signs in, so the issued token is accepted by the AI Search MCP endpoint and runs under that user's identity.
- A. Correct: managed MCP servers use per-service OAuth scopes for on-behalf-of-user auth, and the AI Search server needs the
ai-searchscope. The resulting token is accepted by that endpoint and acts as the signed-in user. - B. The
unity-catalogscope belongs to the Unity Catalog MCP service and does not authorize calls to the AI Search endpoint. Catalog permissions still apply to the user, but this token would not be accepted by the AI Search server. - C. A token issued to a service principal carries the principal's identity, not each end user's. Results would reflect what that one principal can read, so individual users' permissions would not decide which documents are retrievable.
- D. The
sqlscope covers the SQL MCP service and does not authorize calls to the AI Search MCP endpoint. A user-scoped token with the wrong service scope would not work against the AI Search server.
3.External MCP servers: governing third-party tools through Unity Gateway
Use an external server when the tool lives outside Databricks, such as Slack, GitHub, Jira or an MCP server your platform team runs. Databricks already provides several of these as built-in system.ai services, including system.ai.slack, system.ai.github, system.ai.atlassian, system.ai.google_drive, system.ai.gmail and system.ai.microsoft_365. You don't host or register anything for these. If a tool asks you to sign in, you authorize your provider account through the login link it returns and then retry the call.
If no built-in service exists, you register the server yourself. In Unity Gateway > MCPs, choose + MCP, then Connect an existing MCP server. Pick a catalog and schema, enter a name, and attach a Unity Catalog HTTP connection that holds the server URL and credentials, using managed OAuth where the provider supports it. The server must support Streamable HTTP. Registering it requires CREATE SERVICE on the schema, plus either CREATE CONNECTION on the schema or USE CONNECTION on an existing connection.
After registration, the server is a Unity Catalog securable like any other. Calling it requires EXECUTE on the service, and Unity Gateway checks that permission on every call. Policies can also restrict individual tools. This governance is the reason to register a third-party server rather than call it directly from the agent. One team registers it once, and everyone else gets audited, permissioned access at /ai-gateway/mcp-services/<catalog>.<schema>.<service>.
Networking is the usual cause of a failure after registration. Calls to external MCP providers go out from the workspace's serverless compute plane. If the serverless network policy uses Restricted access, you must add the server's fully qualified domain name to Allowed domains. Creating the connection doesn't open that route. Built-in services have their own requirements too. By default, system.ai.github can reach only public repositories until a GitHub organization admin installs the Databricks connector app.
Checkpoint 5 of 9· Check yourself
Your platform team registered its self-hosted MCP server in Unity Gateway. They attached a Unity Catalog HTTP connection, and callers have EXECUTE on the service. The workspace's serverless network policy uses Restricted access, and agent calls to the server still fail. What fixes this?
Calls to external MCP servers go out from the workspace's serverless compute plane. Under Restricted access, the server's domain has to be on the Allowed domains list. Having a Unity Catalog connection does not open that route.
“If your serverless network policy uses Restricted access, add the server's fully qualified domain name (FQDN) to Allowed domains.”Source: docs.databricks.com
4.Custom MCP servers: hosting your own tools on Databricks Apps
A custom server is the answer when the tool logic is your own and no managed service matches it. One example is proprietary Python that scores leads. Another is an internal HTTP API. Databricks Apps runs the server and gives it an HTTPS URL, so the code stays on Databricks-managed infrastructure without you running a server yourself.
There are three ways to start, depending on what you have:
- MCP Server (Starter) template: write new Python tools. It comes with a working
healthtool, and you add more as decorated functions inserver/tools.py. - MCP Server (OpenAPI) template: expose an existing REST API. You upload an OpenAPI 3.x
spec.jsonto a volume and setUC_CONNECTION_NAMEinapp.yamlto an HTTP connection that holds the API's credentials. - Custom app: deploy MCP server code you already have. It must use Streamable HTTP, listen on
0.0.0.0and the port inDATABRICKS_APP_PORT(default 8000), and include anapp.yamlstart command.
Give the app a name that starts with mcp-, such as mcp-my-server. The prefix lets AI Playground recognize the app as an MCP server. The agent connects to the app URL with the MCP path added: /mcp for both templates, or the path your own server is configured with. When you add or change a tool, sync the code and redeploy. The agent then has to reconnect to load the updated tool list.
Access is controlled by Apps permissions, not Unity Catalog grants on a service. A caller needs CAN USE on the app. With the OpenAPI template, a caller also needs USE CONNECTION on the HTTP connection behind it. Authentication is OAuth only. You can use a personal access token for local tests against managed and registered servers, but an app-hosted server rejects it.
Checkpoint 6 of 9· Check yourself
While testing locally, a developer sends a personal access token to their lead-scoring MCP server, which is hosted as a Databricks app. The same token works against managed servers, but the app rejects the request. What must change?
App-hosted MCP servers accept only OAuth, so a personal access token is rejected even though managed and registered servers accept one for testing. Access to a custom server is controlled by Apps permissions, so the caller also needs CAN USE on the app. Unity Catalog EXECUTE grants don't apply here.
“Servers hosted on Databricks Apps require OAuth and do not accept personal access tokens.”Source: docs.databricks.com
Checkpoint 7 of 9· Exam question
A team has built proprietary tool logic in Python that doesn't correspond to any Databricks-managed service, and they want to expose it to their agent as an MCP server while keeping it inside Databricks-managed infrastructure with access controlled through existing permission mechanisms. Which deployment approach fits this requirement?
Correct answer: A — Package the tool logic as a Databricks App serving MCP over streamable HTTP, deploy it with the Databricks CLI, and connect the agent to the app's /mcp endpoint, governed by Databricks Apps permissions.
- A. Custom MCP servers are hosted as Databricks Apps. The app implements an HTTP-compatible MCP transport such as streamable HTTP, is deployed with the Databricks CLI, and is served at its
/mcppath. The team's own logic therefore runs on Databricks-managed infrastructure, with access controlled through Databricks Apps permissions. - B. A Unity Catalog connection only registers an MCP server that is already running somewhere else, so Databricks can reach it. It does not host the team's Python package. The logic would stay outside Databricks-managed infrastructure, and the connection privileges would govern access to the link, not to the hosted tool code.
- C. The managed Unity Catalog Functions MCP server is a Databricks-provided service that exposes functions registered in a catalog as tools. It does not run a team's own MCP server. Proprietary Python tool logic cannot simply be ported into a SQL function, and the scenario says the logic matches no managed service.
- D. The managed Databricks SQL MCP server runs queries against Unity Catalog data. Pointing it at a table of job output gives the agent precomputed rows, not the tool logic exposed as an MCP server. The agent could not call the logic on demand, and no custom server would be running inside Databricks.
Sources7
5.Choosing between managed, external and custom
Choose based on where the capability already exists. If Databricks already provides it, use the managed server: you get governance with no infrastructure. If a third party provides it, use a built-in or registered MCP Service. Build a custom app only for logic that exists nowhere else. Building a custom app to wrap something a managed server already covers adds a deployment you have to run and loses the Unity Catalog governance you would otherwise get for free.
| Server type | URL pattern | Who may call it |
|---|---|---|
| Managed | https://<workspace-hostname>/api/2.0/mcp/<service>/<path> | Unity Catalog permissions on the underlying function, index, space or warehouse |
| External (MCP Service) | https://<workspace-hostname>/ai-gateway/mcp-services/<catalog>.<schema>.<mcp-service> | EXECUTE on the service, enforced on every call |
| Custom | https://<app-url>/mcp | CAN USE on the Databricks app |
Checkpoint 8 of 9· Match them up
A support agent needs three tools. For each one, pick the server and the permission that decides who may call it.
Tap a term, then the definition that fits it.
Pick the server by where the capability already exists. Logic registered in Unity Catalog goes through the managed server, which Unity Catalog permissions govern. Jira is third-party, so it goes through an MCP Service, where EXECUTE is checked on every call. Proprietary logic that exists nowhere else runs as a custom Databricks app, which needs CAN USE on the app.
“For an external MCP Service, the caller must also have EXECUTE on the service. AI Gateway enforces this permission on every call.”Source: docs.databricks.com
Sources1
6.Wiring an MCP server into agent code
The databricks-mcp library handles authentication to Databricks MCP servers, so one client works for all three server types. You create a DatabricksMCPClient with a server URL and an authenticated WorkspaceClient. Then you call list_tools() to see what the server publishes and call_tool() to run one.
from databricks_mcp import DatabricksMCPClient
from databricks.sdk import WorkspaceClient
workspace_client = WorkspaceClient(profile="DEFAULT")
host = workspace_client.config.host
# Use a managed, MCP Service, or custom server URL:
mcp_server_url = f"{host}/api/2.0/mcp/functions/system/ai"
mcp_client = DatabricksMCPClient(server_url=mcp_server_url, workspace_client=workspace_client)
tools = mcp_client.list_tools()
print(f"Available tools: {[t.name for t in tools]}")Find tool names by asking the server, not by memory. list_tools() returns each tool's name, description and input schema at runtime. That is the dependable way to learn the exact arguments, and it is also where you read the descriptions the model will see. In the example, the tool comes back as system__ai__python_exec, and it runs with mcp_client.call_tool("system__ai__python_exec", {"code": "print('Hello, world!')"}). Managed system.ai tools only run if serverless compute is enabled in the workspace.
Pick the authentication that matches where the agent runs:
- Local environment: use a Databricks CLI OAuth profile, as in the example above.
- Service principal: give the
WorkspaceClientthe service principal's client ID and secret, ideally read from Databricks secrets. Use this for unattended agents, and declare the server's resource when you log the agent. - On-behalf-of-user: use
ModelServingUserCredentials. Log the agent with theappsscope plus each managed server's scope, or withai-gatewayfor an MCP Service, where the user also needsEXECUTE.
from databricks.sdk.credentials_provider import ModelServingUserCredentials
workspace_client = WorkspaceClient(credentials_strategy=ModelServingUserCredentials())
mcp_client = DatabricksMCPClient(server_url=mcp_server_url, workspace_client=workspace_client)Agent frameworks wrap the same connection. With LangGraph, DatabricksMultiServerMCPClient takes a list of DatabricksMCPServer entries, each with its own name and URL. get_tools() then collects tools from all of those servers, and you pass them to create_react_agent. The OpenAI Agents SDK does the same with McpServer from databricks_openai.agents. Either way, a single agent can combine a managed Genie server, a registered GitHub service and your custom app.
Checkpoint 9 of 9· Fill the gap
This agent code connects to a Databricks MCP server and should find out at runtime which tools the server publishes, with their names, descriptions and input schemas. Which method completes it?
from databricks_mcp import DatabricksMCPClient
from databricks.sdk import WorkspaceClient
workspace_client = WorkspaceClient(profile="DEFAULT")
host = workspace_client.config.host
# Use a managed, MCP Service, or custom server URL:
mcp_server_url = f"{host}/api/2.0/mcp/functions/system/ai"
mcp_client = DatabricksMCPClient(server_url=mcp_server_url, workspace_client=workspace_client)
tools = mcp_client. ? ()
print(f"Available tools: {[t.name for t in tools]}")On a DatabricksMCPClient, list_tools() returns each tool's name, description and input schema at runtime, so you learn exact tool names instead of hardcoding them. get_tools() belongs to LangGraph's DatabricksMultiServerMCPClient, and call_tool() runs a tool whose name you already know.
Source: docs.databricks.comSources2
Practise it for real
Connect a Python agent environment to a managed MCP server, discover its tools and call one
1.Run
databricks auth login --host https://<workspace-hostname>and keep the DEFAULT profile name.Why: DatabricksMCPClient authenticates through a WorkspaceClient built from this profile.
You should see: A saved OAuth profile you can pass to WorkspaceClient(profile="DEFAULT").
2.Install the client libraries with
pip install -U "mcp>=1.9" "databricks-sdk[openai]" "mlflow>=3.1.0" "databricks-agents>=1.0.0" "databricks-mcp"on Python 3.12 or above.Why: The databricks-mcp library provides the client that handles authentication to every server type.
You should see: The packages install without errors.
3.Run the listing snippet against
{host}/api/2.0/mcp/functions/system/ai.Why: list_tools() is the reliable way to learn a server's exact tool names and input schemas.
You should see: The output includes system__ai__python_exec.
4.Call
mcp_client.call_tool("system__ai__python_exec", {"code": "print('Hello, world!')"})and printresult.content.Why: This confirms authentication and tool invocation from start to finish.
You should see: The content contains Hello, world! If it fails, check that serverless compute is enabled in the workspace.
Stuck? Get a nudge
To try a custom or MCP Service server next, change only mcp_server_url. The rest of the code stays the same.
Sources
(8)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://docs.databricks.com/aws/en/agents/mcp-toolsOfficial docs
“Model Context Protocol (MCP) lets your agent query data, search documents, and call external services.”
↩︎ Why an agent connects to MCP servers“Use a Databricks-provided MCP, register an existing server, or build your own.”
↩︎ Choosing between managed, external and custom - 2.
“What differs is the server URL and how you authenticate.”
↩︎ Why an agent connects to MCP servers“For an external MCP Service, the caller must also have EXECUTE on the service.”
↩︎ External MCP servers: governing third-party tools through Unity Gateway“Do not hardcode server names, tool names, or argument shapes from memory; confirm them from the workspace.”
↩︎ Wiring an MCP server into agent code“Use ModelServingUserCredentials so the agent acts with the calling user's permissions.”
↩︎ Wiring an MCP server into agent code“All of them expose the same MCP interface, so the agent code is the same.”
↩︎ Key concept“Databricks-managed servers, external MCP servers registered as MCP Services, and custom servers hosted as Databricks apps.”
↩︎ Checkpoint“For an external MCP Service, the caller must also have EXECUTE on the service. AI Gateway enforces this permission on every call.”
↩︎ Checkpoint - 3.
“No setup: Databricks hosts the servers and manages authentication.”
↩︎ Managed MCP servers: governed access to data you already have“_meta parameters: Configuration parameters that you can preset in your agent code to set behavior deterministically”
↩︎ Managed MCP servers: governed access to data you already have“Governed: Unity Catalog enforces permissions, so agents and users access only the tools and data you grant them.”
↩︎ Exam trap 1“include the corresponding OAuth scope for each server your application needs to access”
↩︎ Exam trap 2“include the corresponding OAuth scope for each server your application needs to access”
↩︎ Prediction“Governed: Unity Catalog enforces permissions, so agents and users access only the tools and data you grant them.”
↩︎ Checkpoint - 4.
“Legacy workspace endpoints bypass Unity Gateway.”
↩︎ Managed MCP servers: governed access to data you already have - 5.
“Use a built-in system.ai MCP Service (Slack, GitHub, Google Drive, Google Calendar, Gmail) or register your own external MCP server.”
↩︎ External MCP servers: governing third-party tools through Unity Gateway - 6.
“Register a self-hosted or third-party MCP server so your team can use it through Unity Gateway. Create its connection as part of registration.”
↩︎ External MCP servers: governing third-party tools through Unity Gateway - 7.
“Databricks Apps provides the compute to run the server and an HTTPS URL for agents to connect to it.”
↩︎ Custom MCP servers: hosting your own tools on Databricks Apps“Callers need CAN USE on the app.”
↩︎ Custom MCP servers: hosting your own tools on Databricks Apps“Listen on 0.0.0.0 and the port in DATABRICKS_APP_PORT (default 8000).”
↩︎ Custom MCP servers: hosting your own tools on Databricks Apps
Also cited
“A Unity Catalog connection does not automatically allow its destination.”
↩︎ Exam trap 3“Servers hosted on Databricks Apps require OAuth and do not accept personal access tokens.”
↩︎ Exam trap 4“If your serverless network policy uses Restricted access, add the server's fully qualified domain name (FQDN) to Allowed domains.”
↩︎ Checkpoint“Servers hosted on Databricks Apps require OAuth and do not accept personal access tokens.”
↩︎ Checkpoint