Beta: This feature is in beta. The API schema may change as we iterate on the design.
What This API Manages
- Teamspace-level MCP server registry
- Tool metadata sync from each MCP server
- Per-agent MCP server mappings
- Auth configuration for registered servers (
authorizationorauthorization_secret_id) and optional per-agent overrides (credential_id)
converse for that agent.
Secret Ownership
- Use
authorizationwhen you want Datagrid to persist the raw Authorization header for this MCP server. Datagrid stores it as a secret and treats that secret as MCP-server-managed. - Use
authorization_secret_idwhen you already have a Datagrid secret and want the MCP server to reference it. That secret remains caller-managed. - When auth is rotated or cleared, Datagrid only auto-deletes secrets that it created from
authorization.
Provisioning Flow
- Create MCP server
- Datagrid auto-syncs tools on create
- Attach MCP servers to an agent via Create agent or Update agent using the
mcp_serversfield - Call
conversewithagent_id
End-to-End Example
Per-Request Credentials
Useconfig.mcp_credentials in the converse request to pass per-request credentials for registered MCP servers. This is useful when different users have their own tokens for the same server.
Keys are registered MCP server IDs. Provide either authorization (a raw Authorization header value) or credential_id (a reference to a stored credential). If both are present, authorization takes precedence.
Authentication Priority
When resolving auth for an MCP server at converse time, Datagrid uses the first available source:- Per-request
authorization(highest) - Per-request
credential_id - Agent mapping
credential_id - Server
authorization_secret_id - Server OAuth token
- No auth
Runtime Lifecycle
When MCP tools are available for a turn, Datagrid handles MCP lifecycle operations automatically:- Initialization:
initializethennotifications/initialized - Tool discovery:
tools/list - Tool execution:
tools/call - Session recovery: automatic re-initialize/retry when sessions expire
MCP-Session-Id and MCP-Protocol-Version.
Security
- MCP server URLs must be HTTPS
- SSRF protection: private IPs, localhost, and internal domains are blocked
- Teamspace isolation is enforced for server and credential references
- Authorization values are isolated per server and never shared across servers
- Per-request credentials are not persisted; scoped to the individual request
Local Development
For local MCP development, expose your local server through an HTTPS tunnel (e.g. ngrok or cloudflared), then register that URL as thebase_url.
Endpoints
MCP Servers Agent MCP mappings- Use
mcp_serversin Create agent or Update agent