Commit graph

1,564 commits

Author SHA1 Message Date
Jeremiah Lowin
ddb557ba30 Update for 'result' kwarg instead of 'value' 2025-06-27 15:44:46 -04:00
Jeremiah Lowin
d8dc28b9b2 Add structured content & update almost all tests 2025-06-27 15:40:52 -04:00
Jeremiah Lowin
2b313bc3ff Update tool transformation for ToolResult compatibility
- 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>
2025-06-26 22:02:04 -04:00
Jeremiah Lowin
21d4ce092c Add structured output support
- 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
2025-06-26 21:15:25 -04:00
Jeremiah Lowin
7f0622b707 Fix contrib tests 2025-06-26 20:17:02 -04:00
Jeremiah Lowin
1e29149d5f Merge branch 'main' into output-schema 2025-06-26 19:30:35 -04:00
Jeremiah Lowin
85cca273de
Merge pull request #887 from jlowin/protocol-update
MCP 6/18/25: Staging PR
2025-06-26 18:45:10 -04:00
Jeremiah Lowin
33263582b8 Fix typing 2025-06-26 18:33:32 -04:00
Jeremiah Lowin
78f0196db5 Fix OpenAPI tests 2025-06-26 18:21:52 -04:00
Jeremiah Lowin
7b9696405b Remove legacy json parsing
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)
2025-06-26 18:19:43 -04:00
Jeremiah Lowin
9d51bca0d8 Merge branch 'main' into protocol-update 2025-06-26 18:13:59 -04:00
Jeremiah Lowin
ddb38bacc4 Fix middleware tests 2025-06-26 18:13:32 -04:00
Jeremiah Lowin
6b2df6be51 Fix middleware tests 2025-06-26 17:57:30 -04:00
Jeremiah Lowin
aa66b81b73 Merge branch 'protocol-update' of https://github.com/jlowin/fastmcp into protocol-update 2025-06-26 15:22:41 -04:00
Jeremiah Lowin
4fb778c608
Merge pull request #966 from jlowin/protocol-update-auth
MCP 6/18/25: Update auth primitives
2025-06-26 15:22:28 -04:00
Jeremiah Lowin
fa83f38dc4 Update uv.lock 2025-06-26 15:20:51 -04:00
Jeremiah Lowin
b98b080c98 Implement TokenVerifier protocol for mcp-python-sdk compatibility
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>
2025-06-26 15:08:31 -04:00
Jeremiah Lowin
2dcd6e19ab
Merge pull request #962 from jlowin/pin-mcp v2.9.2
Pin mcp
2025-06-26 11:01:37 -04:00
Jeremiah Lowin
436aa01bb2 Update uv.lock 2025-06-26 10:59:10 -04:00
Jeremiah Lowin
947a02b1f2 Pin mcp 2025-06-26 10:57:11 -04:00
Jeremiah Lowin
0624a4ae53 Update tests for server input validation 2025-06-26 10:56:21 -04:00
Jeremiah Lowin
5ca7a118a6 Fix typeddict imports 2025-06-26 10:09:02 -04:00
Jeremiah Lowin
757c037a04
Merge pull request #960 from jlowin/version
Fix version badge for messages
2025-06-26 09:41:06 -04:00
Jeremiah Lowin
5fc82f4fef Fix version badge for messages 2025-06-26 09:40:49 -04:00
Jeremiah Lowin
3de57fa069
Merge pull request #939 from jlowin/notifications v2.9.1
Add automatic MCP list change notifications and client message handling
2025-06-26 09:38:03 -04:00
Jeremiah Lowin
1fe4eb7a9d
Merge branch 'main' into notifications 2025-06-26 09:36:26 -04:00
Jeremiah Lowin
35d04d645f Update pyproject.toml 2025-06-26 09:26:07 -04:00
Jeremiah Lowin
68ab760240 Merge branch 'main' into protocol-update 2025-06-26 09:25:39 -04:00
Jeremiah Lowin
1bb3c1404f
Merge pull request #957 from rajephon/main
fix(examples): update mount_example.py to work with current fastmcp API
2025-06-26 09:24:22 -04:00
Chanwoo Noh
7a1e332aae fix: update mount_example.py for current fastmcp API
- 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
2025-06-26 14:44:51 +09:00
Jeremiah Lowin
159324ea46
Merge pull request #954 from jlowin/claude-wt-20250625-210215
Fix external schema reference handling in OpenAPI parser
2025-06-25 21:39:49 -04:00
Jeremiah Lowin
f99ac2ea70
Merge pull request #953 from jlowin/claude-wt-20250625-195151
Fix parameter location enum handling in OpenAPI parser
2025-06-25 21:38:36 -04:00
Jeremiah Lowin
6584750667 Fix external schema reference handling in OpenAPI parser
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>
2025-06-25 21:25:06 -04:00
Jeremiah Lowin
cf72bbf94f
Merge branch 'main' into claude-wt-20250625-195151 2025-06-25 21:01:07 -04:00
Jeremiah Lowin
e68fa0653b Use proper isinstance(Enum) check instead of hasattr
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>
2025-06-25 21:00:39 -04:00
Jeremiah Lowin
3c160d60d6
Merge pull request #952 from jlowin/claude-wt-20250625-200736 2025-06-25 20:49:29 -04:00
nate nowack
0f3c7d144c Merge pull request #949 from jlowin/fix-doc-render
fix a couple parsing issues
2025-06-25 20:43:42 -04:00
Jeremiah Lowin
f566e9a60f Fix parameter location enum handling in OpenAPI parser
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>
2025-06-25 20:38:00 -04:00
nate nowack
c79665c76e
Merge pull request #949 from jlowin/fix-doc-render
fix a couple parsing issues
2025-06-25 11:28:12 -05:00
zzstoatzz
3d43e80b8e fix a couple parsing issues 2025-06-25 11:26:22 -05:00
Jeremiah Lowin
00ed9a07bc
Merge pull request #947 from jlowin/fix-right-nav 2025-06-25 11:55:39 -04:00
Jeremiah Lowin
029007e97e Update CSS 2025-06-25 11:55:03 -04:00
zzstoatzz
66dfeef483 regen api ref 2025-06-25 09:43:22 -05:00
Jeremiah Lowin
7369fbeefa
Merge pull request #938 from jlowin/claude-wt-20250624-182536 2025-06-24 22:49:27 -04:00
Jeremiah Lowin
872f37299e Fix typing 2025-06-24 22:49:01 -04:00
Jeremiah Lowin
38036b1f42 Add automatic MCP list change notifications and client message handling
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>
2025-06-24 22:33:06 -04:00
Jeremiah Lowin
272559a993 Fix duplicate error logging in exception handlers
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>
2025-06-24 22:04:27 -04:00
Jeremiah Lowin
c8da2432c3
Merge pull request #935 from jlowin/source-link-api-ref 2025-06-24 16:54:49 -04:00
zzstoatzz
034fa72b9c run api ref gen 2025-06-24 13:02:03 -05:00
Jeremiah Lowin
9bbca08862
Merge pull request #929 from jlowin/docs1 2025-06-23 19:51:26 -04:00