Commit graph

1,446 commits

Author SHA1 Message Date
Jeremiah Lowin
133254ee25 Update docs 2025-06-22 13:34:36 -04:00
Jeremiah Lowin
3d2e2a5954 Update client features 2025-06-22 13:30:25 -04:00
Jeremiah Lowin
1adca653e3 Update overview
Co-Authored-By: Claude <claude@users.noreply.github.com>
2025-06-22 13:23:52 -04:00
Jeremiah Lowin
8e98d711fc Update client docs
Co-Authored-By: Claude <claude@users.noreply.github.com>
2025-06-22 13:18:28 -04:00
Jeremiah Lowin
d12cebce1f
Merge pull request #910 from jlowin/feature/client-side-prompt-argument-serialization 2025-06-22 10:39:07 -04:00
Jeremiah Lowin
993f3d7979 Update client.py 2025-06-22 10:35:37 -04:00
Jeremiah Lowin
a19a84e7a8
Update src/fastmcp/client/client.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-22 10:33:59 -04:00
Jeremiah Lowin
32269f5140 Update .pre-commit-config.yaml 2025-06-22 10:33:22 -04:00
Jeremiah Lowin
73e1aa2112 Apply pre-commit formatting changes
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 10:29:15 -04:00
Jeremiah Lowin
a343ee6a97
Merge pull request #906 from Jason-CKY/feat/custom-auth-mcpconfig 2025-06-22 10:27:58 -04:00
Jeremiah Lowin
dbf125b6ac Update client.mdx
Co-Authored-By: Claude <claude@users.noreply.github.com>
2025-06-22 10:20:03 -04:00
Jeremiah Lowin
a7f14d90a4 Implement client-side argument serialization with focused tests
- Add pydantic_core.to_json() serialization for non-string prompt arguments
- Update type annotations to accept dict[str, Any] instead of dict[str, str]
- Add focused tests covering specific scenarios:
  * Client always serializes non-string args regardless of server types
  * Integration with server-side type conversion
  * Client serialization error with specific PydanticSerializationError
  * Server deserialization error with specific McpError match

This ensures MCP protocol compliance while maintaining developer experience
with typed arguments.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 10:18:48 -04:00
Jeremiah Lowin
951de7634a
Merge pull request #908 from jlowin/feature/server-side-type-conversion 2025-06-22 10:00:14 -04:00
Jeremiah Lowin
4a038d8f54 Update prompts.mdx
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 09:57:25 -04:00
Jeremiah Lowin
9714028cac Fix pyright type checking issues in tests
Add proper null checks and type assertions for prompt argument
handling in tests to satisfy pyright strict typing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 09:55:40 -04:00
Jeremiah Lowin
7dd2a13ec2 Update docs
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 09:52:52 -04:00
Jeremiah Lowin
7114242e1e Update schema description wording for clarity
Change from 'Arguments must be strings conforming to this JSON schema'
to 'Provide as a JSON string matching the following schema' for clearer
instruction to LLMs about string format requirements.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 09:46:11 -04:00
Jeremiah Lowin
817018bf3b Add automatic JSON schema descriptions for non-string prompt arguments
- Fix ValueError -> PromptError for consistent error handling
- Add automatic JSON schema descriptions to non-string prompt arguments
- Include comprehensive tests for argument description enhancement
- Verify enhanced descriptions are visible via MCP protocol

This helps developers understand the expected string format for complex
types when calling prompts from MCP clients.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 09:38:57 -04:00
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
Jason Cheng
f2a38d275c custom auth configuration for remote mcp server with mcp config class 2025-06-22 14:03:50 +08: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