MCP
July 2, 2026 ยท View on GitHub
Otari lets /v1/chat/completions, /v1/messages, and /v1/responses use
tools exposed by MCP servers.
Add MCP as a top-level request field, not a tools entry.
Use either or both of:
mcp_servers: inline MCP server configs the gateway should connect to directlymcp_server_ids: workspace-scoped MCP server ids resolved through otari.ai (hybrid mode only)
In hybrid mode, Otari resolves mcp_server_ids first and appends the resulting
server configs to any inline mcp_servers.
When the model emits an MCP tool call, Otari:
- executes it
- appends the tool result to the conversation
- calls the model again
The loop stops when the model returns a normal assistant response or hits
max_tool_iterations.
Inline MCP servers
{
"model": "anthropic:claude-sonnet-4-6",
"messages": [{"role": "user", "content": "List open issues in mozilla-ai/otari"}],
"mcp_servers": [
{
"name": "github",
"url": "https://mcp.example.com/github",
"authorization_token": "ghp_...",
"purpose_hint": "Use for repository and issue lookups",
"allowed_tools": ["list_issues", "get_issue"]
}
]
}
name: label for the serverurl: streamable HTTP MCP endpoint, reachable from the gatewayauthorization_token: optional bearer token; when set, theurlmust usehttps://purpose_hint: optional hint Otari prepends to the system message to help the model choose the toolallowed_tools: optional allow-list; only these tools are exposed from that server
Workspace-scoped servers (hybrid only)
In hybrid mode, you can reference servers stored in otari.ai by id instead of inlining their configs:
{
"model": "anthropic:claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Summarize the open PRs"}],
"mcp_server_ids": ["11111111-1111-1111-1111-111111111111"]
}
Otari resolves those ids through the platform before the request runs. In
standalone mode, mcp_server_ids returns 400.
Limits and safety
mcp_serversandmcp_server_idscannot be combined withotari_code_executionorotari_web_searchin the same request yetmax_tool_iterationsoptionally caps the loop; default is10, max is25- MCP URLs are validated to reduce SSRF risk; by default, private and reserved addresses are blocked, loopback is allowed, and
http://is rejected whenauthorization_tokenis present OTARI_MCP_ALLOW_LOOPBACK=falsedisables loopback;OTARI_MCP_ALLOW_PRIVATE_HOSTS=truerelaxes the private-host restriction
For the hybrid platform contract behind mcp_server_ids, see
Hybrid-mode protocol.