Skip to main content

How do I give an AI agent tools using MCP?

Summary

  • To give an AI agent tools with MCP, connect the agent's MCP client to one or more MCP servers. The client discovers tools with tools/list and runs the one the model picks with tools/call.
  • Most of the work is four decisions: which servers to use, which identity the agent authenticates as, which tools to expose, and how calls are governed.
  • Use remote servers over Streamable HTTP for shared agents, because one governed endpoint can serve many clients. Local stdio servers suit single-user prototypes.
  • On Databricks, agents can use Databricks-provided MCPs, register external MCP servers in Unity Gateway, or host custom servers on Databricks Apps, all under Unity Catalog permissions.
  • Start with a read-only tool, confirm the call works, then widen the tool list.

How do I give an AI agent tools using MCP?

You give an agent tools with MCP by pointing its MCP client at a server that exposes them. The client asks the server for its tool list, passes each tool's name, description and input schema to the model, and executes whichever tool the model chooses. You don't write a custom integration per tool: you pick or build a server once, and any MCP-capable agent can use it. The harder questions are identity and scope, meaning which account a tool runs as and which tools the agent is allowed to see.

What is MCP?

The Model Context Protocol is "an open-source standard for connecting AI applications to external systems", which its docs compare to a USB-C port for AI applications (MCP introduction). An MCP host, the agent or AI application, creates one MCP client per server. Servers expose three primitives: tools, which are "executable functions that AI applications can invoke to perform actions", plus resources and prompts. There are two transports. Stdio connects to a server process on the same machine, and Streamable HTTP connects to remote servers that typically serve many clients (MCP architecture).

Steps to connect tools to an agent

Step What you do What to decide
1. Pick servers Use an existing server or build one for your API Managed, third-party or custom
2. Connect Add the server URL to the agent's MCP client Local (stdio) or remote (Streamable HTTP)
3. Authenticate Sign the agent in to the server The user's identity, a service identity, or a shared credential
4. Scope Expose only the tools the agent needs Read-only first, write tools later
5. Test Ask the model to call a read-only tool Check errors and the shape of results
6. Govern Grant access, set limits, log calls Who can call, how often, what gets recorded

Tool descriptions deserve real care. The model picks tools from their names and descriptions, so vague descriptions lead to wrong calls.

How Databricks approaches MCP tools for agents

On Databricks, MCPs live under Unity Gateway > MCPs, and "Databricks-provided and registered MCPs use Unity Catalog permissions" (MCPs overview). You can supply tools three ways.
Databricks-provided MCPs. "You don't need to host or register a server." The Genie One MCP (system.ai.genie_one_mcp) is generally available for natural-language business questions. Others, such as Databricks SQL (system.ai.dbsql), web search and a code sandbox, require an account admin to enable the Unity Gateway beta. Connectors for common external services ask each user to sign in through a login link (Databricks-provided MCPs).
External servers. Register a self-hosted or third-party server that supports Streamable HTTP: open Unity Gateway, select MCPs, click + MCP, choose Connect an existing MCP server, attach an HTTP connection and select the tools to expose. Test it in AI Playground with a tools-enabled model.
Custom servers. Host your own server on Databricks Apps, starting from the MCP Server (Starter) template for Python tools or the MCP Server (OpenAPI) template to turn an existing REST API into MCP tools.
Calling tools from code. For a Python agent, install databricks-mcp, create a DatabricksMCPClient with the server URL and a WorkspaceClient, then call list_tools() and call_tool(). Registered MCPs use https://<workspace-hostname>/ai-gateway/mcp-services/<catalog>.<schema>.<service>. LangGraph agents can use DatabricksMultiServerMCPClient from databricks_langchain, and coding agents connect through the ug CLI.
Identity. A person signing in from an agent uses OAuth U2M and calls the MCP as that user. An unattended agent uses OAuth M2M and calls it as a service principal. For external providers, a connection can share one credential or require each user to authorize their own account (MCP authentication).
Governance. Callers need EXECUTE on the MCP. Tool filtering hides unselected tools from tools/list, and rate limits cap tools/call requests (govern an MCP).

Use cases

  • A data agent that answers business questions through the Genie One MCP, under each user's own permissions.
  • A support agent that reads tickets through a registered third-party server, with its write tools left unexposed.
  • An internal REST API turned into MCP tools with the OpenAPI template, so every team's agents share one governed endpoint.

FAQs

Do I have to build an MCP server to give my agent tools?

Not always. Many services already publish MCP servers, and Databricks provides managed MCPs you don't host. Build one when the tool is your own code or API.

Should the agent call tools as itself or as the user?

Interactive agents usually act as the signed-in user, so existing permissions carry over. Unattended agents run as a service principal with narrowly scoped grants.

How many tools should I expose?

Only what the task needs. A short list of well-described tools reduces wrong calls and limits what a misbehaving agent can do.

Which agent frameworks work with Databricks MCPs?

The Databricks docs show LangGraph, other agent SDKs and a plain model client, plus coding agents through the ug CLI.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.