-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix FastMCP integration tests and transport security #1001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
spacelord16
wants to merge
10
commits into
modelcontextprotocol:main
Choose a base branch
from
spacelord16:fix-fastmcp-integration-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix FastMCP integration tests and transport security #1001
spacelord16
wants to merge
10
commits into
modelcontextprotocol:main
from
spacelord16:fix-fastmcp-integration-tests
+306
−173
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spacelord16
commented
Jun 21, 2025
bac1aed
to
0dc38ff
Compare
- Fix transport security to properly handle wildcard '*' in allowed_hosts and allowed_origins - Replace problematic integration tests that used uvicorn with direct manager testing - Remove hanging and session termination issues by testing FastMCP components directly - Add comprehensive tests for tools, resources, and prompts without HTTP transport overhead - Ensure all FastMCP server tests pass reliably and quickly - Add proper type annotations to satisfy pyright static analysis
…sync resource function
754095a
to
5966a61
Compare
Resolved conflicts in: - tests/issues/test_188_concurrency.py: Adopted main branch's event-based concurrency testing approach - tests/server/fastmcp/test_integration.py: Adopted main branch's comprehensive integration tests using server examples All conflicts resolved and tests should pass.
…nd tool names - Fix ClientSession callback registration to use constructor parameters instead of request_context.session - Update tool names to match actual example servers: - long_running_task (not slow_operation) for progress testing - generate_poem (not analyze_sentiment) for sampling testing - book_table (not book_restaurant) for elicitation testing - process_data (not send_notification) for notifications testing - Fix completion test to test prompts instead of non-existent tools - All integration tests now pass (16/16)
- Fix line length and formatting to match project style guidelines - No functional changes, only cosmetic formatting improvements
- Improve stream cleanup order in Windows stdio client - Add comprehensive exception handling for resource errors - Handle process termination edge cases better - Prevent race conditions in async stream cleanup
- Fix ClosedResourceError/BrokenResourceError in streamable HTTP client - Improve stream cleanup order and exception handling in SSE client - Add robust resource cleanup to WebSocket client - Prevent resource leaks and race conditions on Windows - Handle all anyio stream exceptions gracefully across all transports This resolves Windows-specific test failures in Python 3.12/3.13 by ensuring proper async resource cleanup in all MCP client transports.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.