Repository navigation
feat(mcp): log one line per MCP tool call with runtime and tool-call counts - #37
Merged
Merged
Conversation
…counts execute, invoke, execute_action, search_<integration> and resume now emit one "executor mcp tool call" info line when they finish, with the tool, the runtime that ran it (dynamic-worker, quickjs, sandbox, direct, or none), the MCP client name/version, the number of connected tool calls, whether an execute only did discovery, the code length, the duration, and the outcome. It never logs arguments, code, results, or secrets. The Cloudflare host reports dynamic-worker or quickjs, matching the code executor it picks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes for users
Nothing visible. Operators get one log line per MCP tool call in Workers Observability:
executor mcp tool call. Today there is no per-execution signal there, so we cannot tell which calls create billed Dynamic Workers, from which client, or whether anexecuteonly did discovery.Fields
tool(execute, invoke, execute_action, search_namespace, resume),runtime(direct, dynamic-worker, quickjs, none),mode(passthrough, code),client(MCP clientInfo name/version),toolCalls(connected tool calls),discoveryOnly(an ok execute that called no connected tool),codeLength,durationMs,outcome(ok, tool_error, error, paused). Arguments, code, results and secrets are never logged.apps/host-cloudflarereportsdynamic-workerwhen theLOADERbinding exists andquickjsotherwise, using the same check that picks the code executor.Tests
tool-call-log.test.ts(7): invoke logsruntime: directwith no arguments or results; failed ToolResult logstool_error; discovery-only execute; connected tool-call counting without logging code; failed/thrown/paused outcomes; resume; engine failure. mcp 264/264, host-cloudflare 156/156.Stacked on #36.