Skip to content

fix: resolve MCP array serialization schema issue #207

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shadowyman
Copy link

  • Remove transform functions from array schemas in common.ts and issues.ts
  • Add JSON string parsing logic to handlers before schema validation
  • Preserve backward compatibility by accepting both arrays and JSON strings

This fixes the issue where MCP clients receive incomplete schemas that don't include the string option for array parameters, causing validation errors when clients send JSON-serialized arrays.

@shadowyman shadowyman force-pushed the fix/array-serialization-issue branch from ac24d13 to 1d7b3f1 Compare June 27, 2025 01:19
- Remove transform functions from array schemas in common.ts and issues.ts
- Add JSON string parsing logic to handlers before schema validation
- Preserve backward compatibility by accepting both arrays and JSON strings

This fixes the issue where MCP clients receive incomplete schemas that
don't include the string option for array parameters, causing validation
errors when clients send JSON-serialized arrays.
@shadowyman shadowyman force-pushed the fix/array-serialization-issue branch from 1d7b3f1 to 00085d2 Compare June 27, 2025 01:23
@sapientpants
Copy link
Owner

@shadowyman Could you please run pnpm run ci and address any issues there with formatting and linting?

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