Skip to content

🐛 Fix MCP path validation rejecting valid Windows paths in WSL#40

Merged
HanXHX merged 1 commit into
masterfrom
bug_download
May 14, 2026
Merged

🐛 Fix MCP path validation rejecting valid Windows paths in WSL#40
HanXHX merged 1 commit into
masterfrom
bug_download

Conversation

@HanXHX
Copy link
Copy Markdown
Contributor

@HanXHX HanXHX commented May 14, 2026

Replace filepath.IsAbs() checks with OS-aware descriptions in MCP tool parameters. filepath.IsAbs() uses compile-time OS semantics, so a Linux binary (e.g. running in WSL) would reject valid Windows paths like C:\Users... sent by a Windows MCP client.

Tool descriptions now include the correct path format for the compiled OS, guiding the LLM client to send the right path on the first call.

Replace filepath.IsAbs() checks with OS-aware descriptions in MCP tool
parameters. filepath.IsAbs() uses compile-time OS semantics, so a Linux
binary (e.g. running in WSL) would reject valid Windows paths like
C:\Users\... sent by a Windows MCP client.

Tool descriptions now include the correct path format for the compiled OS,
guiding the LLM client to send the right path on the first call.
Copilot AI review requested due to automatic review settings May 14, 2026 17:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes filepath.IsAbs() validation in MCP tool handlers (which used compile-time OS semantics and rejected valid Windows paths from a Linux/WSL server) and replaces it with OS-aware hints in the tool parameter descriptions to guide MCP clients.

Changes:

  • Drop path/filepath import; add runtime to detect server OS.
  • Remove absolute-path validation for output_dir, local_paths, and local_dir.
  • Add absPathHint text to relevant tool parameter descriptions in both registerTransferTools and registerDataroomTools.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HanXHX HanXHX merged commit 0895778 into master May 14, 2026
8 checks passed
@HanXHX HanXHX deleted the bug_download branch May 15, 2026 16:09
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