Skip to content
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

add text encoding params to STDIO client #120

Merged

Conversation

SecretiveShell
Copy link
Contributor

This PR adds text encoding parameters to the STDIO Client. This allows the SDK user to configure how the text encoder will respond to errors and set the encoding used.

Motivation and Context

Fixes #110

This fixes an issue I was encountering in some of my programs when handling text from the internet.

How Has This Been Tested?

All of the included unit tests are passing with this (via uv run pytest)
Styling was checked via ruff check
I modified the example reproduction in #110 with an implementation of the new features (https://github.com/SecretiveShell/MCP-SDK-JSON-DECODE-ERROR/tree/test-fix)

Breaking Changes

None, all default values remain the same.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

This was discussed in discord, and it was suggested that it would be beneficial to add extra test cases for this specific error. Currently this PR does not include this

@SecretiveShell SecretiveShell changed the base branch from main to v1.1.x December 29, 2024 17:18
Copy link
Member

@dsp-ant dsp-ant left a comment

Choose a reason for hiding this comment

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

Thank you!

@dsp-ant dsp-ant merged commit bd5170e into modelcontextprotocol:v1.1.x Jan 2, 2025
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.

Client side JSON decode error when server does not use UTF-8
2 participants