fastmcp/tests
Xing 03b62d2e3d
feat: handle error from the initialize middleware (#2531)
* feat: handle error from the initialize middleware

In some situation, the initialize middleware can check the status of the
server and decide to raise an error.

Example use case: in a FastMCPProxy, an initialization middleware
overrides the on_initialize method and connect to the underlying proxied
client. When client respond with error, I want to pass this error to the
client.

* docs update

* test: use McpError assertions now that exception propagation is fixed

- Update tests to catch McpError specifically instead of generic Exception
- Remove commented-out code in low_level.py

---------

Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-12-10 15:51:51 -05:00
..
cli Remove enable_docket setting; Docket is now always on 2025-12-05 11:40:04 -05:00
client Expose get_session_id callback (#2486) 2025-12-09 12:24:11 -05:00
contrib feat: Add title, annotations and meta to mixin decorators 2025-10-10 14:23:02 +05:30
deprecated Remove deprecated mount/import argument order and separator params (#2582) 2025-12-09 13:58:51 -05:00
experimental Switch to new OpenAPI parser as default (#2513) 2025-12-01 20:29:18 -05:00
integration_tests Improve rate limit detection for integration tests 2025-12-04 11:52:40 -05:00
prompts Add regression tests for functools.wraps + Context (#2524) (#2566) 2025-12-06 12:32:39 -05:00
resources Add regression tests for functools.wraps + Context (#2524) (#2566) 2025-12-06 12:32:39 -05:00
server feat: handle error from the initialize middleware (#2531) 2025-12-10 15:51:51 -05:00
tools Add execution field to base Tool class 2025-12-08 17:07:49 -05:00
utilities Fix: Include signature modification in create_function_without_params (#2563) 2025-12-06 11:57:36 -05:00
__init__.py Update type handling for resources 2024-11-29 19:42:46 -05:00
conftest.py fix: skip wait_closed() on Windows to avoid socket shutdown hang 2025-12-05 12:30:27 -05:00
test_examples.py Cleanup content conversion 2025-09-06 17:32:33 -05:00
test_mcp_config.py Bump ty to ==0.0.1a25 (#2350) 2025-11-02 20:02:45 -05:00