fastmcp/tests/server
marvin-context-protocol[bot] 9cd457727d Fix stdio proxy race condition in concurrent connections
Resolves race condition where multiple parallel requests through FastMCP
proxy to stdio servers would fail with 'Received request before
initialization was complete' errors.

The issue occurred because each proxy operation created a new client that
tried to initialize simultaneously. Added _SynchronizedClientContext to
serialize stdio client initialization using asyncio semaphore while
preserving performance for non-stdio transports.

- Added _SynchronizedClientContext async context manager
- Enhanced ProxyManagerMixin with synchronized client context
- Updated all proxy managers to use synchronized context for stdio
- Added comprehensive tests with 20+ parallel operations
- All existing tests continue to pass

Co-authored-by: William Easton <strawgate@users.noreply.github.com>
2025-08-25 18:25:32 +00:00
..
auth Remove client info modifications (#1620) 2025-08-25 09:50:59 -04:00
http Remove trailing slash in unit tests (#1535) 2025-08-18 08:10:46 -04:00
middleware Add unit tests and docs for denying tool calls with middleware (#1333) 2025-08-01 16:55:42 -04:00
openapi Add _fastmcp meta namespace (#1290) 2025-07-29 15:07:53 -04:00
proxy Fix stdio proxy race condition in concurrent connections 2025-08-25 18:25:32 +00:00
__init__.py restore 1.x code 2025-04-09 11:54:42 -04:00
test_app_state.py Update docs and test 2025-06-20 13:06:48 -04:00
test_auth_integration.py Add audio support 2025-06-14 08:59:48 -04:00
test_context.py Remove invalid-argument-type ignore and fix type errors (#1588) 2025-08-22 20:19:22 -04:00
test_experimental_openapi_feature_flag.py Introduce experimental OpenAPI parser with improved performance and maintainability (#1209) 2025-07-21 16:17:36 -04:00
test_file_server.py Remove empty parens 2025-06-04 15:37:55 -04:00
test_import_server.py Ensure resource + template names are properly prefixed when importing/mounting (#1423) 2025-08-08 21:29:07 -04:00
test_logging.py Use anyio.event 2025-05-31 18:12:17 -04:00
test_mount.py Updates to tests 2025-08-24 10:59:01 -05:00
test_resource_prefix_formats.py Update tests 2025-06-19 14:05:19 -04:00
test_run_server.py Update tests for prompts 2025-06-04 16:37:41 -04:00
test_server.py feat: improve debugging for nested servers with server/client names and hierarchy visualization 2025-08-24 01:09:43 +00:00
test_server_interactions.py fix: eliminate pytest warnings (#1559) 2025-08-21 07:49:42 -04:00
test_streamable_http_no_redirect.py Improve redirect handling to address 307's (#1387) 2025-08-08 11:55:30 -04:00
test_tool_annotations.py Add structured content & update almost all tests 2025-06-27 15:40:52 -04:00
test_tool_exclude_args.py Add structured content & update almost all tests 2025-06-27 15:40:52 -04:00
test_tool_transformation.py Ensure transformed tools generate structured content (#1443) 2025-08-11 12:34:43 -04:00