Skip to content

Emit logs sent from MCP server to client - #974

Merged
alexmojaki merged 13 commits into
mainfrom
alex/mcp-logging
Apr 10, 2025
Merged

alexmojaki merged 13 commits into
mainfrom
alex/mcp-logging

Conversation

@alexmojaki

Copy link
Copy Markdown
Contributor

No description provided.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 31, 2025 •

Copy link
Copy Markdown

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2f8c4a2
Status: ✅  Deploy successful!
Preview URL: https://91465e37.logfire-docs.pages.dev
Branch Preview URL: https://alex-mcp-logging.logfire-docs.pages.dev

View logs

@alexmojaki
alexmojaki marked this pull request as ready for review April 3, 2025 12:34
@alexmojaki
alexmojaki requested review from Kludex and Copilot April 3, 2025 12:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 logging instrumentation for MCP requests and notifications by wrapping key methods and adjusting import paths.

  • Updated import paths for session and types.
  • Wrapping BaseSession.send_request with additional logging and error handling.
  • Introduced a new wrapper for ClientSession._received_notification to log notification details.

Comment thread logfire/_internal/integrations/mcp.py Resolved
@alexmojaki
alexmojaki enabled auto-merge (squash) April 10, 2025 09:31
@alexmojaki alexmojaki changed the title MCP logging Emit logs sent from MCP server to client Apr 10, 2025
@alexmojaki
alexmojaki merged commit f864e02 into main Apr 10, 2025
@alexmojaki
alexmojaki deleted the alex/mcp-logging branch April 10, 2025 09:33
karwacz pushed a commit to karwacz/logfire that referenced this pull request Apr 12, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants