What happened?
When using the dbt MCP server with Snowflake externalbrowser authentication on macOS, every dbt CLI command triggers a separate browser SSO authentication window. A single dbt build on one model with 2 tests results in 3 browser popups, making the MCP server unusable for real workflows.
Two issues combine to create this problem:
-
uvx creates ephemeral virtualenvs with unique Python binary paths per session. Each session spawns a new path like ~/.cache/uv/archive-v0/<random-hash>/bin/python. macOS Keychain grants access per binary path, so the Snowflake connector's cached SSO token (stored via the keyring library) is never readable by the next session's Python binary. Even clicking "Always Allow" on the Keychain popup doesn't persist because the binary path changes.
-
Each dbt CLI tool spawns a new subprocess. Since dbt-mcp runs each command via subprocess.Popen, every build/run/test/show call creates a new dbt process that opens a new Snowflake connection. Within a single session where Keychain access fails, this means a browser auth popup per query rather than per session.
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring eliminates Keychain popups but still triggers browser SSO per query (no cached token)
Steps to Reproduce
- Configure dbt MCP server via
uvx dbt-mcp@latest (the default recommended setup)
- Configure Snowflake with
authenticator: externalbrowser in profiles.yml
- Run any dbt CLI tool through the MCP server (e.g.,
dbt build on a model with tests)
- Observe a separate browser SSO window for each query (1 for the model + 1 per test)
Deployment
Local MCP server
Environment
- dbt-mcp v1.15.0 (installed via
uvx dbt-mcp@latest)
- macOS
- Snowflake authenticator:
externalbrowser
allow_id_token = true at the Snowflake account level
snowflake-connector-python[secure-local-storage] installed
- Claude Code (MCP client)
Relevant log output
Could not retrieve ID_TOKEN from secure storage : Can't get password from keychain: (-128, 'Keychain Access Denied')
Initiating login request with your identity provider. Press CTRL+C to abort and try again...
Going to open: https://[redacted]/sso/saml?SAMLRequest=...
Could not store id_token to keyring, Can't store password on keychain: (-25244, 'Unknown Error')
What happened?
When using the dbt MCP server with Snowflake
externalbrowserauthentication on macOS, every dbt CLI command triggers a separate browser SSO authentication window. A singledbt buildon one model with 2 tests results in 3 browser popups, making the MCP server unusable for real workflows.Two issues combine to create this problem:
uvxcreates ephemeral virtualenvs with unique Python binary paths per session. Each session spawns a new path like~/.cache/uv/archive-v0/<random-hash>/bin/python. macOS Keychain grants access per binary path, so the Snowflake connector's cached SSO token (stored via thekeyringlibrary) is never readable by the next session's Python binary. Even clicking "Always Allow" on the Keychain popup doesn't persist because the binary path changes.Each dbt CLI tool spawns a new subprocess. Since dbt-mcp runs each command via
subprocess.Popen, everybuild/run/test/showcall creates a new dbt process that opens a new Snowflake connection. Within a single session where Keychain access fails, this means a browser auth popup per query rather than per session.PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyringeliminates Keychain popups but still triggers browser SSO per query (no cached token)Steps to Reproduce
uvx dbt-mcp@latest(the default recommended setup)authenticator: externalbrowserinprofiles.ymldbt buildon a model with tests)Deployment
Local MCP server
Environment
uvx dbt-mcp@latest)externalbrowserallow_id_token = trueat the Snowflake account levelsnowflake-connector-python[secure-local-storage]installedRelevant log output