Skip to content

fix(mcp): normalize LaunchDarkly hrefs to API response origin in tool output#60

Open
alohaninja wants to merge 1 commit intomainfrom
feature/tools-link-normalization
Open

fix(mcp): normalize LaunchDarkly hrefs to API response origin in tool output#60
alohaninja wants to merge 1 commit intomainfrom
feature/tools-link-normalization

Conversation

@alohaninja
Copy link

@alohaninja alohaninja commented Mar 24, 2026

Summary

  • Updates formatResult to normalize href links using the actual response origin, including relative and canonical LaunchDarkly host URLs.
  • Prevents mismatched .com/.us links from leaking into tool output when requests are served from alternate domains.
  • Adds focused tests for .com, .us, and relative-path link normalization behavior.
  • Includes a small JSON content-type check fix so normalization is consistently applied to JSON responses.

Context

"Take me there" - should open up the proper domain relative to MCP configuration - currently always uses .com

Test plan

  • bun test tests/tools.test.js

Made with Cursor


Open with Devin

Keeps returned flag links aligned with the API response domain and adds tests for canonical host and relative URL normalization.

Made-with: Cursor
@alohaninja alohaninja requested a review from nieblara March 24, 2026 18:56
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

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