git: the string "null" for base_branch, contains or not_contains arrives as None (python-sdk#3055)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- github, typescript
调研方向
Start in src/git and inspect its SDK lockfile and protocol tests for git_create_branch and git_branch. Check the Python SDK release that fixes python-sdk#3055, then add protocol coverage for base_branch, contains, and not_contains. Done means the fixed SDK release is locked and each test confirms the literal "null" reaches the tool as a string.
由索引模型根据 Issue 内容生成。
描述
Since #5174 (#5175), the git server is built on MCPServer. Before validating arguments, the SDK's FuncMetadata.pre_parse_json JSON-decodes every string argument whose annotation is not exactly str. For the git server's three str | None parameters, that turns the literal string "null" into None:
| Tool | Parameter | Effect of "null" |
|---|---|---|
git_create_branch |
base_branch |
Branches from the current branch, not from a branch named null |
git_branch |
contains |
The filter is silently dropped |
git_branch |
not_contains |
The filter is silently dropped |
All three advertise anyOf: [string, null], so "null" is a valid string value. Before #5175, the server received it unchanged.
Upstream: modelcontextprotocol/python-sdk#3055 (open), with the fix in python-sdk#3056. A comment there already reproduces this "null" → None case.
Done when
The SDK release that fixes python-sdk#3055 is locked in src/git, with a protocol test for each parameter showing that "null" reaches the tool as the string "null". Before then, a workaround in the server (declaring the parameters as str with a custom validator and a hand-written schema) is not wanted: these servers are meant to show the plain high-level API. Found in the Copilot review of #5175.
- 主要语言
- TypeScript
- 星标
- 91.6k
- 派生
- 11.9k
- 平均合并
- 6 小时 37 分钟
- 30 天内合并 PR
- 147
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
outline/outline#14348 · 1 条评论 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
[Bug]: Agent import retains quotes in .env API keys followed by inline comments可能已有人在做 @yxr-2025 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
awslabs/visual-asset-management-system#804 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
dsh-market/dsh-market#1027 · 1 条评论 ·
维护者通常 1 天内回复