openllmetry icon indicating copy to clipboard operation
openllmetry copied to clipboard

fix(mcp+anthropic): vanilla mcp crashed due to argument manipulation

Open nirga opened this issue 6 months ago • 0 comments

  • [ ] I have added tests that cover my changes.
  • [ ] If adding a new instrumentation or changing an existing one, I've added screenshots from some observability platform showing the change.
  • [ ] PR name follows conventional commits format: feat(instrumentation): ... or fix(instrumentation): ....
  • [ ] (If applicable) I have updated the documentation accordingly.

[!IMPORTANT] Fixes MCP client crash by adjusting argument handling and adds an MCP-Anthropic integration example.

  • Behavior:
    • Fixes crash in MCP client by modifying traced_method in instrumentation.py to handle arguments correctly.
    • Adds mcp_sonnet_example.py to demonstrate MCP client usage with Anthropic integration.
  • Serialization:
    • Introduces JSONEncoder in utils.py to handle objects with to_json or model_dump_json methods.
  • Dependencies:
    • Updates pyproject.toml to include mcp version ^1.7.1.

This description was created by Ellipsis for f09f9588b5e7b7384e69f61d69fd6b92fe050dd8. You can customize this summary. It will automatically update as commits are pushed.

nirga avatar May 04 '25 20:05 nirga