Repository navigation
feat(mcp): add structured analytics logging - #328
Open
nuclearcat wants to merge 1 commit into
Open
nuclearcat wants to merge 1 commit into
nuclearcat wants to merge 1 commit into
Conversation
Record tool outcomes and latency, including pending cancellation after shielded worker execution. Support external file rotation and restore logger configuration through its public API. Assisted-by: OpenAI Codex Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
nuclearcat
force-pushed
the
feat/mcp-analytics-reviewed
branch
from
November 2, 2026 11:29
00ffc84 to
16c7f9b
Compare
This branch has not been deployed
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.
Add newline-delimited JSON analytics for MCP tool usage, outcomes, latency, and server lifecycle events. Analytics go to stderr by default or an append-only file selected with
--log-file, and omit arguments, results, credentials, and exception messages.Replaces #319 following the request to submit a new PR when ready. Addresses all three review comments:
tool_offload()execution is recorded correctly. A protocol-level test cancels the registeredget_nodetool while its worker is blocked.WatchedFileHandlerto reopen externally rotated files on Unix. Test rename-and-replace rotation and document the Windows stop/rotate/restart procedure.setLevel()to invalidate Python's enabled-level cache. Test logging after both normal and exceptional context exits.Validation: the full suite passes (713 tests on Python 3.14 with MCP 1.30.0), including all 11 analytics tests; the four added regression cases fail against the original implementation. Black, isort, and
git diff --checkpass.Assisted-by: OpenAI Codex