Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Nov 8, 2025

Description

This PR attempts to address Issue #9118 by implementing automatic type inference for MCP server configurations. When a configuration includes a url property without an explicit type, Roo Code will now automatically infer the type as streamable-http.

Changes Made

  • Modified validateServerConfig method to auto-infer streamable-http when URL is present without explicit type
  • Updated ServerConfigSchema to prioritize streamable-http over sse for URL-based configs
  • SSE configuration now requires explicit type: "sse" specification
  • Added comprehensive test coverage for URL auto-inference scenarios

Benefits

  • Reduced Configuration Verbosity: Users no longer need to explicitly specify "type": "streamable-http" for every HTTP-based MCP server
  • Better Compatibility: Aligns with Cursor's simpler configuration format, making migration easier
  • Backward Compatibility: Existing configurations with explicit type specifications continue to work unchanged

Examples

Before (required explicit type):

{
  "mcpServers": {
    "docs-langchain": {
      "type": "streamable-http",
      "url": "https://docs.langchain.com/mcp"
    }
  }
}

After (type auto-inferred):

{
  "mcpServers": {
    "docs-langchain": {
      "url": "https://docs.langchain.com/mcp"
    }
  }
}

Testing

  • All existing tests pass ✅
  • Added 8 new test cases covering URL auto-inference scenarios
  • Tests verify both auto-inference and explicit type preservation

Related Issue

Fixes #9118

Feedback and guidance are welcome!


Important

Auto-infer 'streamable-http' type for MCP server configurations with URL in McpHub.ts, reducing configuration verbosity and adding comprehensive tests in McpHub.spec.ts.

  • Behavior:
    • validateServerConfig in McpHub.ts now auto-inferrs streamable-http type when url is present without explicit type.
    • ServerConfigSchema prioritizes streamable-http over sse for URL-based configs.
    • SSE configuration requires explicit type: "sse".
  • Testing:
    • Added 8 new test cases in McpHub.spec.ts for URL auto-inference scenarios.
    • Tests cover auto-inference, explicit type preservation, and invalid configurations.
  • Misc:
    • Updated error messages in McpHub.ts to reflect new auto-inference behavior.

This description was created by Ellipsis for 8630a96. You can customize this summary. It will automatically update as commits are pushed.

…uration

- Modified validateServerConfig to auto-infer streamable-http when URL is present without explicit type
- Updated ServerConfigSchema to prioritize streamable-http over SSE for URL configs
- SSE now requires explicit type specification
- Added comprehensive test coverage for URL auto-inference
- Maintains full backward compatibility with existing configs

Fixes #9118
@roomote roomote bot requested review from cte, jr and mrubens as code owners November 8, 2025 08:04
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Nov 8, 2025
@roomote
Copy link
Author

roomote bot commented Nov 8, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation successfully:

  • Auto-infers streamable-http type when URL is present without explicit type
  • Requires explicit type="sse" specification for SSE connections
  • Maintains full backward compatibility with existing configurations
  • Includes comprehensive test coverage (8 new test cases)
  • Properly handles all validation edge cases

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Auto-infer streamable-http type for MCP servers with URL configuration

3 participants