Filters Agents

anthropic_mcp_connector

Executes the Anthropic Messages MCP connector for non-Anthropic backends.

Praxis AI v0.13.0 (alpha) 3 min read
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

FieldTypeRequiredDescription
connectorsobject[]noOperator-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[].idstringyesConnector identifier referenced in requests.
connectors[].server_urlstringyesMCP server URL for this connector.
connectors[].tool_policydeny | allow_all | read_onlynoOperator 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_serversboolnoWhether client mcp_servers URLs that match no connector may be dialed directly. Off by default: unmatched servers are rejected with a 400.
tool_admissionobjectnoOperator metadata admission for MCP tools.
tool_admission.modeadvisory | protectednoAdmission mode (advisory default, or protected).
forward_headersstring[]noTrusted request headers forwarded to configured connectors only.
user_credentialstringnoCallout-credential slot carrying the per-user bearer for connectors.
authorization_assertionstringnoCallout-credential slot carrying an opaque authorization assertion.
outbound_chainstring | objectnoOutbound filter chain every MCP callout runs through.
timeout_msintegernoTimeout for one MCP tools/list or tools/call, in milliseconds.
max_serversintegernoMaximum number of MCP servers one request may declare.
max_toolsintegernoMaximum number of tools accepted from one MCP server.
max_body_bytesintegernoMaximum bytes per request, inference response, or partial Messages SSE event.
max_parallel_callsintegernoMaximum number of MCP calls running at once.
max_result_bytesintegernoMaximum bytes retained for one MCP result.
max_total_result_bytesintegernoMaximum 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