mcp-server-git: git_status and the git_diff tools print non-ASCII paths as octal escapes, so git_add cannot take them back
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 57/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- git, python
調査の方向性
Read src/git/src/mcp_server_git/server.py, especially the git_status and diff tool implementations around the reported line 155. Reproduce with the supplied Python script and a filename containing non-ASCII characters; the issue also points to PR #4879 and four tests as reference. Done when status and all three diff tools return paths that can be passed to git_add.
索引モデルが issue の本文から書いたものです。
説明
Which server?
git (mcp-server-git)
Server version
2026.10.10, from v2/main at 2f8dc42
How did you run the server?
From a clone of this repository
Transport
stdio
Protocol era
Not sure. The repro calls the tool functions in-process, so it does not depend on the era.
MCP client and version
n/a, the tool functions were called directly from Python
Operating system and runtime
Linux, Python 3.10.21, git 2.43.0, GitPython 3.2.0
Server configuration
None beyond uv sync --frozen --dev in src/git.
Steps to reproduce
- In a fresh repository, create an untracked file named
日本.txt. - Call
git_status, strip the surrounding double quotes from the name it prints, and pass that name togit_add. - Save the script below as
repro.pyinsrc/gitand run it.
repro.py
import pathlib, subprocess, tempfile
import git
import mcp_server_git.server as s
d = pathlib.Path(tempfile.mkdtemp())
subprocess.run(["git", "init", "-q", str(d)], check=True)
r = git.Repo(d)
(d / "日本.txt").write_text("a\n")
print("--- git_status")
st = s.git_status(r)
print("\n".join(l for l in st.splitlines() if "Untracked" in l or ".txt" in l))
name = [l.strip() for l in st.splitlines() if ".txt" in l][0].strip('"')
r.git.add("日本.txt")
print("--- git_diff_staged (headers)")
print("\n".join(l for l in s.git_diff_staged(r).splitlines() if l.startswith("diff --git")))
r.git.rm("--cached", "-q", "日本.txt")
print("--- git_add with the name git_status printed")
try:
s.git_add(r, [name])
except Exception as e:
print(type(e).__name__ + ":", str(e).split("stderr: ")[-1].strip().strip("'"))
print("--- the same status with -c core.quotepath=false")
print("\n".join(l.strip() for l in r.git(c="core.quotepath=false").status().splitlines() if ".txt" in l))
$ uv run python repro.py # src/git at 2f8dc42
--- git_status
Untracked files:
"\346\227\245\346\234\254.txt"
--- git_diff_staged (headers)
diff --git "a/\346\227\245\346\234\254.txt" "b/\346\227\245\346\234\254.txt"
--- git_add with the name git_status printed
GitCommandError: fatal: pathspec '\346\227\245\346\234\254.txt' did not match any files
--- the same status with -c core.quotepath=false
日本.txt
Expected behavior
git_status and the three diff tools print 日本.txt, a name a client can pass back to git_add.
Actual behavior
src/git/src/mcp_server_git/server.py:155 calls repo.git.status() with git's default core.quotepath=true, so every non-ASCII path comes back as quoted octal escapes. git_diff_unstaged, git_diff_staged and git_diff do the same.
Already prototyped a fix?
#4879 by @tsurutanmen has the change and four tests for it, written against main. It runs the four commands with -c core.quotepath=false.
Before you submit
- I searched existing issues and this is not a duplicate.
- This is not a security vulnerability report (those go through the private advisory form).
@cliffhall could this go on the board for the git server?
- 主要言語
- TypeScript
- スター
- 91.4k
- フォーク
- 11.8k
- 平均マージ
- 6時間 37分
- マージ済み PR(30日)
- 147
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/servers のほかの issue
-
chore v2
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
modelcontextprotocol/servers#5261 ·
メンテナーはふだん 1 日以内に返信
-
docs(git): clarify unconfined default scope and repository confinement options in README and CLIオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
modelcontextprotocol/servers#5231 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
docs(git): clarify unconfined default scope and repository confinement options in README and CLIオープン
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
modelcontextprotocol/servers#5230 ·
メンテナーはふだん 1 日以内に返信
-
git: README should state plainly that without --repository every reachable repository is in scopeオープンdocumentation server-git v2
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
modelcontextprotocol/servers#5225 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
chore v2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
modelcontextprotocol/servers#5223 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/servers の issue をすべて見る
似ている issue
-
Native Web
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
digitalfabrik/integreat-app#4517 ·
メンテナーはふだん 2 日以内に返信
-
TLS guide repeats certs/ in the certificate directory対応中かも @maheshrijal が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
prometheus/docs#3156 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
medusajs/dtc-starter#90 ·
メンテナーはふだん 1 日以内に返信
-
usability
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
inmanta/web-console#7632 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
zaidmukaddam/scira#261 ·