Skip to main content

MCP

The MCP integration records a governed tool invocation before forwarding the call to your underlying handler. This is useful when you control an MCP server and want an explicit Arclasp decision boundary around selected tool calls.

Install

The current package constraint is mcp>=1.0.0,<2.0.0.

Integration skeleton

The current MCP Python SDK does not expose a universal server-patching hook that Arclasp relies on. Wire governance inside your own call_tool handler.
This is intentionally an integration skeleton. server, read_stream, write_stream, and init_options come from your MCP server and transport setup.

Enforcement boundary

For a call routed through handle_tool_call():
  1. Arclasp records the proposed tool invocation.
  2. The backend evaluates policy.
  3. If the call is allowed, the adapter forwards to your handler.
  4. If the call is denied, the handler is not called.
  5. If approval is required, forwarding waits for the approval result.

Decorator pattern

You can also wrap individual tool implementations:
Use this when you want explicit per-tool governance scope.

What gets recorded

The MCP integration records the governed invocation and policy decision before forwarding to the customer handler. Current limitation: MCP does not provide universal persistence of arbitrary tool return values or execution exceptions as action evidence. Do not describe the MCP adapter as full result capture.

Client identity

If your MCP server knows which client initiated the call, parent_agent_name can be used as additional attribution metadata. This is useful for distinguishing client identities that use the same governed server. It is not a cross-organization tracking mechanism.

Chain lifetime

Choose a Chain lifetime that matches the governed workflow or client session. Avoid treating an indefinitely running MCP server process as one unbounded Chain. Chain runtime and event-count controls exist specifically to prevent runaway workflows.

Errors

Denied calls raise Arclasp policy exceptions in your server code. Convert them into the error shape your MCP client/transport expects. Underlying handler exceptions remain customer-side execution errors after the governance decision has already been recorded.