You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
filesystem: document hard-link behavior and report the link count in get_file_info #5226
The filesystem server's README should spell out what hard links mean for reads and writes, and get_file_info should report a file's link count.
Problem
write_file and edit_file overwrite an existing file in place, and the README says so (src/filesystem/README.md:106: the file "keeps its inode, creation time, hard links and permissions"). It does not spell out the consequence: when a file inside an allowed directory is a hard link to a file elsewhere, both names are the same file, so an overwrite changes the content seen at every name, and a read returns that shared content. Some tools create hard links routinely (pnpm's content-addressable store, for example, hard-links package files into node_modules), so this can happen without anyone choosing it.
The server cannot currently tell a caller whether a file has other names: get_file_info does not report the link count.
Expected
A README paragraph, under write_file (or in a short note on allowed directories), saying that the server's allowed-directory checks are path-based, that a hard link is a real name of the same file, and that overwriting or editing such a file changes it at all of its names.
get_file_info reports the link count (nlink from fs.stat), so a client or model can see that a file has more than one name before changing it.
Tests for the new get_file_info field, and a changeset (minor: a new output field).
Activity
Merge pull request #5315 from modelcontextprotocol/v2/feat/5226-files…
feat(filesystem): report the hard-link count in get_file_info (modelc…