Commit graph

3,289 commits

Author SHA1 Message Date
SrzStephen
1ed9770892
Updated deprecation URL (#3108)
For V3 this should be https://gofastmcp.com/servers/dependency-injection#using-depends
For V2 this should be https://gofastmcp.com/v2/servers/context#using-depends

current url fails for both v2 and v3 documentation

https://gofastmcp.com/servers/dependencies
https://gofastmcp.com/v2/servers/dependencies
2026-02-07 08:18:39 -05:00
Jeremiah Lowin
25f3b0878e
Add missing beta2 features to v3 release tracking (#3105) v3.0.0b2
generate-cli, goose integration, response limiting middleware,
background task context, require_auth removal
2026-02-06 20:27:42 -05:00
marvin-context-protocol[bot]
3e3ed76a8c
chore: Update SDK documentation (#3089)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2026-02-06 20:27:29 -05:00
Jeremiah Lowin
d12d46b049
Exclude content-type header from get_http_headers() to prevent HTTP 415 errors (#3104)
Fixes #3097

When using FastMCP.from_openapi() with APIs that require specific
Content-Type headers (e.g., application/vnd.api+json), the transport
connection's content-type: application/json was being injected into
downstream API requests, causing HTTP 415 (Unsupported Media Type) errors.

This change adds content-type to the exclude_headers set in get_http_headers(),
similar to how accept is already excluded. The MCP transport's content type
has no relevance to downstream API calls and should not be forwarded.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
2026-02-06 20:19:36 -05:00
Jeremiah Lowin
931d6f878c
Remove require_auth; fix auth docs re: component-level enforcement (#3103)
🤖 Generated with Claude Code

https://claude.ai/code/session_01WWzwcBfLWnxoN9XNs5Fhxr

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-06 20:08:50 -05:00
Jeremiah Lowin
ad3b1b9d1b
Fix CIMD redirect allowlist bypass and cache revalidation (#3098)
* Harden CIMD redirect and cache handling

* Preserve CIMD cache policy on 304 revalidation

* Refresh 304 cache expiry from cached lifetime
2026-02-06 20:08:23 -05:00
Jeremiah Lowin
85eff33b81
Infer MIME types from OpenAPI response definitions (#3101)
* Infer mime_type from OpenAPI response content types for resources

🤖 Generated with Claude Code

https://claude.ai/code/session_01FZD5ZT8WiQqfBu39ybuQis

* Handle media types without schemas in MIME inference

🤖 Generated with Claude Code

https://claude.ai/code/session_01FZD5ZT8WiQqfBu39ybuQis

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-06 20:08:08 -05:00
Jeremiah Lowin
6a358902f2
Fix compress_schema to preserve additionalProperties: false for MCP compatibility (#3102)
Changes:
- Changed default of prune_additional_properties from True to False in compress_schema
- Added test demonstrating MCP client compatibility requirement
- Updated existing tests to explicitly enable pruning when needed
- Added additionalProperties: false to manually constructed schemas in tool_transform
- Updated inline snapshots to reflect new behavior

Fixes #3008

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
2026-02-06 18:52:21 -05:00
Jeremiah Lowin
b8d789c1b4
Document token passthrough security in OAuth Proxy docs (#3100) 2026-02-06 18:20:17 -05:00
Jeremiah Lowin
32c6826e13
Add note about output_schema incongruity when responses are truncated (#3099) 2026-02-06 18:15:57 -05:00
Diogo Santos
30832ced1c
Add ResponseLimitingMiddleware for tool response size control (#3072) 2026-02-06 18:13:26 -05:00
Jeremiah Lowin
880d835ccc
Add CIMD (Client ID Metadata Document) support for OAuth (#2871) 2026-02-06 13:44:52 -05:00
Jeremiah Lowin
db650ca7cb
Update Anthropic and OpenAI clients to use Omit instead of NotGiven (#3088)
* Fix ty 0.0.15 type errors: use Omit/omit instead of NotGiven/NOT_GIVEN

🤖 Generated with Claude Code

https://claude.ai/code/session_01Fs5vHiWaUebe826pGq4eCN

* Use kwargs dict to avoid NotGiven/Omit sentinel type issues across SDK versions

🤖 Generated with Claude Code

https://claude.ai/code/session_01Fs5vHiWaUebe826pGq4eCN

* Bump ty minimum to 0.0.15

🤖 Generated with Claude Code

https://claude.ai/code/session_01Fs5vHiWaUebe826pGq4eCN

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-05 11:40:25 -05:00
marvin-context-protocol[bot]
5e0211dd5e
chore: Update SDK documentation (#3069)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2026-02-04 18:31:07 -05:00
Diogo Santos
b776089ecc
Add @handle_tool_errors decorator for standardized error handling (#2885)
* Add @handle_tool_errors decorator for standardized error handling

* Add tests for @handle_tool_errors decorator

* Add documentation for @handle_tool_errors decorator

* Fix type checking: use getattr for func.__name__ with fallback

* Add @overload declarations for proper async/sync type checking

* Fix type checking: reorder overloads and use Coroutine for async typing

* Update lockfile and fix test formatting

* Improve error_handling module: add docstrings, fix logging, handle cancellation, and update documentation

* Add auth error mappings, doc tweaks, and doc fix

* Pivot to hybrid approach

* Remove decorator, keep only core 429/timeout handling

---------

Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2026-02-04 18:30:31 -05:00
Richard Michael
d5f5300e63
Add server version to banner (#3076) 2026-02-04 17:40:09 -05:00
Jeremiah Lowin
422384e576
Fix --reload port conflict when using explicit port (#3070)
* Fix --reload port conflict by killing entire process group

* Gate start_new_session on Unix (no-op on Windows)
2026-02-04 17:35:39 -05:00
Nathan
76f054e957
fix: enforce redirect URI validation when allowed_client_redirect_uris is supplied (#3066)
* fix: enforce redirect URI validation when patterns are explicitly configured

Security fix: When allowed_redirect_uri_patterns is explicitly set, reject redirect URIs that don't match the patterns instead of falling back to parent validation. This prevents unauthorized OAuth clients from bypassing the allowlist and accessing protected resources.

* Update models.py

no need to return twice

* fix redirect uri access issue

* update style

* feat: add unit test to enforce fallback not applied when redirect uri's supplied

* fix: improve test case

* apply linter

* refactor: simplify logic and do not exposed allowed redirect patterns

---------

Co-authored-by: Nathan <2381793w@student.gla.ac.uk>
2026-02-04 17:33:33 -05:00
Jeremiah Lowin
4262cfc16a
Add fastmcp generate-cli command (#3065)
* Add `fastmcp generate-cli` command

Connects to any MCP server, reads its tool/resource/prompt schemas,
and writes a standalone Python CLI script with typed subcommands.

* docs: add generate-cli documentation

* docs: add generate-cli documentation; skip Windows executable test

* fix: address PR review feedback

- Sanitize tool and parameter names to valid Python identifiers
- Replace bare except Exception with specific exception types
- Escape server name in generated string literals
- Handle trailing colon edge case in _derive_server_name
- Clarify in docs that generated CLI is a client, not a bundled server

* Fix string escaping issues in generate-cli

- Use single-quoted docstrings to avoid triple-quote escaping issues
- Escape quotes in app_name derived from server_name
- Add tests for descriptions with quotes and server names with quotes

Addresses CodeRabbit review comments about insufficient escaping.

* Implement smart parameter handling for generate-cli

- Simple types (str, int, float, bool): Direct typed flags
- Arrays of simple types (list[str], list[int]): Repeatable flags via cyclopts
- Complex types (objects, nested arrays): Accept JSON strings with parsing
- JSON schema shown in help text for complex parameters
- Proper escaping of newlines and quotes in help text
- Filter out None and empty list defaults when calling tools

This gives typed, discoverable CLIs for common cases while handling
complex schemas via JSON input.

* Update generate-cli docs to explain smart parameter handling

- Document simple types as direct typed flags
- Document arrays of simple types as repeatable flags
- Document complex types as JSON strings with schema in help
- Add examples showing all three patterns

* Fix Codex review issues in generate-cli

High priority fixes:
- Complex type defaults: Serialize dict/list defaults to JSON strings
- List params: Preserve help metadata with Annotated wrapper
- Name collisions: Detect and error on sanitized name conflicts
- JSON parsing: Use isinstance check for safety with defaults

Added tests for:
- Complex types with default values
- Parameter name collision detection
- Updated existing tests to match new format

* Use pydantic_core.to_json for consistency

- Generator now uses pydantic_core.to_json() instead of json.dumps()
- Consistent with rest of fastmcp codebase
- Generated CLI still uses plain json module (standalone script)

* Move local imports to module level in generate-cli

* Handle union item types and Python keyword collisions in generate-cli
2026-02-03 21:08:51 -05:00
marvin-context-protocol[bot]
f6988c9206
chore: Update SDK documentation (#2995)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2026-02-03 21:08:20 -05:00
Jeremiah Lowin
5fd41b2e15
Remove OpenAPI timeout parameter, make client optional, surface timeout errors (#3067)
* Remove OpenAPI timeout param, make client optional, surface timeout errors

* Close auto-created httpx client via provider lifespan
2026-02-03 21:08:09 -05:00
Jeremiah Lowin
fe432de156
Add release notes for v2.14.4 and v2.14.5 (#3064) 2026-02-03 10:47:06 -05:00
Bill Easton
49707813f4
Mock network calls in CLI tests and use MemoryStore for OAuth tests
Mock network calls in CLI tests and use MemoryStore for OAuth tests
2026-02-02 19:15:06 -06:00
Bill Easton
32017f7fb1
Merge branch 'main' into claude/issue-3049-20260131-2232 2026-02-02 19:08:11 -06:00
Jeremiah Lowin
b076b2154c
Add AzureJWTVerifier for Managed Identity token verification (#3058) 2026-02-02 19:59:13 -05:00
Bill Easton
c09e748a12
Merge branch 'main' into claude/issue-3049-20260131-2232 2026-02-02 18:52:05 -06:00
Guillaume FORTAINE
08974e50d9
feat(context): Add background task support for Context (SEP-1686) (#2905) 2026-02-02 19:28:42 -05:00
Neelay Shah
c8e2c621ef
fix: Preserve metadata in FastMCPProvider component wrappers (#3057) 2026-02-02 10:26:24 -05:00
Bill Easton
b3b26e602c
Merge branch 'main' into claude/issue-3049-20260131-2232 2026-02-01 20:49:43 -06:00
Bill Easton
6fa90fa792
fix: use SkipJsonSchema to exclude callable fields from JSON schema generation (#3048)
Co-authored-by: Bill Easton <strawgate@users.noreply.github.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
2026-02-01 21:30:48 -05:00
Jeremiah Lowin
186604a8a2
Merge branch 'main' into claude/issue-3049-20260131-2232 2026-02-01 21:29:57 -05:00
Bill Easton
b2f5551d22
Fix Field() handling in prompts (#3050)
Co-authored-by: Bill Easton <strawgate@users.noreply.github.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
2026-02-01 21:28:44 -05:00
Jeremiah Lowin
adf21ac630
Add fastmcp discover and name-based server resolution (#3055) 2026-02-01 21:27:22 -05:00
Jeremiah Lowin
bd37763e98
Add fastmcp list and fastmcp call CLI commands (#3054) 2026-02-01 18:30:14 -05:00
claude[bot]
cec40b378d Use MemoryStore for OAuth proxy tests
Updated all OAuthProxy test instantiations to use MemoryStore instead of defaulting to DiskStore, avoiding SQLite timeout issues on Windows and improving test performance.

Co-authored-by: Bill Easton <strawgate@users.noreply.github.com>
2026-02-01 02:30:05 +00:00
claude[bot]
cd085412d1 Mock network call in test_version_command_execution
Fixes #3049 by mocking check_for_newer_version to prevent real network
calls to PyPI during tests, which was causing timeouts on Windows.

Co-authored-by: Bill Easton <strawgate@users.noreply.github.com>
2026-01-31 22:35:43 +00:00
Bill Easton
684cbff634
Merge pull request #3047 from jlowin/claude/fix-workflow-link-b4Vrn 2026-01-31 15:43:28 -06:00
Bill Easton
82c9409006
Merge branch 'main' into claude/fix-workflow-link-b4Vrn 2026-01-31 15:23:11 -06:00
Bill Easton
96569177a8
Merge pull request #2996 from didier-durand/fix-typos-b 2026-01-31 15:10:53 -06:00
Bill Easton
6b1394ebf8
Merge branch 'main' into fix-typos-b 2026-01-31 15:01:57 -06:00
Bill Easton
4e10ad6299
Merge branch 'main' into claude/fix-workflow-link-b4Vrn 2026-01-31 15:01:12 -06:00
Bill Easton
70f0fd3a0a
Merge pull request #3014 from jlowin/claude/issue-3011-20260128-0658 2026-01-31 15:00:53 -06:00
William Easton
b7344d7045
chore: Trigger CI build 2026-01-31 14:58:19 -06:00
Bill Easton
c7eb47183d
Merge branch 'main' into claude/issue-3011-20260128-0658 2026-01-31 14:55:13 -06:00
Claude
4544b634c6
fix: correct workflow run link template variable
🤖 Generated with Claude Code

https://claude.ai/code/session_0116NLbUNNQwyQySTawmshQT
2026-01-31 20:51:25 +00:00
Jeremiah Lowin
e17d50e0e8
fix: use MCP spec error code -32002 for resource not found (#3041) 2026-01-31 10:57:05 -05:00
Jeremiah Lowin
8de1470973
chore: upgrade protobuf to 6.33.5 (CVE-2026-0994) (#3043) 2026-01-31 10:56:50 -05:00
Jeremiah Lowin
62f532454e
chore: upgrade python-multipart to 0.0.22 (CVE-2026-24486) (#3042) 2026-01-31 10:56:42 -05:00
Jeremiah Lowin
1bbbee37a6
feat: add fastmcp install goose command (#3040) 2026-01-31 10:53:24 -05:00
Jeremiah Lowin
12cb58f220
MCP Apps: structured CSP/permissions types, resource meta propagation fix, QR example (#3031) 2026-01-30 14:05:25 -05:00