Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

filesystem: document hard-link behavior and report the link count in get_file_info

未关闭
#5,226 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃

调研方向

Start with src/filesystem/README.md around line 106 and the filesystem server implementation of get_file_info. Check how write_file and edit_file handle existing files, then find the fs.stat result used for file information. Add the README explanation, expose nlink, and cover the field in tests; the changeset should describe the new output field.

由索引模型根据 Issue 内容生成。

描述

enhancement server-filesystem v2

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

  1. 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.
  2. 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).

主要语言
TypeScript
星标
91.6k
派生
11.9k
平均合并
6 小时 37 分钟
30 天内合并 PR
147

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/servers 的其他 Issue

查看 modelcontextprotocol/servers 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。