Commit graph

627 commits

Author SHA1 Message Date
Jeremiah Lowin
bc1e185141 Use dataclasses.asdict() for better maintainability
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 16:43:40 -04:00
Jeremiah Lowin
6a3a3077b7 Add fastmcp inspect command with detailed server analysis
- Add comprehensive server inspection utility supporting both FastMCP 1.x and 2.x
- Create detailed info dataclasses for tools, prompts, resources, and templates
- Implement CLI command with path:object notation and JSON output
- Add version reporting (fastmcp_version, mcp_version, server_version)
- Include comprehensive unit tests for utilities and CLI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 16:40:54 -04:00
Jeremiah Lowin
337c2f8db5
Merge pull request #897 from owtaylor/openapi-recursive-components 2025-06-20 18:43:27 -04:00
zzstoatzz
094d259389 remove xtra newline 2025-06-20 17:09:30 -05:00
Owen W. Taylor
14d1b8a94d openapi: Rewrite recursive #/components/schemas/ references
When a schema referenced another schema as #/components/schemas/...
that wasn't properly rewritten into #/$defs/..
2025-06-20 14:34:47 -04:00
Owen W. Taylor
bbf8165636 openapi: Improve pruning of unused defs
Defs that are used only by other unused defs were counted as
used. Fix this by tracing what defs use other defs recursively.
2025-06-20 14:34:41 -04:00
Jeremiah Lowin
fbe2fc3533 Add transport handling for trailing slashes 2025-06-20 13:12:23 -04:00
Jeremiah Lowin
18ae625fef Update docs and test 2025-06-20 13:06:48 -04:00
Jeremiah Lowin
d1ded43a43 Merge branch 'main' into trailing-slash 2025-06-20 12:54:09 -04:00
Jeremiah Lowin
ac95a3aaaf Update http.py 2025-06-20 12:53:42 -04:00
Jeremiah Lowin
b37686cf15 Use trailing slashes 2025-06-20 12:52:42 -04:00
Jeremiah Lowin
4b303f1ae0 Fix StreamableHTTP redirect issue for MCP spec compliance
Resolves 307 redirect from /mcp to /mcp/ by replacing Mount with explicit Route entries for both path variations. The MCP specification requires a single endpoint to handle both GET and POST requests without redirects.

Changes:
- Replace Mount with Route for both /mcp and /mcp/ paths
- Add PathNormalizingASGIApp wrapper to normalize trailing slashes for MCP SDK
- Apply same pattern to SSE transport for consistency
- Ensure both auth and non-auth configurations work correctly

This fixes the redirect issue mentioned in GitHub issue #828.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 12:29:25 -04:00
Jeremiah Lowin
a2f406faa4 Apply pre-commit formatting fixes 2025-06-20 12:17:47 -04:00
Jeremiah Lowin
42460480de Fix BearerAuthProvider audience type annotations to support List[str]
The audience parameter was typed as `str | None` but the implementation
already supported `List[str]`. This fix aligns the type annotations with
the actual functionality and adds comprehensive validation logic for all
audience type combinations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 12:13:00 -04:00
Jeremiah Lowin
7b5ef3e5e5 Use specific ValidationError instead of broad Exception catch
Addresses PR feedback to use more specific exception handling for
URL validation failures.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 11:50:16 -04:00
Jeremiah Lowin
40ce687d0d Fix JWT issuer validation to support string values per RFC 7519
Resolves issue where BearerAuthProvider rejected tokens with non-URL
issuer claims. Works around the underlying SDK's URL validation while
maintaining RFC 7519 compliance for JWT processing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 11:47:34 -04:00
Jeremiah Lowin
60c6441d7b Fix formatting per pre-commit hooks
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 18:22:02 -04:00
Jeremiah Lowin
370c44b745
Merge branch 'main' into dev-20250619-173841 2025-06-19 18:21:18 -04:00
Jeremiah Lowin
942fd5c13e Add session_id property to Context for session-based data sharing
Exposes MCP session ID from HTTP headers to enable Redis-based data sharing
between tools. Returns None for stdio/memory transports as expected.

Fixes #875, addresses python-sdk#986, python-sdk#942, python-sdk#485

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 18:16:34 -04:00
Jeremiah Lowin
085c5b765b Update docs and tests 2025-06-19 17:06:54 -04:00
Jeremiah Lowin
0beb79d11a Minor updates 2025-06-19 15:28:55 -04:00
Jeremiah Lowin
725c061d66 Fix import prefix behavior 2025-06-19 15:19:31 -04:00
Jeremiah Lowin
2ae5a800e7 Fix proxy servers 2025-06-19 14:50:58 -04:00
Jeremiah Lowin
2e31b2704b Update tests 2025-06-19 14:05:19 -04:00
Jeremiah Lowin
d8235e1af7 Clean up mode kwarg 2025-06-19 12:44:34 -04:00
Jeremiah Lowin
35e13ef9bf Update resource manager 2025-06-19 12:22:14 -04:00
Jeremiah Lowin
6b1ba049c7 Update prompt manager 2025-06-19 11:33:46 -04:00
Jeremiah Lowin
607125abf8 Update tool manager 2025-06-19 11:04:50 -04:00
Jeremiah Lowin
cafa11d3ad Fix missing proxy arg 2025-06-18 21:57:19 -04:00
Jeremiah Lowin
dbb6a76f63 Update proxy behavior and conflict resolution 2025-06-18 21:53:03 -04:00
Jeremiah Lowin
a42c0c40b0 Add middleware for all current handlers 2025-06-18 21:41:28 -04:00
Jeremiah Lowin
c183e3a99c Updated list_tools 2025-06-18 21:17:38 -04:00
Jeremiah Lowin
e11417c3c2 Merge main 2025-06-18 21:10:25 -04:00
Jeremiah Lowin
e365c0b6fb Merge branch 'main' into middleware-2 2025-06-18 21:08:18 -04:00
Jeremiah Lowin
a2bb2314c7 Add key to component 2025-06-18 21:05:11 -04:00
Jeremiah Lowin
0702bad1c2 Add single-component methods 2025-06-18 19:47:19 -04:00
Jeremiah Lowin
c39e68fa9a
Merge pull request #861 from jlowin/mounting 2025-06-18 16:49:15 -04:00
Jeremiah Lowin
8eaa6096b4 Make prefixes optional 2025-06-18 11:28:24 -04:00
Jeremiah Lowin
084e52badd Consolidate prefix logic 2025-06-17 20:23:47 -04:00
Ryan Malloy
cf56bdd15e allow dicts to be passed as annotations 2025-06-17 16:14:20 -06:00
Ryan Malloy
3deddf542e Add moree docs 2025-06-17 15:05:24 -06:00
Ryan Malloy
a37df5077a add missing parameter, DOH! 2025-06-17 14:51:04 -06:00
Ryan Malloy
909194dc89 add missing import, DOH! 2025-06-17 14:50:26 -06:00
Ryan Malloy
9788fabe19
Update README.md 2025-06-17 14:43:05 -06:00
Ryan Malloy
515cdd5cf5
Update mcp_mixin.py to include enabled, annotations, excluded_args, serializer
annotations: ToolAnnotations | None = None,
    exclude_args: list[str] | None = None,
    serializer: Callable[[Any], str] | None = None,
    enabled: bool | None = None,
2025-06-17 14:20:38 -06:00
Jeremiah Lowin
eeedd175a5
Merge pull request #848 from jlowin/positional-arg-version
Update version to not be positional
2025-06-16 10:04:10 -04:00
Jeremiah Lowin
97c21678f1
Merge pull request #843 from gorocode/feature/file-utility-type
Add File utility for wrapping binary data
2025-06-16 10:03:32 -04:00
Jeremiah Lowin
503e16ef31
Merge branch 'main' into positional-arg-version 2025-06-16 10:01:43 -04:00
Jeremiah Lowin
00d6fc500c
Merge pull request #842 from mkyutani/feature/add-version-parameter
Add version parameter to FastMCP constructor
2025-06-16 10:01:16 -04:00
Jeremiah Lowin
6af2baaa36 Enforce name/instructions as only positional args 2025-06-16 09:59:49 -04:00