Skip to content

feat: enhance MCP server functionality with version support and fixed file URI handling#790

Merged
cmendible merged 1 commit intomainfrom
fix-mcp
Mar 16, 2026
Merged

feat: enhance MCP server functionality with version support and fixed file URI handling#790
cmendible merged 1 commit intomainfrom
fix-mcp

Conversation

@cmendible
Copy link
Member

Description

This pull request introduces improvements to MCP server handling and path parsing, as well as enhancements to tool option annotations. The most significant changes are the addition of robust file URI parsing for cross-platform compatibility, passing the server version dynamically, and expanding test coverage for new path parsing logic.

MCP server improvements:

  • Added support for passing the MCP server version dynamically to StartWithMode, defaulting to "dev" if not provided. This ensures the server reports the correct version in its metadata. (internal/mcpserver/server.go, cmd/azqr/commands/mcpserver.go) [1] [2]

Path parsing enhancements:

  • Introduced the fileURIToPath function to reliably convert file:// URIs to local filesystem paths, handling Unix, Windows (including percent-encoded drive letters), and edge cases. Also added the helper isASCIILetter. (internal/mcpserver/roots.go)
  • Updated getCurrentFolder to use the new fileURIToPath function, improving cross-platform folder detection from MCP roots. (internal/mcpserver/roots.go)

Testing improvements:

  • Added comprehensive unit tests for fileURIToPath and isASCIILetter to verify correctness across a variety of URI formats and edge cases. (internal/mcpserver/roots_tests.go)

Tool option enhancements:

  • Added mcp.WithReadOnlyHintAnnotation(false) and mcp.WithDestructiveHintAnnotation(false) to tool options, improving annotation support for tool capabilities. (internal/mcpserver/tools.go)

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Unit tests passing

Copy link
Member Author

@cmendible cmendible left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 2.17391% with 90 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.72%. Comparing base (75e6db6) to head (6bc705e).

Files with missing lines Patch % Lines
internal/mcpserver/roots_tests.go 0.00% 66 Missing ⚠️
internal/mcpserver/roots.go 0.00% 19 Missing ⚠️
internal/mcpserver/server.go 0.00% 4 Missing ⚠️
cmd/azqr/commands/mcpserver.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #790      +/-   ##
==========================================
- Coverage   21.96%   21.72%   -0.24%     
==========================================
  Files          94       95       +1     
  Lines        5987     6062      +75     
==========================================
+ Hits         1315     1317       +2     
- Misses       4569     4642      +73     
  Partials      103      103              
Flag Coverage Δ
unittests 21.72% <2.17%> (-0.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cmendible cmendible merged commit 3ce4d85 into main Mar 16, 2026
12 checks passed
@cmendible cmendible deleted the fix-mcp branch March 16, 2026 13:37
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