Skip to content

fix: strip trailing /mcp from ETERNA_MCP_URL#3

Merged
matmilbury merged 4 commits intomainfrom
fix/mcp-url-trailing-slash
Apr 14, 2026
Merged

fix: strip trailing /mcp from ETERNA_MCP_URL#3
matmilbury merged 4 commits intomainfrom
fix/mcp-url-trailing-slash

Conversation

@matmilbury
Copy link
Copy Markdown
Contributor

Root cause

Users copy the full MCP protocol URL from their Claude config (e.g. https://mcp.staging.eterna.exchange/mcp) and set it as ETERNA_MCP_URL. When linkLegacyKey calls ${mcpEndpoint}/migrate/link-legacy-key, it produces /mcp/migrate/link-legacy-key which returns 404 — the REST endpoint lives at /migrate/link-legacy-key, not under the MCP protocol path.

Fix

Strip a trailing /mcp from the resolved URL. Both ETERNA_MCP_URL=https://mcp.eterna.exchange and ETERNA_MCP_URL=https://mcp.eterna.exchange/mcp now produce the correct base URL https://mcp.eterna.exchange.

Test plan

  • eterna login with ETERNA_MCP_URL=https://mcp.staging.eterna.exchange/mcp and ETERNA_MCP_KEY set → link succeeds (no 404)
  • eterna login with ETERNA_MCP_URL=https://mcp.staging.eterna.exchange → still works (no regression)
  • eterna login with only ETERNA_ENDPOINT set → URL derivation still correct

🤖 Generated with Claude Code

matmilbury and others added 3 commits April 14, 2026 09:51
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>
@matmilbury matmilbury force-pushed the fix/mcp-url-trailing-slash branch from 48cff70 to 29c2b94 Compare April 14, 2026 10:40
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@matmilbury matmilbury merged commit 17fe3de into main Apr 14, 2026
1 check passed
@matmilbury matmilbury deleted the fix/mcp-url-trailing-slash branch April 14, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant