Skip to content

add text encoding params to STDIO client - #120

Merged
dsp-ant merged 2 commits into
modelcontextprotocol:v1.1.xfrom
SecretiveShell:fix-encoding-errors
Jan 2, 2025
Merged

dsp-ant merged 2 commits into
modelcontextprotocol:v1.1.xfrom
SecretiveShell:fix-encoding-errors

Conversation

@SecretiveShell

Copy link
Copy Markdown
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

@dsp-ant dsp-ant left a comment

Copy link
Copy Markdown
Member

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