Filters Agents
anthropic_mcp_connector
Executes the Anthropic Messages MCP connector for non-Anthropic backends.
On this page
Executes the Anthropic Messages MCP connector for non-Anthropic backends.
Configuration Notes
Place it first in the inference step of an iterative_request_router, so it rewrites the request before any translation and sees the response after translation back to Anthropic Messages.
On the first round it validates mcp_servers and mcp_toolset tools, lists each server’s tools, keeps the ones the toolset enables, and replaces the connector with plain custom tools named {server}__{tool}. Replayed mcp_tool_use / mcp_tool_result history becomes ordinary tool turns. When the model calls MCP tools, the filter runs them and loops; the final response carries mcp_tool_use / mcp_tool_result blocks for every call.
A client server is matched to an operator connector by URL. Unmatched URLs are rejected unless allow_client_servers is set. With stream: true, model blocks stream as they arrive. Executed calls produce mcp_tool_result blocks and the client receives one message lifecycle with usage summed across inference rounds.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
connectors | object[] | no | Operator-configured MCP servers. A client mcp_servers entry whose url equals a connector’s server_url is executed through that connector, with operator identity and tool policy. |
connectors[].id | string | yes | Connector identifier referenced in requests. |
connectors[].server_url | string | yes | MCP server URL for this connector. |
connectors[].tool_policy | deny | allow_all | read_only | no | Operator policy for tools from this connector. Defaults to deny and is enforced in protected mode: allow_all admits every tool, while read_only admits only tools the service affirmatively classifies as read-only. This classification does not itself prevent side effects; enforce write restrictions at the service or with scoped credentials. |
allow_client_servers | bool | no | Whether client mcp_servers URLs that match no connector may be dialed directly. Off by default: unmatched servers are rejected with a 400. |
tool_admission | object | no | Operator metadata admission for MCP tools. |
tool_admission.mode | advisory | protected | no | Admission mode (advisory default, or protected). |
forward_headers | string[] | no | Trusted request headers forwarded to configured connectors only. |
user_credential | string | no | Callout-credential slot carrying the per-user bearer for connectors. |
authorization_assertion | string | no | Callout-credential slot carrying an opaque authorization assertion. |
outbound_chain | string | object | no | Outbound filter chain every MCP callout runs through. |
timeout_ms | integer | no | Timeout for one MCP tools/list or tools/call, in milliseconds. |
max_servers | integer | no | Maximum number of MCP servers one request may declare. |
max_tools | integer | no | Maximum number of tools accepted from one MCP server. |
max_body_bytes | integer | no | Maximum bytes per request, inference response, or partial Messages SSE event. |
max_parallel_calls | integer | no | Maximum number of MCP calls running at once. |
max_result_bytes | integer | no | Maximum bytes retained for one MCP result. |
max_total_result_bytes | integer | no | Maximum bytes retained for all results of one model round. |
Examples
Example 1
filter: anthropic_mcp_connector
connectors:
- id: weather
server_url: https://weather-mcp.example.com/mcp
tool_policy: allow_all
Example 2
filter: anthropic_mcp_connector
connectors:
- id: weather
server_url: https://weather-mcp.example.com/mcp
tool_policy: read_only
allow_client_servers: false
tool_admission:
mode: protected
forward_headers:
- x-tenant-id
timeout_ms: 30000
max_servers: 10
max_tools: 128
max_body_bytes: 16777216
max_parallel_calls: 8
max_result_bytes: 1048576
max_total_result_bytes: 8388608