Skip to content

fix: sanitize malformed Unicode in MCP responses#1448

Closed
frankhommers wants to merge 1 commit intomicrosoft:mainfrom
frankhommers:fix-unicode-mcp-responses
Closed

fix: sanitize malformed Unicode in MCP responses#1448
frankhommers wants to merge 1 commit intomicrosoft:mainfrom
frankhommers:fix-unicode-mcp-responses

Conversation

@frankhommers
Copy link
Copy Markdown

Summary

  • sanitize malformed Unicode just before MCP transport sends responses over stdio, SSE, and streamable HTTP
  • preserve non-plain values that already serialize correctly while repairing lone surrogate text content
  • add regression coverage for malformed Unicode transport output and non-plain value preservation

Testing

  • npx playwright test tests/unicode-serialization.spec.ts
  • node packages/playwright-mcp/cli.js --help

Closes #1447

@frankhommers
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@pavelfeldman
Copy link
Copy Markdown
Member

That's a very random place for a fix.

@frankhommers
Copy link
Copy Markdown
Author

@pavelfeldman Fair enough! Could you point me in the right direction for where this fix should live instead? Happy to reopen in the correct place once I know where that would be.

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.

Fix malformed Unicode in outgoing MCP responses

2 participants