fastmcp/tests/server/middleware
Jeremiah Lowin 12f2422e18
Refactor resource behavior and add meta support (#2598)
* feat: make ResourceContent the canonical internal type for resources

Add Resource._read() private method that always returns ResourceContent,
maintaining backwards compatibility for custom resources returning str/bytes
from read(). Includes deprecation warning when str/bytes is returned.

* fix: address review feedback for ResourceContent

- Remove ResourceContent from root exports (import from fastmcp.resources)
- Fix FunctionResource.read() return type to str | bytes | ResourceContent
- Decode base64 blobs in proxy when receiving from remote servers
- Preserve meta in ProxyResource cached content

* fix: add empty result guards in proxy resource reads
2025-12-13 11:45:38 -05:00
..
__init__.py Add single-component methods 2025-06-18 19:47:19 -04:00
test_caching.py [2.14] SEP-1686 tasks (#2378) 2025-12-04 20:10:35 -05:00
test_error_handling.py transform NotFoundError to standard MCP error (#2133) 2025-10-18 11:46:57 -04:00
test_initialization_middleware.py feat: handle error from the initialize middleware (#2531) 2025-12-10 15:51:51 -05:00
test_logging.py refactor: move task attribute to function-based variants only [SEP-1686] (#2560) 2025-12-05 21:05:42 -05:00
test_middleware.py Support initialize requests in middleware (#1546) 2025-10-05 10:20:13 -04:00
test_rate_limiting.py Support initialize requests in middleware (#1546) 2025-10-05 10:20:13 -04:00
test_timing.py Use lowercase namespace for fastmcp logger (#1791) 2025-09-26 12:13:02 -04:00
test_tool_injection.py Refactor resource behavior and add meta support (#2598) 2025-12-13 11:45:38 -05:00