Repository navigation
Description
Existing issues
- I searched open issues and this is not already reported.
Related but different: #32715 (Windows read race in the same vault), #24614 (named-server sign-in trigger), #30531.
KiroCrew version
0.12.2. The same _KEY_RE is still on main and v0.13.0-rc.5.
Release channel
Stable
How is it installed?
Desktop app
Platform
macOS (arm64), kiro-cli 3.5.0 (released 2026-11-17)
What is broken
kiro-cli 3.5.0 added a new kind of MCP OAuth secret key, kiro.mcp.<sha256>.kiro-path-client. Kiro Crew's grant vault accepts only client, tokens, verifier and discovery. It refuses the new key, KAS reads the refusal as a failed secret-store read, and the server is reported failed instead of "needs sign-in". Kiro Crew offers sign-in only for failedAuthorization, so no Authorize banner appears and the server's tools never load.
This hits every remote server declared as a plain URL with agent.kas_persist_mcp_sign_in=true (the default):
{ "mcpServers": { "example": { "url": "https://mcp.example.com/mcp" } } }Steps to reproduce
- Install kiro-cli 3.5.0 and use the KAS backend with default settings.
- Add a remote OAuth MCP server as a plain
{ "url": ... }entry, with nooauth.clientId,oauth.redirectUrioroauth.clientMetadataUrl. - Start a new chat whose first message names the server, e.g.
sign in to example.
Expected
The server reaches "needs sign-in" and a banner with an Authorize link appears (the named-server trigger from #24614).
Actual
The server is failed with failedAuthorization: false and this message:
The sign-in could not be read from the secret store. It is kept; retry the server when the secret store answers again.
No banner appears and the server has no tools. Retrying gives the same result.
Evidence
Observed (gateway log with agent.log_level=INFO; the default WARNING level hides the refusal)
- Each new chat logs
MCP grant store request refused: key is outside the MCP sign-in namespacethree times. This is the only refusal reason in the log. - WARNING:
MCP servers unusable in this session — failed to start: <server> (The sign-in could not be read from the secret store. ...). - From the Connections page:
OAuth mint for '<server>' on KAS failed: mint_server_failed.
Kiro Crew 0.12.2 package (kiro_crew/ in the app's backend)
acp/kas_secret_storage.py:89:_KEY_RE = re.compile(r"\Akiro\.mcp\.[0-9a-f]{64}\.(client|tokens|verifier|discovery)\Z").acp/kas_secret_storage.py:91:_PERSISTED_KINDS = frozenset({"client", "tokens"}).acp/kas_secret_storage.py:226-227:answer()raisesSecretStorageRefused("key is outside the MCP sign-in namespace")for any key that misses_KEY_RE. This covers get, store and delete alike.acp/runtime_host_requests.py:586-589: the refusal is logged only at INFO (MCP grant store request refused: %s) and returned as JSON-RPC error-32000(_MCP_SECRET_REFUSED, line 72).acp/session_handle_mcp.py:641-642: a server enters_mcp_sign_in_neededonly whenfailedAuthorization is True.acp/session_handle_mcp.py:662-669: afailedserver is re-attempted only ifis_recoverable_auth_failure(errorMessage)matches (acp/mcp_reattempt.py:43-66, plusacp/transport_errors.py:618-700). From reading those patterns, the secret-store message above matches none of them. I did not run the classifier.acp/session_handle_mcp.py:835-862:_offer_mcp_sign_instarts a sign-in only for servers in both_mcp_sign_in_wantedand_mcp_sign_in_needed.want_mcp_sign_in_named(line 772) is the opt-in trigger from KAS chats offer MCP sign-in for every unsigned server, unprompted, in every chat #24614.
KAS 3.5.0 (node_modules/@kiro/agent/dist/server/acp-server.js in kiro-cli's kas/3.5.0-* directory; minified, line numbers are physical lines)
- Line 16980:
var G0l=["client","kiro-path-client","tokens","verifier","discovery"]. - Line 16980,
CredentialStorageManager:keyPrefix="kiro.mcp",clientKind=S9n(n?.oauth)?"kiro-path-client":"client",keyFor(e){return\${this.keyPrefix}.${this.connectionHash}.${e}`}`. - Line 2183:
function S9n(t){return t?.redirectUri===void 0&&!sH(t)&&t?.clientMetadataUrl===void 0}, wheresHchecks for a non-emptyoauth.clientId. So any server withoutclientId,redirectUriorclientMetadataUrluses the new kind. - Line 16980:
readStoredwraps anysecretStorage.geterror inSecretReadError(dJ). - Line 16982:
loadStoredClient()callsloadClientRegistration()(thekiro-path-clientkey) first. It callsloadLegacyClientRegistration()(the oldclientkey, which Crew accepts) only if the first returns nothing. A refusal throws before the legacy fallback runs. - Line 16980:
clearLegacyClientRegistration()deletes the oldclientkey when migrating. - Line 17063:
ZAr("describeConnectFailure") mapsdJto "The sign-in could not be read from the secret store. ..." and setsfailedAuthorizationtor==="Unauthorized"||code===401. ThedJmessage is "The secret store could not be read", sofailedAuthorizationisfalse. - The other kiro-cli KAS bundles on the same machine (2.36.0, 3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0) contain no
kiro-path-clientstring. The regression starts with 3.5.0.
Second affected key
KAS 3.5.0 line 17984: organization (IdP) sign-in stores its session under kiro.mcp.idp.${sha256(issuer|clientId)}.session. That key also misses _KEY_RE. It is used only when mcp.json has an identityProvider block. I did not test that path.
Why one plain-URL server still works (inference from code reading)
clientInformation() (line 16982) is called only from the MCP SDK's auth() flow (line 2174). That flow runs on a 401, on a 403 insufficient-scope reply, after an authorization callback (finishAuth), or during a token refresh. The transport otherwise only calls tokens(), and Crew accepts tokens keys. So a server whose saved tokens are still valid connects without reading the client registration. It should break at its first refresh or 401. I have not seen that happen yet.
Workarounds
- Set
agent.kas_persist_mcp_sign_in=false(observed to work). KAS then keeps sign-ins in memory and does not ask the grant vault. The server reaches "needs sign-in", and the banner appears when the user's message names the server. Sign-ins are lost when the engine exits, so every new chat asks again. - Pin kiro-cli to 3.4.0 (its KAS has no
kiro-path-clientkind) and turn off its auto-update withkiro-cli settings app.disableAutoupdates true.
Small docs note: docs/connections.md:74-81 ("Remote servers that need a sign-in") still says a banner appears on its own. On KAS it appears only when the user's message names the server.
Suggested fix
- Accept
kiro-path-clientin_KEY_REand add it to_PERSISTED_KINDS. It is the client registration, the same asclient. - Accept
kiro.mcp.idp.<64 hex>.sessionfor organization sign-in, or document why it is refused. - Log a namespace refusal at WARNING with the refused kind (not the key). It is a version mismatch, not routine traffic.
- Answer an unknown kind in a way that lets KAS fall through to "no saved sign-in" (for example,
getreturns nothing) instead of a JSON-RPC error, so the next unknown kind degrades to a fresh sign-in.
Secondary issue: a server reported failed with a secret-store or other sign-in-related error is never offered sign-in. Treat "sign-in could not be read" as needs-sign-in, or offer a retry or Authorize action on it.
Activity
KiroCrewCaptain commentedon Nov 19, 2026
Thanks for the report. This issue has been triaged by Crew Captain and will be assigned to a maintainer, who will follow up here.
swarina commentedon Nov 19, 2026
/claim
I'll take this one. I reproduced it on main: the grant vault answers a
getonkiro.mcp.<hash>.clientwith an empty result, but refuseskiro.mcp.<hash>.kiro-path-clientas outside the MCP sign-in namespace. I'll accept the new kind as a persisted client registration and add a regression test next to the existing vault tests. Sign-in offers forfailedservers stay out of this PR.jose-luis-tomas-garcia commentedon Nov 19, 2026
Same bug here, one more path to cover in the fix.
Versions: Kiro Crew 0.13.0 (stable, latest), kiro-cli 3.5.0, KAS relay (
kiro-cli acp --agent-engine v3), Linux (WSL). Worked on kiro-cli 3.4.0 the day before.Setup: remote n8n MCP server, entry with a flat
clientId(public client, no secret).Besides the
get, the delete during a reset is refused too, so clicking Authorize aborts before any browser page opens:The engine's kind list is
["client","kiro-path-client","tokens","verifier","discovery"]and a reset deletes each kind, so_KEY_REinkiro_crew/acp/kas_secret_storage.pyneeds to acceptkiro-path-clientfordeleteas well asget/store. The bundled engine 0.66.117 has the same kind.swarina commentedon Nov 19, 2026
Thanks for checking this. #39442 covers the delete too: the vault validates the key the same way for get, store and delete, so a reset can remove
kiro-path-clientonce the key is accepted. I ran all three calls against the branch and they return an empty result with no refusal.thalisantunes commentedon Nov 19, 2026
Same symptom on Linux, with a different install and a working workaround.
Environment
agent.kas_persist_mcp_sign_in=true(default)What happens
Clicking Connect on the Atlassian card (
https://mcp.atlassian.com/v2/mcp) opens a tab that stays on "Connecting..." forever. Every attempt logs:OAuth mint for 'atlassian' on KAS failed: mint_server_failedmcp.log:[AcpSecretStorage] Failed to retrieve secret, thenFailed to connect ... serverName: atlassian, error: The secret store could not be readCalling
SecretStorageServer.answer("_kiro/secret/get", ...)directly with a well-formedkiro.mcp.<hex>.tokenskey works (returns{}), so the grant vault itself is readable. That fits the key-shape refusal described here. I did not capture the exact key the engine sent, so I can't confirm it waskiro-path-client.Workaround that worked
Enabling the Crew-owned OAuth preview made the sign-in complete on the first try:
(Settings → Feature previews.) Atlassian is in
DCR_SLUGS, so the gateway runs the OAuth itself and the KAS secret-store path is not used. Might be worth mentioning in the release notes until #39442 ships.