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

test: MCP tests fail when the developer's ~/.claude.json has MCP servers (HOME is not sandboxed)

未关闭 适合新手
#1,386 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
cli, testing-qa

调研方向

从 test/preload.ts 开始,检查 MCP 发现如何获取 HOME,然后查看 test/mcp/headers.test.ts 和 test/server/httpapi-mcp.test.ts。确保测试套件使用隔离的 home 目录,使开发者的 MCP 配置不会影响发现过程。分别在存在和不存在内容已填充的真实 ~/.claude.json 时运行这些测试,然后验证报告的 15/15 结果。

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

描述

Found while running the full suite for the v0.12.4 release.

test/mcp/headers.test.ts (5 tests) and test/server/httpapi-mcp.test.ts ("serves status endpoint") fail on any machine whose real ~/.claude.json has an entry under mcpServers. MCP discovery reads that file from the real $HOME, so the discovered server is created alongside the test's own servers: it has no requestInit, which breaks the headers assertions, and it changes the status endpoint's result.

test/preload.ts sandboxes the XDG directories but not HOME, so other home-directory config sources may leak the same way.

Reproduced on main (93fe816e20). With HOME pointed at an empty temporary directory, the same three files pass (15/15).

Suggested fix: point HOME (or the discovery's home-directory lookup) at a temporary directory in test/preload.ts, or have MCP discovery honour a test override, so the suite never reads the developer's own editor and assistant configs.

主要语言
TypeScript
星标
805
派生
122
平均合并
1 天 19 小时
30 天内合并 PR
57

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

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

AltimateAI/altimate-code 的其他 Issue

查看 AltimateAI/altimate-code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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