anthropics / anthropics/claude-ai-mcp

Custom connector auth state and tool list are lost silently after app restart and expired refresh token

Aperta
#795 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Nessun dato sulla lingua
Stelle
471
Fork
76
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### What happened?

Custom MCP connector authentication degrades gracefully within a session, but not across app restarts. If the app is closed for more than 24 hours and the refresh token happens to expire during that window, the connector's tool list is gone on reopen and Settings > Connectors shows a "Reconnect" status with an orange warning triangle. This state is never surfaced to the user in chat though. New conversations behave as if the tools never existed, instead of surfacing an auth prompt.

Note: the 24 hour closure itself isn't the problem. If the refresh token is still valid when the app reopens, it silently refreshes fine, consistent with the proactive refresh behavior described in Anthropic's own docs. The issue only appears when the refresh token's expiry falls within the period the app was closed, so there's no active session to catch the 401 and trigger a refresh or reauth. A common real world trigger: closing the app Friday evening and reopening it Monday, if the refresh token's lifetime elapses over the weekend.

### What did you expect to happen?

Either Claude recognizes on startup that the connector's tools are unavailable, so any tool dependent request (in an existing conversation or a new one) surfaces the same "Authentication required to use this tool" prompt or triggers reauth automatically. Or at minimum, Claude is aware it has a configured connector with an unknown or broken auth state and says so, instead of behaving as if the connector doesn't exist.

### Steps to reproduce

1. Add a custom MCP connector via OAuth. Login popup appears, connects successfully. Works as intended.
1. Use the connector normally. Access token expires mid session and gets silently refreshed. Works as intended.
1. Let the refresh token also expire while a conversation is still open. Attempting to use a tool correctly shows "Authentication required to use this tool" in chat. Works as intended. Settings > Connectors still shows the server as connected, with its tools listed.
1. Instead, close the app and let the refresh token expire while the app is closed (e.g. close it Friday, refresh token lifetime elapses over the weekend).
1. Reopen the app more than 24 hours later.

### Area

MCP Connector (adding/managing servers)

### MCP Server (if applicable)

custom server, this works fine when connection server to chatgpt or microsoft 365 copilot

### Error messages or logs

```shell

```

### Additional context

_No response_

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.