Skip to content

Conversation

@killme2008
Copy link
Contributor

@killme2008 killme2008 commented Dec 10, 2025

Signed-off-by: Dennis Zhuang <[email protected]>
Signed-off-by: Dennis Zhuang <[email protected]>
Signed-off-by: Dennis Zhuang <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive audit logging functionality for all MCP tool invocations to support security auditing and compliance requirements. The feature is configurable via environment variable or CLI flag and is enabled by default.

Key Changes:

  • Implemented audit logging functions that capture tool name, parameters (truncated), success/failure status, duration, and error details
  • Added a hook mechanism that wraps the MCP tool manager to intercept all tool calls
  • Extended configuration with audit_enabled boolean parameter (default: true)

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/greptimedb_mcp_server/utils.py Adds audit logging functions: audit_log, _truncate_value, and _format_audit_params for formatting and recording audit entries
src/greptimedb_mcp_server/server.py Implements _install_audit_hook() that wraps the tool manager's call_tool method to log all invocations with timing
src/greptimedb_mcp_server/config.py Adds audit_enabled boolean configuration parameter with CLI and environment variable support
tests/test_server.py Updates test fixture to disable audit logging during tests
src/greptimedb_mcp_server/__init__.py Adds exception handlers for KeyboardInterrupt and asyncio.CancelledError for graceful shutdown
README.md Documents the audit logging feature with examples, log format, and configuration options
pyproject.toml Bumps version from 0.3.1 to 0.4.0 to reflect the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

killme2008 and others added 3 commits December 10, 2025 21:48
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Dennis Zhuang <[email protected]>
Signed-off-by: Dennis Zhuang <[email protected]>
@killme2008 killme2008 merged commit df74731 into main Dec 10, 2025
1 check passed
@killme2008 killme2008 deleted the feature/audit-logs branch December 10, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit log for commands

2 participants