Skip to content

fix: use hostname as MCP HTTP/SSE server_name - #7048

Merged
Vidit-Ostwal merged 1 commit into
mainfrom
luzk/mcp-tool-traces
Aug 19, 2026
Merged

fix: use hostname as MCP HTTP/SSE server_name#7048
Vidit-Ostwal merged 1 commit into
mainfrom
luzk/mcp-tool-traces

Conversation

@lucasgomide

@lucasgomide lucasgomide commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

HTTP and SSE MCP connections used the raw URL as server_name, so traces titled the row with the full endpoint including query params. _get_server_info now emits the hostname and keeps the full URL on server_url.

Connection events used the raw endpoint as `server_name`, so traces
titled the row with the full Bright Data URL including query params.
HTTP and SSE `_get_server_info` now emit the hostname and keep the
full URL on `server_url`.
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 308207eb-8700-4c33-b455-f2b408e7a8b2

📥 Commits

Reviewing files that changed from the base of the PR and between f0e00df and d6312d0.

📒 Files selected for processing (2)
  • lib/crewai/src/crewai/mcp/client.py
  • lib/crewai/tests/mcp/test_client_server_info.py

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The MCP client now uses URL hostnames as server names for HTTP and SSE transports. It preserves the original server URLs and adds tests for hostname, port, transport, and stdio naming behavior.

Changes

MCP server name normalization

Layer / File(s) Summary
Server info naming and validation
lib/crewai/src/crewai/mcp/client.py, lib/crewai/tests/mcp/test_client_server_info.py
The client derives HTTP and SSE server names from URL hostnames, with a fallback to the original URL. Tests cover hostname and port handling, URL preservation, transport labels, and stdio command formatting.

Suggested reviewers: greysonlalonde

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: using the hostname for MCP HTTP and SSE server names.
Description check ✅ Passed The description accurately explains the server_name change and the preservation of the full URL in server_url.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch luzk/mcp-tool-traces

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Vidit-Ostwal
Vidit-Ostwal merged commit dabd123 into main Aug 19, 2026
58 checks passed
@Vidit-Ostwal
Vidit-Ostwal deleted the luzk/mcp-tool-traces branch August 19, 2026 13:22

@renatonitta renatonitta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants