-
Notifications
You must be signed in to change notification settings - Fork 3
Add RPC message logging with privacy-preserving payload preview #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot make the format short, intuitive and less verbose . Assume the user will learn. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated format to be shorter and more intuitive (commit 6be2a4b): Text:
|
|
the text format can inline the first 10kb of the json message payload |
|
@copilot the text format can inline the first 10kb of the json message payload |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Increased text log payload preview to 10KB (commit d46148b). Markdown logs remain at 120 chars for readability. Text format now inlines up to 10,240 bytes of sanitized JSON |
Implements comprehensive logging of all RPC messages (requests/responses) sent and received by the gateway, with privacy preservation, server attribution, and payload previews.
Implementation
New RPC Logger (
internal/logger/rpc_logger.go)mcp-gateway.log) and markdown (gateway.md) formatssanitizeSecrets()to filter tokens, API keys, passwordsIntegration Points
internal/mcp/connection.go: NewSendRequestWithServerID()method logs all backend communicationinternal/server/*.go: Updated callers to pass server ID for attributionLog Format
Text (concise, scannable, up to 10KB payload):
Markdown (inline, intuitive, up to 120 chars payload):
Format Features:
→(outbound),←(inbound)58b**server**err:message(text),⚠️(markdown)Testing
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.