Commit graph

1,427 commits

Author SHA1 Message Date
Jeremiah Lowin
ef1368fda5 Remove unclear comment about validate_call
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 08:36:25 -04:00
Jeremiah Lowin
7a793f4309 Fix prompt argument type annotation to support mixed typing
Updated FunctionPrompt.render() to accept dict[str, Any] instead of
dict[str, str | Context] to preserve the developer experience of
passing properly typed arguments while also supporting string-only
arguments from MCP clients.

The _convert_string_arguments method now intelligently handles both
scenarios:
- Already-typed arguments are passed through unchanged
- String arguments are converted to expected types when needed

This maintains backward compatibility while enabling MCP spec compliance.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 08:34:49 -04:00
Jeremiah Lowin
3933f4f96c
Merge pull request #904 from jlowin/feature/fastmcp-inspect-command 2025-06-21 20:20:02 -04:00
Jeremiah Lowin
84d5750f6d Update cli.mdx
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 20:08:29 -04:00
Jeremiah Lowin
8506f78453 Fix event loop conflict in inspect CLI command
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 20:04:39 -04:00
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
4741d9ea86
Merge pull request #902 from jlowin/docs 2025-06-20 20:49:05 -04:00
Jeremiah Lowin
e245155bc5 Simplify docs nav 2025-06-20 20:48:42 -04:00
Jeremiah Lowin
337c2f8db5
Merge pull request #897 from owtaylor/openapi-recursive-components 2025-06-20 18:43:27 -04:00
Jeremiah Lowin
ecd5aeeed8
Merge pull request #900 from jlowin/fix-api-ref-rendering 2025-06-20 18:32:27 -04:00
zzstoatzz
98a91cbd9e fix escaping problem 2025-06-20 17:15:33 -05:00
zzstoatzz
094d259389 remove xtra newline 2025-06-20 17:09:30 -05:00
zzstoatzz
006341871e ope 2025-06-20 17:08:24 -05:00
zzstoatzz
a7e3ae47bf fix rendering for some pages 2025-06-20 17:07:19 -05:00
Jeremiah Lowin
1aaadf25e9
Merge pull request #893 from jlowin/api-ref 2025-06-20 16:39:15 -04: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
zzstoatzz
5afe5b793e update path and mdxify 2025-06-20 12:59:11 -05:00
Jeremiah Lowin
55a99c40c1
Merge pull request #896 from jlowin/trailing-slash 2025-06-20 13:13:56 -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
fb9161d745
Merge pull request #895 from jlowin/claude-wt-20250620-120729 2025-06-20 12:28:51 -04:00
Jeremiah Lowin
ac252fc28f Fix CORS documentation example to properly handle preflight requests
The previous example only allowed GET methods, causing browser preflight
requests to fail with "Disallowed CORS method" errors. Updated to include
the required parameters for proper CORS support with MCP clients.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 12:27:22 -04:00
Jeremiah Lowin
f97ace175f
Merge pull request #894 from jlowin/claude-wt-20250620-120811 2025-06-20 12:25:01 -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
a0242e1c68
Merge pull request #892 from jlowin/claude-wt-20250620-113451 2025-06-20 11:54:52 -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
4f4f27a3d2
Merge pull request #882 from jlowin/docs-session-id-update 2025-06-19 18:39:34 -04:00
Jeremiah Lowin
28fe5082d2 Add session_id to context documentation
Fast follow to #881 to document the new session_id property.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 18:35:59 -04:00
Jeremiah Lowin
5154f87f30
Merge pull request #881 from jlowin/dev-20250619-173841 2025-06-19 18:27:00 -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
ce8b43f282
Merge pull request #870 from jlowin/middleware-2 2025-06-19 18:15:36 -04:00
Jeremiah Lowin
7ad9fb6e51
Merge pull request #880 from jlowin/dev-20250619-173915 2025-06-19 18:04:39 -04:00
Jeremiah Lowin
3ce613b43a Add CLAUDE.md with FastMCP development guidelines
Establishes preference for in-memory transport when testing/investigating FastMCP servers, and recommends StreamableHttp over SSE for HTTP transport needs.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 18:00:53 -04:00
Jeremiah Lowin
dee2f33a81 Update doc icons 2025-06-19 17:28:00 -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
703589e6f5 Add proxy middleware test 2025-06-19 15:00:11 -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