fix: strip trailing /mcp from ETERNA_MCP_URL#3
Merged
matmilbury merged 4 commits intomainfrom Apr 14, 2026
Merged
Conversation
Users often copy the full MCP protocol endpoint URL from their Claude config (e.g. https://mcp.eterna.exchange/mcp) and set it as ETERNA_MCP_URL. REST endpoints like /migrate/link-legacy-key live at the base URL, so appending them to a URL already ending in /mcp produces /mcp/migrate/link-legacy-key which returns 404. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
48cff70 to
29c2b94
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Root cause
Users copy the full MCP protocol URL from their Claude config (e.g.
https://mcp.staging.eterna.exchange/mcp) and set it asETERNA_MCP_URL. WhenlinkLegacyKeycalls${mcpEndpoint}/migrate/link-legacy-key, it produces/mcp/migrate/link-legacy-keywhich returns 404 — the REST endpoint lives at/migrate/link-legacy-key, not under the MCP protocol path.Fix
Strip a trailing
/mcpfrom the resolved URL. BothETERNA_MCP_URL=https://mcp.eterna.exchangeandETERNA_MCP_URL=https://mcp.eterna.exchange/mcpnow produce the correct base URLhttps://mcp.eterna.exchange.Test plan
eterna loginwithETERNA_MCP_URL=https://mcp.staging.eterna.exchange/mcpandETERNA_MCP_KEYset → link succeeds (no 404)eterna loginwithETERNA_MCP_URL=https://mcp.staging.eterna.exchange→ still works (no regression)eterna loginwith onlyETERNA_ENDPOINTset → URL derivation still correct🤖 Generated with Claude Code