Skip to content

Add Windows compatibility + Minor Refactor #2

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

Merged
merged 8 commits into from
Jun 5, 2025

Conversation

HungKNguyen
Copy link
Contributor

@HungKNguyen HungKNguyen commented May 27, 2025

This pull request adds Windows compatibility to the MCP server, which includes these tasks:

  • Modify pnpm scripts to also beable to run on Windows, which involve using the package shx to wrap around Unix commands
  • Adding the file pnpm-workspace.yaml to explicitly includes the supported OS and Architectures
  • Updating src/fs/sandbox to be Windows compatible (Windows use backslash for path separators compared to Unix's forward slash)
  • Update the tests/unit.test.ts so that AI-provided file paths can be OS-agnostic, but the resolved file paths and error message must adhere to the OS standard
  • Update README.md

This pull request also refactored the parameter relativeOutputPath to outputFilePath since the output path ultimately get resolved via resolveFilePath which support both relative path and absolute path.

Testing:

  • Build and ran the project on Windows 11 64-bit ARM (virtualized)
  • Pass all the tests in unit.test.ts
  • Connect to the MCP server on Windows using MCP Inspector Tool
  • Ran the tests in buid-api-examples.test.ts and signing-api-examples.test.ts
  • Test end-to-end on Claude Desktop (Window 11 64-bit ARM virtualized)

Discussion:

  • I had to modify the unit.test.ts since the expected result for some test cases changes depending on the OS you are in. For example, the resolved file path can be /sandbox/test.pdf on macOS and C:\sandbox\test.pdf
  • While I have not explicitly tested on these platforms, but I think the code should already work on Linux and x64 CPU

@HungKNguyen HungKNguyen requested a review from nickwinder May 27, 2025 09:27
nickwinder and others added 3 commits May 28, 2025 04:31
Corrected indentation in README for consistency and reformatted the `performBuildCall` function signature to fit a single line. These changes improve readability and maintain alignment with coding and documentation standards.
Update the package.json version for a new release. This ensures proper version tracking and prepares the package for deployment. No additional changes were made apart from the version update.
@HungKNguyen HungKNguyen mentioned this pull request May 29, 2025
3 tasks
Copy link
Collaborator

@nickwinder nickwinder left a comment

Choose a reason for hiding this comment

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

LGTM .
Just please revert the version prior to merging. Thanks

@HungKNguyen HungKNguyen merged commit a5965d1 into main Jun 5, 2025
HungKNguyen added a commit that referenced this pull request Jun 5, 2025
@HungKNguyen HungKNguyen deleted the windows-compatibility branch June 5, 2025 00:58
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