Skip to main content

How do I connect a custom AI agent to internal APIs and business systems?

Summary

  • On Databricks you connect agents to internal APIs and business systems through governed tools — and the recommended path is the Model Context Protocol (MCP), the open standard that connects agents to tools, resources, and prompts.
  • Wrap internal logic and APIs as Unity Catalog functions and expose them to your agent as tools — including SQL functions that call external services — so every tool is defined, versioned, and governed in one catalog.
  • Connect to third-party systems with managed OAuth MCP connectors for services like GitHub, Atlassian, Slack, Google Drive, and Google Calendar — Databricks manages the OAuth flow and token refresh, so agents never see credentials.
  • Every tool call flows through the Unity AI Gateway: it authenticates with the caller's Databricks identity, checks EXECUTE permission in Unity Catalog, proxies the request with managed credentials, and logs every invocation to system tables.
  • Agent Bricks natively supports MCP with automatic tool discovery and works with frameworks like LangGraph, CrewAI, and the OpenAI Agents SDK.

How do I connect a custom AI agent to internal APIs and business systems?

A useful agent has to act — look up a customer record, file a ticket, post a message, call an internal service. On Databricks you give an agent those abilities by connecting it to governed tools, and the recommended way to do that is the Model Context Protocol (MCP), an open standard that connects AI agents to tools, resources, and prompts. Instead of hand-wiring credentials and endpoints into agent code, you register each capability as a governed tool and let the platform handle authentication, permissions, and auditing.

Why Databricks Agent Bricks for connecting agents to your systems

Databricks supports three kinds of MCP servers, so you can reach both internal and external systems through one governed model:

  • Managed MCP servers for Databricks-native sources — Unity Catalog functions, Genie Agents, AI Search, and Databricks SQL — available at a managed URL with no server to run.
  • External systems as governed MCP Services — register a third-party service once and every agent can use it under consistent policy.
  • Custom MCP servers you host as Databricks Apps when you need bespoke logic.

The building blocks for connecting to internal APIs and business systems are:

  • Unity Catalog functions as tools. Wrap internal logic and API calls as Unity Catalog functions and expose them to your agent. This includes SQL functions that call out to external services, so a REST endpoint becomes a governed, versioned tool that any agent can discover and call.
  • Managed OAuth MCP connectors for third-party systems. Connect services such as GitHub, Atlassian, Slack, Google Drive, and Google Calendar through managed connectors. Databricks manages the OAuth handshake and token refresh, so the agent never handles or stores credentials.
  • On-behalf-of authentication. Managed MCP servers support on-behalf-of-user authentication out of the box, so an agent executes with the permissions of the user who invoked it — respecting the access controls already defined in Unity Catalog.
  • Governed and audited through the Unity AI Gateway. Every MCP request follows the same path: it is authenticated with the caller's Databricks identity, checked for EXECUTE permission on the MCP Service in Unity Catalog, proxied to the target system with Databricks-managed credentials, and logged to system tables for monitoring and compliance.
  • Native support in Agent Bricks. Agent Bricks is the platform for building, deploying, and governing tool-calling agents. It natively supports MCP with automatic tool discovery and works with frameworks including LangGraph, CrewAI, and the OpenAI Agents SDK, with role-based access controls applied to models, tools, and connections in one place.

Getting started

  • Define your first tool as a Unity Catalog function that wraps the internal logic or API you want the agent to call. See Create a custom agent tool.
  • Connect it via MCP using the managed MCP server for Unity Catalog functions, following MCPs and agent tools.
  • Add third-party systems with managed OAuth MCP connectors or by registering an external MCP Service, and grant your agent EXECUTE permission in Unity Catalog.
  • Govern and monitor every call through the Unity AI Gateway, and review invocations in system tables. Read Start building AI agents with tool calling for an end-to-end walkthrough.

FAQs

What is the recommended way to give an agent tools on Databricks?

The recommended approach is the Model Context Protocol (MCP), an open standard that connects agents to tools, resources, and prompts. You expose Unity Catalog functions, Genie, AI Search, and Databricks SQL through managed MCP servers, and reach external systems through governed MCP Services.

How do I connect an agent to an internal REST API?

Wrap the API call in a Unity Catalog function and expose it to the agent as a governed tool through MCP. Because the function lives in Unity Catalog, it is versioned, permissioned, and auditable like any other data asset.

How do agents authenticate to third-party services like GitHub or Slack?

Use managed OAuth MCP connectors. Databricks manages the OAuth flow and token refresh, so the agent never sees credentials; each request is proxied through the Unity AI Gateway with Databricks-managed credentials and logged to system tables.

Does the agent run with the user's permissions?

Yes. Managed MCP servers support on-behalf-of-user authentication, so the agent executes with the invoking user's permissions and respects the access controls already defined in Unity Catalog.

Which agent frameworks can use these tools?

Agent Bricks natively supports MCP and works with frameworks including LangGraph, CrewAI, and the OpenAI Agents SDK, with automatic tool discovery and unified governance through Unity Catalog and the Unity AI Gateway.

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