- TransformedTool.run() now returns ToolResult instead of list[ContentBlock]
- forward() and forward_raw() return ToolResult from parent tools
- Transform functions can return ToolResult for full control or any value for auto-wrapping
- Maintains backward compatibility with existing transform functions
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Tools can return StructuredOutput() for explicit structured data
- Tools with output_schema automatically return structured data
- Client hydrates structured responses into typed objects
- Maintains backward compatibility with unstructured-only tools
Because the server now validates inputs, its no longer viable to provide a JSON string where e.g. an array is expected, so we can entirely remove FastMCP's "legacy json parsing" support from 1.x.
This is a breaking change (for legacy opt-in behavior)
Fixes breaking changes from mcp-python-sdk PR #982 which updated
BearerAuthBackend to use TokenVerifier protocol instead of OAuth providers.
Changes:
- Add verify_token() method to BearerAuthProvider implementing TokenVerifier protocol
- Add verify_token() method to InMemoryOAuthProvider implementing TokenVerifier protocol
- Update BearerAuthBackend usage in setup_auth_middleware_and_routes() to pass TokenVerifier
- Add comprehensive unit tests for TokenVerifier implementations
- Add integration tests for BearerAuthBackend with TokenVerifier
- Add tests for HTTP auth setup functions
All existing functionality preserved with full backwards compatibility.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update mount() calls to use keyword arguments (server, prefix)
- Replace private API access with public async methods (get_tools, get_resources)
- Fix resource URI handling to use URL parsing instead of string prefixes
- Update resource access to use _mcp_read_resource with proper URI format
- Add urllib.parse import for URL parsing functionality
The mounting API and resource handling changed in recent fastmcp versions,
breaking the mount_example.py functionality. This update ensures the example
works correctly with fastmcp v2.9.0.
Tested on: fastmcp v2.9.0
Previously, external schema references (URLs) in OpenAPI schemas were
silently passed through and only failed during JSON schema validation
with confusing "failed to match exactly one schema" errors.
This change:
- Detects external references in _replace_ref_with_defs() and raises clear error messages
- Updates exception handlers to propagate external reference errors while preserving other error handling
- Adds comprehensive test coverage for external reference detection
- Provides helpful error messages explaining that FastMCP only supports local schema references
Fixes#926🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace hasattr(param_in, 'value') with isinstance(param_in, Enum)
for more robust enum detection as suggested in review.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes issue where ParameterLocation enum values from openapi_pydantic
were not properly converted to strings, causing validation errors.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements comprehensive notification system for tools, resources, and prompts with automatic client updates and flexible message handlers.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove redundant `{e}` interpolation from logger.exception() calls.
Since logger.exception() automatically logs the full exception traceback,
including `{e}` in the message causes duplicate error output.
Fixes#936🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>