Skip to content

Refresh token secrets accumulate #3886

Done

Description

@eleftherias

Problem

When a remote MCP server is restarted, a new secret named OAUTH_REFRESH_TOKEN_<server_name>_<postfix> is created.
This causes secrets to accumulate without ever being cleaned up.

To reproduce

Run a remote MCP server

thv run context7-remote

Note the refresh token secrets that ToolHive creates:

thv secret list | grep context7-remote

Restart the server

thv stop context7-remote
thv restart context7-remote

See that new secrets are created:

thv secret list | grep context7-remote

Expected behaviour

The expected behaviour is that no new secrets are created when the server restarts or that the old secrets are cleaned up when the new secrets are created.

This may depend on #3806, since we're assuming that ToolHive cannot delete or update secrets, given they might have come from the user.
We don't currently differentiate between workload-created secrets and user-created secrets.

Activity

  1. added
    bug
    on Feb 18, 2026
  2. added
    cli
    on Feb 18, 2026
  3. removed
    cli
    on Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions