Conversation
WalkthroughThis change removes WebSocket transport (WSTransport) from the FastMCP client library. The WSTransport class is deleted from the transports module, and its export is removed from the public API. Documentation is updated to reflect this removal and recommends using StreamableHttpTransport as an alternative. The public API is reorganized to include FastMCPTransport, PythonStdioTransport, SSETransport, and related transports while removing WSTransport exports. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/fastmcp/client/__init__.py (1)
16-30: SSETransport lacks test coverage and user-facing documentation.SSETransport is exported in the public API but has:
- No dedicated test coverage (zero test files found)
- No user-facing documentation in docs/
- A well-implemented but completely untested transport
This pattern mirrors the removed WSTransport. Before exposing SSETransport as a public API, add test coverage and document its usage.
🧹 Nitpick comments (2)
docs/development/v3-notes/v3-features.mdx (1)
307-310: Consider adding migration guidance or context.The documentation correctly states that WSTransport has been removed and directs users to StreamableHttpTransport. However, it could benefit from:
- A brief explanation of why WSTransport was removed (mentioned in PR description: "never widely used, had no tests")
- A code example showing the migration path, similar to other breaking change sections in this file
Based on coding guidelines for MDX documentation.
📝 Suggested enhancement
### WSTransport Removed -The deprecated `WSTransport` client transport has been removed. Use `StreamableHttpTransport` instead. +The deprecated `WSTransport` client transport has been removed from the client module. WSTransport was never widely used and had no tests. Use `StreamableHttpTransport` for WebSocket-based communication: + +```python +# Before +from fastmcp.client import WSTransport +client = Client(WSTransport("ws://server/mcp")) + +# After +from fastmcp.client import StreamableHttpTransport +client = Client(StreamableHttpTransport("http://server/mcp")) +```docs/development/upgrade-guide.mdx (1)
13-16: Consider adding migration example for consistency.While the documentation clearly states the replacement, all other breaking changes in this guide include before/after code examples (see Mount Namespace Parameter at lines 30-40, Component Enable/Disable at lines 43-57, etc.). Adding a migration example would maintain consistency and help users understand the practical impact.
Based on coding guidelines: "Include complete, runnable code examples that users can copy and execute in MDX documentation."
📝 Suggested enhancement for consistency
### WSTransport Removed The deprecated `WSTransport` client transport has been removed. Use `StreamableHttpTransport` instead. + +<CodeGroup> +```python Before +from fastmcp.client import WSTransport + +transport = WSTransport("ws://localhost:8080/mcp") +client = Client(transport) +``` + +```python After +from fastmcp.client import StreamableHttpTransport + +transport = StreamableHttpTransport("http://localhost:8080/mcp") +client = Client(transport) +``` +</CodeGroup>
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docs/development/upgrade-guide.mdxdocs/development/v3-notes/v3-features.mdxsrc/fastmcp/client/__init__.pysrc/fastmcp/client/transports.py
💤 Files with no reviewable changes (1)
- src/fastmcp/client/transports.py
🧰 Additional context used
📓 Path-based instructions (4)
docs/**/*.mdx
📄 CodeRabbit inference engine (docs/.cursor/rules/mintlify.mdc)
docs/**/*.mdx: Use clear, direct language appropriate for technical audiences
Write in second person ('you') for instructions and procedures in MDX documentation
Use active voice over passive voice in MDX technical documentation
Employ present tense for current states and future tense for outcomes in MDX documentation
Maintain consistent terminology throughout all MDX documentation
Keep sentences concise while providing necessary context in MDX documentation
Use parallel structure in lists, headings, and procedures in MDX documentation
Lead with the most important information using inverted pyramid structure in MDX documentation
Use progressive disclosure in MDX documentation: present basic concepts before advanced ones
Break complex procedures into numbered steps in MDX documentation
Include prerequisites and context before instructions in MDX documentation
Provide expected outcomes for each major step in MDX documentation
End sections with next steps or related information in MDX documentation
Use descriptive, keyword-rich headings for navigation and SEO in MDX documentation
Focus on user goals and outcomes rather than system features in MDX documentation
Anticipate common questions and address them proactively in MDX documentation
Include troubleshooting for likely failure points in MDX documentation
Provide multiple pathways (beginner vs advanced) but offer an opinionated path to avoid overwhelming users in MDX documentation
Always include complete, runnable code examples that users can copy and execute in MDX documentation
Show proper error handling and edge case management in MDX code examples
Use realistic data instead of placeholder values in MDX code examples
Include expected outputs and results for verification in MDX code examples
Test all code examples thoroughly before publishing in MDX documentation
Specify language and include filename when relevant in MDX code examples
Add explanatory comments for complex logic in MDX code examples
Document all API...
Files:
docs/development/upgrade-guide.mdxdocs/development/v3-notes/v3-features.mdx
docs/**/*.{md,mdx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Documentation uses Mintlify framework. Files must be in docs.json to be included. Never modify docs/python-sdk/** (auto-generated)
Files:
docs/development/upgrade-guide.mdxdocs/development/v3-notes/v3-features.mdx
docs/**/*.{md,mdx}
📄 CodeRabbit inference engine (AGENTS.md)
docs/**/*.{md,mdx}: Code examples in documentation must explain before showing code and make blocks fully runnable (include imports)
Documentation structure: Headers form navigation guide with logical H2/H3 hierarchy. Content should be user-focused with sections motivating features (why) before mechanics (how). Use prose over code comments for important information
Never use 'This isn't...' or 'not just...' constructions in writing - state what something IS directly. Avoid defensive writing patterns
Files:
docs/development/upgrade-guide.mdxdocs/development/v3-notes/v3-features.mdx
src/fastmcp/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
src/fastmcp/**/*.py: Python ≥ 3.10 with full type annotations required
Prioritize readable, understandable code - clarity over cleverness. Avoid obfuscated or confusing patterns even if shorter
Follow existing patterns and maintain consistency in code implementation
Be intentional about re-exports - don't blindly re-export everything to parent namespaces. Core types defining a module's purpose should be exported. Specialized features can live in submodules. Only re-export to fastmcp.* for most fundamental types
Never use bare except - be specific with exception types
Files:
src/fastmcp/client/__init__.py
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T15:53:07.656Z
Learning: Applies to tests/**/*.py : Pass FastMCP servers directly to clients for testing without network complexity; only use HTTP transport when explicitly testing network features
📚 Learning: 2025-12-25T15:53:07.656Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T15:53:07.656Z
Learning: Applies to src/fastmcp/**/*.py : Be intentional about re-exports - don't blindly re-export everything to parent namespaces. Core types defining a module's purpose should be exported. Specialized features can live in submodules. Only re-export to fastmcp.* for most fundamental types
Applied to files:
src/fastmcp/client/__init__.py
📚 Learning: 2025-12-25T15:53:07.656Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T15:53:07.656Z
Learning: Applies to tests/**/*.py : Pass FastMCP servers directly to clients for testing without network complexity; only use HTTP transport when explicitly testing network features
Applied to files:
src/fastmcp/client/__init__.py
📚 Learning: 2025-12-25T15:53:07.656Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T15:53:07.656Z
Learning: Applies to src/fastmcp/**/*.py : Python ≥ 3.10 with full type annotations required
Applied to files:
src/fastmcp/client/__init__.py
🧬 Code graph analysis (1)
src/fastmcp/client/__init__.py (3)
src/fastmcp/client/auth/oauth.py (1)
OAuth(138-329)src/fastmcp/client/auth/bearer.py (1)
BearerAuth(11-17)src/fastmcp/client/transports.py (7)
ClientTransport(77-119)FastMCPTransport(820-889)NodeStdioTransport(561-611)PythonStdioTransport(479-529)StdioTransport(296-420)UvStdioTransport(614-690)UvxStdioTransport(693-755)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Run tests: Python 3.10 on ubuntu-latest
- GitHub Check: Run tests: Python 3.10 on windows-latest
- GitHub Check: Run tests with lowest-direct dependencies
- GitHub Check: Run tests: Python 3.13 on ubuntu-latest
🔇 Additional comments (1)
src/fastmcp/client/__init__.py (1)
1-14: LGTM! Clean removal of WSTransport and intentional expansion of public API.The changes correctly:
- Remove WSTransport from imports and exports
- Add FastMCPTransport and several Stdio transport variants to the public API
- Maintain alphabetical ordering for readability
- Keep imports and
__all__in syncThe expanded transport exports (FastMCPTransport, PythonStdioTransport, SSETransport, StdioTransport, UvStdioTransport, UvxStdioTransport) align with the provider-based architecture mentioned in v3 features, making these core transports more discoverable for users.
Based on learnings about intentional re-exports.
WSTransport was deprecated and directed users to StreamableHttpTransport. It was never widely used and had no tests. This removes it from the client module and documents the removal in the v3 upgrade guide.