Loading...

Model Context Protocol (MCP)

Connect Tambo to external tools and services using the MCP standard.

Model Context Protocol (MCP) allows you to give Tambo access to tools defined by other people. Many popular services publish MCP servers, and Tambo provides a simple way to connect to them. This is a quick way to allow your users to conversationally interact with other services without needing to write any of the interaction code yourself.

Connection Types

Tambo supports two ways to connect to MCP servers:

  1. Server-side MCP (recommended) - Configure MCP servers through the Tambo dashboard. Best for shared services, OAuth authentication, and optimal performance.

  2. Client-side MCP - Connect directly from the browser to MCP servers accessible to end users. Best for local servers and user-specific services.

Quick Start

<TamboProvider
  mcpServers={[
    {
      // MCP server configuration
      url: "http://some-mcp-endpoint.com",
      // Optional stable prefix used when multiple MCP servers are configured
      // If omitted, a key is derived from the URL hostname
      serverKey: "external",
      // Optional custom headers, eg.
      // { "Authorization": `Bearer ${token}` } or { "X-Api-Key": "1234567890" }
      customHeaders: {},
      transport: MCPTransport.HTTP, // optional, defaults to HTTP
    },
  ]}
>
  <TamboMcpProvider>
    <App />
  </TamboMcpProvider>
</TamboProvider>

Note: As of @tambo-ai/react@0.65.0, pass mcpServers to TamboProvider instead of TamboMcpProvider.

Tambo always prefixes prompts, resources, and tools with the serverKey to identify which MCP server they come from:

  • Prompts: serverKey:promptName
  • Resources: serverKey:serverSidePrefix:resourceUri (server-side) or serverKey:resourceUri (client-side)
  • Tools: serverKey__toolName

If you don't specify serverKey, Tambo derives one from the server URL (for example, https://mcp.linear.app/mcp becomes linear); see Server namespacing for more details. For predictable behavior across environments, set serverKey explicitly. Avoid : and __ in the serverKey (since prompts/resources use : and tools use __ as separators); prefer letters, numbers, _, and -.