CLI stored-auth flags (--use-stored-auth, --list-stored-auth, --wait-for-auth) miss tokens stored under byIssuer
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/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ệ
- typescript
- Lĩnh vực
- authentication, cli
Hướng nghiên cứu
Start in clients/cli/src/cli.ts at findStoredToken and the --list-stored-auth and --use-stored-auth handlers; inspect the existing stored-auth tests for the byIssuer shape. Reproduce with the OAuth test server and an isolated MCP_STORAGE_DIR. Done means list, use, wait, and refresh write-back operate on the active issuer's joined token view and the tests cover this shape.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
The CLI's stored-auth flags can't see a token the shared OAuth store actually holds:
--use-stored-authexits3withno_stored_token, and its message lists the very URL it failed to match under "Stored keys".--list-stored-authreturns"storedServerUrls": [].--wait-for-authgoes through the same lookup (findStoredToken), so going by the code it waits until it times out even after the token lands. I haven't run this one.
The lookups in clients/cli/src/cli.ts read the token at the server level: state.tokens?.access_token / state.tokens?.refresh_token (on v2/main: L325 findStoredToken, L388, L1010 --list-stored-auth, L1120–1121 --use-stored-auth). Since the OAuth store was re-keyed per issuer (#1625), acquired tokens are stored at servers[url].byIssuer[activeIssuer].tokens, so none of these lookups ever matches. --stored-auth-only is unaffected because it goes through the normal auth provider path, which does read byIssuer.
Found while smoke testing #2482, where it reproduced identically on v2/main (30a9a897) and on the PR head (fc55e11a). So it is not caused by that PR. The PR does change where the tokens live, since they move to the secret store and are joined back on read, so a fix should read the joined view.
Reproduce
- Start an OAuth test server:
node test-servers/build/server-composable.js --config test-servers/configs/oauth-revocation-http.json(:8083). - With an isolated
MCP_STORAGE_DIR, complete an interactive CLI login:mcp-inspector --cli --server-url http://localhost:8083/mcp --method tools/list. - Check the token is there:
--stored-auth-only --method tools/listsucceeds, andoauth.jsonshowsservers["http://localhost:8083/mcp"].byIssuer["http://localhost:8083"].tokens. mcp-inspector --cli --list-stored-authprintsstoredServerUrls: [].mcp-inspector --cli --server-url http://localhost:8083/mcp --use-stored-auth --method tools/listexits 3 with{"error":{"code":"no_stored_token",…"Stored keys: http://localhost:8083/mcp."}}.
Expected
--list-stored-authlists the URL.--use-stored-authrefreshes (or injects) the active issuer's token and succeeds.--wait-for-authreturns as soon as the token lands.- The refresh write-back persists the rotated tokens under the active issuer.
The existing stored-auth tests should cover the byIssuer shape, so this can't regress silently again.
- Ngôn ngữ chính
- TypeScript
- Star
- 11.1k
- Fork
- 1.6k
- Merge trung bình
- 4 giờ 56 phút
- Pull request đã merge (30 ngày)
- 155
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
-
modelcontextprotocol/inspector#2810 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
local:gate cannot pass on Windows — pre-existing failures in test:scripts, coverage:web and coverage:mcpdoCó thể đã có người làm @olaservo đã nhận hôm nay. Đang mởbug v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
modelcontextprotocol/inspector#2748 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
blocked chore v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
modelcontextprotocol/inspector#2548 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
blocked chore v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
modelcontextprotocol/inspector#2547 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Create the GitHub App for board writes and security-alert reads, and store its credentials as org secretsCó thể đã có người làm @cliffhall đã nhận 5 ngày trước. Đang mởchore v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
modelcontextprotocol/inspector#2544 · 1 bình luận · 1 người được giao ·
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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
cline/cline#15327 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
LogicLabs-OU/OpenArchiver#509 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bigcapitalhq/bigcapital#1545 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày