Skip to content

MCP Auditability

MCP activity is audited as first-class Dagu activity. The MCP route, MCP tools, resource subscriptions, and downstream DAG actions share audit context so operators can connect an AI-tool request with the Dagu changes or run-control actions it caused.

Event Shape

MCP audit entries use the mcp category and include MCP-specific fields when available:

FieldMeaning
sourceProducer surface. MCP requests use mcp.
surfaceAccepted credential surface. MCP API-key requests use mcp.
resultOutcome such as received, started, succeeded, failed, or denied.
correlation_idShared ID that connects MCP attempt events with downstream domain events.
resource_typeAffected resource class such as dag, run, run_logs, or mcp_request.
resource_idAffected resource identifier, such as a DAG name or dagName/dagRunId.
workspaceCanonical workspace used for audit filtering.
credential_idAccepted credential identifier, independent of the user or service-account subject.
credential_typeCredential class such as api_key, session, basic, or none.
mcp_toolMCP tool name, such as dagu_read, dagu_change, or dagu_execute.

Tool Call Events

Each MCP tool call records lifecycle events:

ActionWhen it is written
mcp.tool_call.receivedDagu accepted the MCP tool request.
mcp.tool_call.startedDagu started executing the tool implementation.
mcp.tool_call.succeededThe tool completed successfully.
mcp.tool_call.failedThe tool failed during execution.
mcp.tool_call.deniedThe tool failed because authorization denied the operation.

Successful tool events can include additional outcome details such as dag_run_id, run_uri, applied, and valid.

Request And Subscription Events

Authentication and subscription behavior is also auditable:

ActionMeaning
mcp.request.deniedThe request reached the MCP route but authentication or surface authorization denied it.
mcp.resource.subscribe.succeededA client subscribed to a supported run resource.
mcp.resource.unsubscribe.succeededA client unsubscribed from a resource, or the subscription was already absent.

Correlating With DAG Events

MCP tools call the same internal API service used by the Web UI and REST API. When dagu_change applies a DAG update or dagu_execute starts, enqueues, retries, or stops a run, the downstream DAG audit event keeps the MCP source context.

Filter audit logs by:

  • category=mcp to see MCP tool and subscription events
  • source=mcp to see all activity originating from MCP, including downstream DAG events
  • surface=mcp to see activity accepted through the MCP credential surface
  • mcp_tool=dagu_execute or another tool name for tool-specific investigation
  • correlation_id to connect an MCP attempt with the downstream effects of that attempt

Released under the MIT License.