Conversation
…357) Add `streamable_http` as a supported transport type for `MCPProvider`, enabling connections to MCP servers that use the Streamable HTTP protocol (e.g. Tavily remote endpoints). Previously only SSE transport was supported, causing silent 5-minute timeouts when connecting to incompatible endpoints. - Expand `MCPProvider.provider_type` to `Literal["sse", "streamable_http"]` (default remains `"sse"` for backwards compatibility) - Route `streamable_http` providers through `streamablehttp_client` from the MCP SDK in `MCPIOService._get_or_create_session()` - Handle variable-length context manager results from MCP transport clients - Add `DataDesigner.list_mcp_tool_names()` for discovering available tools - Update CLI form builder and controller to support the new transport option - Add tests for streamable_http config, session creation, and form builder Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR extends
|
packages/data-designer/src/data_designer/cli/forms/mcp_provider_builder.py
Outdated
Show resolved
Hide resolved
Additional Comments (1)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! Prompt To Fix With AIThis is a comment left during a code review.
Path: packages/data-designer/src/data_designer/cli/forms/mcp_provider_builder.py
Line: 22-24
Comment:
Update docstring to mention Streamable HTTP support
```suggestion
"""Builds interactive forms for MCP provider configuration.
Supports both MCPProvider (remote SSE and Streamable HTTP) and LocalStdioMCPProvider (subprocess).
"""
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise. |
eric-tramel
left a comment
There was a problem hiding this comment.
LGTM. Food for thought -- an Option C is to use a auto-detect/fallback on health check. This would mean that, unless it was specifically set by the user, we could "just" find which one of these two modes works and then run with it accordingly.
| """ | ||
|
|
||
| provider_type: Literal["sse"] = "sse" | ||
| provider_type: Literal["sse", "streamable_http"] = "sse" |
There was a problem hiding this comment.
Nit: Do we opt for StrEnum?
There was a problem hiding this comment.
Nit: Do we opt for StrEnum?
We use a mix of string literals and string enums in this code base. We can definitely come back and change this to a StrEnum later.
True, but we'd have to update the state from health check which we currently don't do. Option C presented in the gh issue was to auto fall back in a try-catch, but that adds a bit more latency. We can re-visit this later if we hear more feedback. |
…port-support-for-remote-mcp-providers
📋 Summary
Adds
streamable_httpas a supported transport type forMCPProvider, resolving #357. Previously, remote MCP providers only supported SSE transport, causing silent 5-minute timeouts when connecting to Streamable HTTP-only endpoints (e.g. Tavily). Also addsDataDesigner.list_mcp_tool_names()for discovering available tools on a configured provider, and updates documentation across the board.🔄 Changes
✨ Added
streamable_httptransport option onMCPProvider.provider_type(default remains"sse"for backwards compatibility)DataDesigner.list_mcp_tool_names()— convenience method to discover tools exposed by a configured MCP providerlist_tool_names()helper inmcp.iomodulestub_streamable_http_providertest fixture🔧 Changed
MCPIOService._get_or_create_session()— routesstreamable_httpproviders throughstreamablehttp_client, handles variable-length context manager results (3-tuple fromstreamablehttp_clientvs 2-tuple fromsse_client)MCPProviderFormBuilder— renamed_run_sse_form→_run_remote_formto handle both SSE and Streamable HTTP with appropriate labelsMCPProviderController._select_provider— shows "Streamable HTTP" vs "SSE" in provider display📚 Docs
mcp-providers.md— updated overview table, fields table, Python examples, and YAML examples for both transportsconfigure-mcp-cli.md— added Streamable HTTP to provider type selection and updated endpoint examplescode_reference/mcp.md— updated MCPProvider description to mention both transports🔍 Attention Areas
io.py#L222-L223— Context manager result unpacking changed fromread, write = ...toctx_result[0], ctx_result[1]to handle both 2-tuple (SSE) and 3-tuple (Streamable HTTP) returns from the MCP SDKmcp.py#L47—provider_typeexpanded fromLiteral["sse"]toLiteral["sse", "streamable_http"]— this changes the Pydantic discriminator union; verify deserialization of existing configs still works🤖 Generated with AI