Skip to main content

Module audit

Module audit 

Source
Expand description

Per-tool audit for external MCP servers served over the HTTP gateway.

A client-mediated tools/call to an external provider has no backend process to record it, so the gateway taps the forwarded request/response, writes one mcp_tool_executions row under the calling user, and hands the result to the artifact ingest. The execution id is minted before the response leaves, and stamped into its _meta, so the client’s own later report of the same result carries the exact server key. record composes the tap over the upstream body; the tap owns an McpAudit and finalizes it (once) on stream EOF or drop.

The newest unclaimed intent for the tool in the calling session is claimed to pair the execution, mirroring systemprompt_mcp::McpToolExecutor. A claim makes the pairing inferred, never exact; failing to claim leaves the execution unpaired rather than failing the call, which has already returned to the client.

Copyright (c) systemprompt.io — Business Source License 1.1. See https://systemprompt.io for licensing details.

Modules§

jsonrpc
Minimal JSON-RPC / MCP frame parsing for the tool-call audit tap.
tap
Observe-while-forwarding tap that captures an external MCP tool-call result and stamps the execution id into it.

Structs§

McpAudit