Skip to content

Conversation

dr03ramos
Copy link

Added a "file://" prefix to prevent the JSON library from not identifying the URI correctly.

Motivation and Context

Fixes #131. The lib wasn't working for STDIO servers on any Windows environment i tested.

How Has This Been Tested?

Tested on Windows and Linux.
(The issue was occuring only on Windows, but i wanted to see if it would break Linux and it didn't.

Breaking Changes

Not expected.

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

Fixes modelcontextprotocol#131.
Tested on Windows and Linux.

Added a "file://" prefix to prevent the JSON library from not identifying the URI correctly.
@koic
Copy link
Member

koic commented Sep 16, 2025

It would be helpful to add source code comments explaining what kind of issues on Windows environments the added logic is intended to address. It would also be preferable to add regression tests to input_schema_test.rb and output_schema_test.rb.

@dr03ramos
Copy link
Author

  • I've made a change to my initial commit as per Update metaschema URI format in input_schema.rb #132 (comment)
    (@atesgoral suggested not building an URI manually, which is indeed safer; i've added the JSON Util URI builder as the URI::File.build method was not returning the needed output i needed on windows).
  • Added source code comments explaining the logic and the reason behind the logic (@koic)
  • Didn't find the need for new tests on input_schema_test.rb and output_schema_test.rb... the current ones already cover the input and output validations

@dr03ramos dr03ramos requested a review from atesgoral September 18, 2025 17:38
@dr03ramos dr03ramos requested a review from koic September 19, 2025 12:15
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.

JSON validation error on Windows
3 participants