Skip to main content
Beta: This feature is in beta. The API schema may change as we iterate on the design.
MCP (Model Context Protocol) is an open standard that enables AI agents to interact with external tools and services. By passing MCP server configurations in your converse requests, you can extend the agent’s capabilities with custom tools. MCP servers are configured per-request. The agent will discover available tools from each server and use them as needed to complete the user’s request.
For custom MCP usage, prefer Execute mode (chat_mode: "full_agent"). Other modes may limit or skip tool execution depending on routing/model behavior.

Basic Usage

Configuration Options

Multiple Servers

You can connect multiple MCP servers in a single request. Each server’s tools will be available to the agent:

How It Works

When you pass an MCP server in a converse request, Datagrid handles the full MCP lifecycle automatically:
  1. Initialization: Datagrid sends initialize to negotiate protocol version and capabilities, then confirms with notifications/initialized
  2. Tool Discovery: Datagrid calls tools/list to discover available tools, with MCP-Session-Id and MCP-Protocol-Version headers
  3. Tool Execution: When the agent decides to use a tool, Datagrid calls tools/call with the appropriate parameters and session headers
  4. Session Recovery: If a session expires, Datagrid automatically re-initializes and retries the request
  5. Credential Isolation: Authorization values are scoped per server and never shared between servers
References:

Security

  • HTTPS Required: All MCP server URLs must use HTTPS
  • SSRF Protection: Requests to private IP addresses, localhost, and internal domains are blocked
  • Credential Isolation: Authorization tokens are isolated per-server and never shared between servers
  • Ephemeral: Server configurations are not persisted - they only exist for the duration of the request

Building MCP Servers

To create an MCP server compatible with Datagrid, implement the Model Context Protocol specification using streamable HTTP transport. Your server must handle the following methods:
  • initialize - Negotiates protocol version and capabilities. Return MCP-Session-Id in the response header.
  • notifications/initialized - Accepts the initialization completion notification
  • tools/list - Returns available tools and their JSON Schema definitions
  • tools/call - Executes a tool and returns the result
All requests after initialize will include MCP-Session-Id and MCP-Protocol-Version headers.
Frameworks like FastMCP and the official MCP SDK handle initialize, session management, and transport automatically. See Build an MCP Server to get started.