CLI tests seed the developer's real ~/.mcp-inspector/mcp.json (cli.test.ts, completion.test.ts)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Đọc clients/cli/__tests__/cli.test.ts và clients/cli/__tests__/completion.test.ts, sau đó theo dõi cách serverList phân giải đường dẫn danh mục mặc định và so sánh với thiết lập cho #2728. Dùng một thư mục tạm riêng cho mỗi tệp để chứa danh mục và thêm một bước kiểm tra khiến quá trình thất bại nếu đường dẫn của nó được phân giải ra ngoài os.tmpdir(). Chạy hai tệp Vitest đã nêu và xác nhận chúng không làm thay đổi thư mục home thực.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Found during the v2.12.0 release smoke (#2764), while verifying #2719.
Problem
Two CLI test files still write the developer's real ~/.mcp-inspector/mcp.json: clients/cli/__tests__/cli.test.ts and clients/cli/__tests__/completion.test.ts. #2719 isolated the OAuth state file (oauth.json*) and #2723 isolated the TUI's auth.log. Nothing isolates the default server catalog, though, so on a machine with no catalog yet, a CLI test run seeds {"mcpServers": {}} into the real home directory.
Neither test file changed since 2.11.0, so this predates the v2.12.0 milestone and is not a regression.
Reproduce
cd clients/cli
for f in __tests__/*.test.ts; do H=$(mktemp -d); HOME=$H npx vitest run $f >/dev/null 2>&1; [ -e $H/.mcp-inspector ] && echo "$f -> $(cd $H && find .mcp-inspector -type f)"; done
Observed on the v2.12.0 merge tree:
__tests__/cli.test.ts -> .mcp-inspector/mcp.json
__tests__/completion.test.ts -> .mcp-inspector/mcp.json
Expected
A CLI test run leaves HOME untouched. The fix should use the same shape as #2728: point the catalog path (MCP_STORAGE_DIR, or whatever serverList resolves the default catalog from) at a per-file mkdtemp directory in a setup file. It should also add a guard that fails a test whose catalog path resolves outside os.tmpdir().
Impact
The seed only happens when no catalog exists, so an existing mcp.json is never overwritten. The impact is a stray empty catalog on a fresh machine, plus concurrent worktree runs sharing one file.
- Ngôn ngữ chính
- TypeScript
- Star
- 11.1k
- Fork
- 1.6k
- Merge trung bình
- 5 giờ 29 phút
- Pull request đã merge (30 ngày)
- 158
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/inspector
-
chore v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/inspector#2752 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement v2
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
modelcontextprotocol/inspector#2772 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
modelcontextprotocol/inspector#2768 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 54/100
modelcontextprotocol/inspector#2766 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation v2
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 54/100
modelcontextprotocol/inspector#2755 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/inspector
Issue tương tự
-
[Bug]: Circular app layout navigation and help icons are shifted upward in the official demoĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
cloudscape-design/components#5184 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
JarX-Concepts/react-native-platform-components#130 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(api): optimize-for-web /preview outer catches miss asDecoderOutOfMemory on V8 OOM and SIGKILLĐang mởarea: backend bug priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
snapotter-hq/SnapOtter#3773 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-qa ux-audit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
linagora/twake-contacts-frontend#386 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
git: README should state plainly that without --repository every reachable repository is in scopeĐang mởdocumentation server-git v2
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
modelcontextprotocol/servers#5225 ·
Maintainer thường phản hồi trong vòng 1 ngày