feat(login): auto-link legacy API key when ETERNA_MCP_KEY is set#1
Merged
matmilbury merged 1 commit intomainfrom Apr 13, 2026
Merged
feat(login): auto-link legacy API key when ETERNA_MCP_KEY is set#1matmilbury merged 1 commit intomainfrom
matmilbury merged 1 commit intomainfrom
Conversation
If ETERNA_MCP_KEY is present in the environment, eterna login calls POST /migrate/link-legacy-key on mcp-gateway after OAuth completes. This preserves the user's existing Bybit subaccount — mcp-gateway resolves the new JWT to the legacy agent row instead of creating a fresh one with a null bybitSubMemberId. For staging: set ETERNA_MCP_URL=https://mcp.staging.eterna.exchange. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ETERNA_MCP_KEYenv varPOST /migrate/link-legacy-keyon mcp-gateway to link the legacy agent to the new OAuth identity — preserving the existing Bybit subaccountgetMcpEndpoint()to config (defaults tohttps://mcp.eterna.exchange, overridable viaETERNA_MCP_URLfor staging)Transition flow for OpenClaw agents
eterna executecalls use the new OAuth JWTFor staging: set
ETERNA_MCP_URL=https://mcp.staging.eterna.exchangeDepends on
eterna2.0 #PR — the
/migrate/link-legacy-keyendpoint in mcp-gatewayNo new secrets