Claude Debugs and Fixes Its Own MCP Filesystem Server UNC Path Bug on Windows

A developer documented using Claude Opus to debug and fix a bug in the MCP Filesystem Server (Desktop Extension version) on Windows. The issue affected UNC network share paths (e.g., \\server\share\).
The Problem
When using a UNC share as an allowed directory, list_directory on the share root worked, but any operation on subdirectories or files failed with an "Access denied - path outside allowed directories" error. Writing files to the root also failed, despite the share being fully accessible from Windows Explorer and mapped drives.
The Debugging Process
Claude helped identify that:
- The configuration for the Desktop Extension version is stored in
%APPDATA%\Claude\Claude Extensions Settings\ant.dir.ant.anthropic.filesystem.json, notclaude_desktop_config.json. - Switching to a mapped drive letter didn't work because Node.js
fs.realpath()resolves mapped drives back to UNC paths during server startup. - The server source files (
index.js→lib.js→path-validation.js) were examined to find the root cause.
Root Cause
In path-validation.js, the function isPathWithinAllowedDirectories() checks subdirectory membership with:
return normalizedPath.startsWith(normalizedDir + path.sep);UNC share roots are filesystem roots (like C:\) and retain their trailing backslash after normalization: \\server\share\. This creates a double trailing backslash (\\server\share\\) that never matches real paths. The code had special handling for drive roots like C:\ but not for UNC roots.
The Fix
Replace the problematic line with:
const dirWithSep = normalizedDir.endsWith(path.sep) ? normalizedDir : normalizedDir + path.sep;
return normalizedPath.startsWith(dirWithSep);Apply the patch with this PowerShell one-liner:
$file = "$env:APPDATA\Claude\Claude Extensions\ant.dir.ant.anthropic.filesystem\node_modules\@modelcontextprotocol\server-filesystem\dist\path-validation.js"
Copy-Item $file "$HOME\Desktop\path-validation.js.backup"
$content = Get-Content $file -Raw
$content = $content.Replace(
'return normalizedPath.startsWith(normalizedDir + path.sep);',
'const dirWithSep = normalizedDir.endsWith(path.sep) ? normalizedDir : normalizedDir + path.sep; return normalizedPath.startsWith(dirWithSep);'
)
[System.IO.File]::WriteAllText($file, $content)Then fully quit and restart Claude Desktop. Claude tested the fix itself using MCP tools after restarting—listing subdirectories and writing a test file to confirm functionality.
Note: This patch will be overwritten if the extension auto-updates. The fix should be implemented upstream in @modelcontextprotocol/server-filesystem. Related GitHub issues: #1838, #470.
📖 Read the full source: r/ClaudeAI
👀 See Also

CtxSnap VS Code Extension Tracks File Changes for Claude Sessions
CtxSnap is a VS Code extension that tracks which files changed since your last Claude session and packages them into a ready-to-paste handoff block with file contents and a token budget bar calibrated to Claude's 200k context window.

FFF - Fast File Finder claims 100x speed advantage over ripgrep
FFF (Fast File Finder) is a web-based file search tool that claims to be 100x faster than ripgrep, positioning itself as a next-generation alternative to regex-based search methods. The tool requires JavaScript to run and was recently discussed on Hacker News with 36 points and 17 comments.

agentmemory V4 achieves 96.2% on LongMemEval benchmark, outperforms commercial AI memory systems
agentmemory V4 scored 96.2% on LongMemEval, beating several funded AI memory companies including PwC Chronos (95.6%), Mastra (94.87%), and OMEGA (93.2%). The system was built solo in 16 days on a mid-range gaming PC with a $1,000 budget.

Ollama Update Adds OpenClaw Support for Kimi k2.5 Cloud Model
Ollama has released an update that integrates OpenClaw support for cloud models, including free access to the Kimi k2.5 model with web search functionality, running on NVIDIA data centers.