Commit graph

3,289 commits

Author SHA1 Message Date
Jeremiah Lowin
2d838315f0
Add timeout parameter for tool foreground execution (#2872) 2026-01-13 21:05:34 -05:00
Jeremiah Lowin
7ee3bec727
Add missing 3.0.0 version badges and document tasks extra (#2866) 2026-01-13 12:04:52 -05:00
Jeremiah Lowin
8c471a499d
Run sync tools/resources/prompts in threadpool automatically (#2865) 2026-01-13 11:03:05 -05:00
Jeremiah Lowin
2b6a0faf1c
Add loq file size limits and clean up type ignores (#2859) 2026-01-13 07:29:12 -05:00
Jeremiah Lowin
84a43da289
Fix decorator error messages to link to correct doc pages (#2858) 2026-01-12 22:22:28 -05:00
Jeremiah Lowin
07d89c4038
Add transform system for modifying components in provider chains (#2836)
* Consolidate tool transformation logic into TransformingProvider

Tool transformations were previously scattered across LocalProvider,
ProxyProvider, and MCPConfig. This consolidates all transformation
logic into TransformingProvider via with_transforms(tool_transforms={...}).

- Add tool_transforms parameter to TransformingProvider
- Add tool_transforms to Provider.with_transforms()
- Remove transformation storage from LocalProvider and ProxyProvider
- Remove add_tool_transformation() and remove_tool_transformation() from FastMCP
- Add tool_transforms parameter to factory methods (from_openapi, from_fastapi, create_proxy)
- Update tests to use new patterns

* Fix: reject tool lookups by pre-transform name

* Add collision validation for tool_transforms and fix docstring examples

- Validate duplicate target names in tool_transforms raise ValueError
- Fix docstring examples to use arguments/ArgTransformConfig (not args/ArgTransform)
- Add test for collision validation

* Add server-level tool transform APIs and fix task registration

- Add AggregateProvider to present multiple providers as one
- Add _get_root_provider() to apply server-level transforms uniformly
- Fix _docket_lifespan to use root provider (ensures renamed tools
  register with correct keys for background execution)
- Add tool_transforms kwarg to __init__ (non-deprecated)
- Add add_tool_transform(), remove_tool_transform(), tool_transforms property
- Deprecate old API names (tool_transformations, add_tool_transformation, etc.)
- Update tests to use new API

* Add graceful degradation for provider errors in AggregateProvider

* Match original behavior: parallel queries with DEBUG logging

* Refactor transforms to middleware-style call_next pattern

Replaces the ad-hoc transformation system with a unified Transform
abstraction using the same call_next pattern as server middleware.

Key changes:
- New src/fastmcp/server/transforms/ module with Transform base class
- Namespace, ToolTransform, Visibility all implement the same interface
- Transforms compose via functools.partial chain building
- Visibility is now just the first transform in provider._transforms
- Server-level transforms apply after provider aggregation
- Task registration now applies full transform chain

Removes TransformingProvider, _BoundTransform, ComponentSource protocol.
User-facing API unchanged: mount(), add_transform(), enable/disable all
work as before.

* Add comprehensive transforms and visibility documentation

New docs/servers/providers/transforms.mdx covering:
- Mental model for middleware-style transform pattern
- Built-in transforms (Namespace, ToolTransform)
- Server vs provider-level transforms and ordering
- Tool modification (immediate vs deferred)
- Custom transform creation

New docs/servers/visibility.mdx covering:
- Enable/disable API for runtime visibility control
- Keys and tags for targeting components
- Allowlist mode with only=True
- Server vs provider visibility layering

Updates existing docs to reference new pages and simplifies
redundant content. Visibility is documented as a user feature,
not as an implementation detail.

* Restructure transforms docs and delete tool-transformation pattern

* Cleanup: simplify get_tasks and remove unused Provider.get_component

* Update loq

* Update loq limits and add loq note to AGENTS.md

* Deprecate add_tool_transformation and tool_transformations param

* Address PR review feedback: remove redundant imports, fix path reference

* Add missing imports to code examples in v3-features.mdx
2026-01-12 22:11:16 -05:00
Jeremiah Lowin
1b723f302d
Decorators return functions instead of component objects (#2856) 2026-01-12 21:58:07 -05:00
Jeremiah Lowin
766641a1a5
Add authorization checks to components and servers (#2855) 2026-01-12 19:56:52 -05:00
Jeremiah Lowin
ebf6e3dd53
Add release notes for v2.14.2 and v2.14.3 (#2852) 2026-01-12 16:52:47 -05:00
Jeremiah Lowin
bf3df4dcd5
Add transport property to Context (#2850) 2026-01-12 15:33:59 -05:00
Jeremiah Lowin
9b18db2379
Fix HTTP transport timeout defaulting to 5 seconds (#2849) 2026-01-12 14:47:21 -05:00
Jeremiah Lowin
18c71f9f34
Add loq pre-commit hook for file size enforcement (#2847) 2026-01-12 11:37:45 -05:00
Jeremiah Lowin
16cd343ec5
Add agent skills for testing and code review (#2846) 2026-01-12 11:24:39 -05:00
Chris Guidry
4ae0cc205c
Merge pull request #2844 from jlowin/fix-asgi-contextvar-propagation
Fix ContextVar propagation for ASGI-mounted servers with tasks
2026-01-12 10:38:31 -05:00
Chris Guidry
923ff5ecc8 Fix ContextVar propagation for ASGI-mounted servers with tasks
Fixes background tasks failing with "Background tasks require a running
FastMCP server context" when FastMCP is mounted to another ASGI app
(FastAPI, Starlette) or deployed to serverless environments (Lambda).

Root cause: ContextVars set during lifespan don't propagate to request
handlers in ASGI environments because they run in sibling async contexts.

Fix: Context.__aenter__ now sets _current_docket and _current_worker from
server instance attributes at request time, ensuring they're available
regardless of async context hierarchy.

Changes:
- server.py: Store self._worker on server instance (self._docket was already stored)
- context.py: Set docket/worker ContextVars from server instance in __aenter__

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 10:31:58 -05:00
Jeremiah Lowin
797297a22d
Add CLI update notifications (#2840) 2026-01-10 18:27:03 -05:00
Jeremiah Lowin
8e1fd1d700
Make pydocket optional and unify DI systems (#2835) 2026-01-10 16:23:32 -05:00
Jeremiah Lowin
4765f5725a
Add PingMiddleware for keepalive connections (#2838) 2026-01-10 16:12:35 -05:00
Jeremiah Lowin
daa2dace2f
Add standalone decorators and eliminate fastmcp.fs module (#2832) 2026-01-10 12:16:35 -05:00
marvin-context-protocol[bot]
24d500d384
chore: Update SDK documentation (#2761)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2026-01-10 11:49:29 -05:00
Jeremiah Lowin
c9a9df17f4
Add FastMCP 4.0 preview notice to installation guide (#2831)
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-10 11:41:44 -05:00
Jeremiah Lowin
3e46b8cb4a
Add docs-broken-links command and fix docstring markdown parsing (#2830) 2026-01-10 11:41:23 -05:00
Jeremiah Lowin
3163e61ee4
Replace FastMCP.as_proxy() with create_proxy() function (#2829) 2026-01-10 11:39:06 -05:00
Jeremiah Lowin
d8351993f7
Add composable lifespans (#2828) 2026-01-10 11:16:50 -05:00
Jeremiah Lowin
401b315786
Fix timeout not propagating to proxy clients in multi-server MCPConfig (#2809) 2026-01-09 20:01:16 -05:00
Jeremiah Lowin
b8d6f89e19
Remove deprecated WSTransport (#2826) 2026-01-09 19:42:35 -05:00
Jeremiah Lowin
87f2edd9c0
Add FileSystemProvider for filesystem-based component discovery (#2823) 2026-01-09 16:31:29 -05:00
Jeremiah Lowin
43811cc16b
Fix redirect URI validation docs to match implementation (#2824) 2026-01-09 12:36:34 -05:00
Jeremiah Lowin
dbd800acf8
Add v3.0 feature tracking document (#2822) 2026-01-09 09:34:53 -05:00
Jeremiah Lowin
42dcb8918d
Add --reload flag for auto-restart on file changes (#2816) 2026-01-09 08:44:27 -05:00
nate nowack
aea8f3b0dc
fix smart_home example: HueAttributes schema and deprecated prefix (#2818)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 08:44:03 -05:00
Jeremiah Lowin
8dfa51329a
Dereference $ref in tool schemas for MCP client compatibility (#2814) 2026-01-08 21:16:01 -05:00
Jeremiah Lowin
b1f9c77dd9
Fix Claude Code installation lock contention in CI workflows (#2815) 2026-01-08 20:43:22 -05:00
Chris Guidry
08caf77ef6
Prefix Redis keys with docket name for ACL isolation (#2811)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 19:04:33 -05:00
Jeremiah Lowin
627c6cdad4
Dereference $ref in tool schemas for MCP client compatibility (#2808) 2026-01-07 18:30:08 -05:00
Jeremiah Lowin
a117316ba1
Fix keep_alive passthrough in StdioMCPServer.to_transport() (#2791) 2026-01-07 16:37:19 -05:00
Jeremiah Lowin
da965db5cb
Fix unawaited coroutine warning and treat as test error (#2806) 2026-01-07 14:29:56 -05:00
Jeremiah Lowin
befaad8a08
Configure ty to fail on warnings (#2804) 2026-01-07 11:17:49 -05:00
Jeremiah Lowin
4dca48e980
Turn off negative CLI flags by default (#2801) 2026-01-07 09:50:57 -05:00
Jeremiah Lowin
517a860f53
Fix client hanging on HTTP 4xx/5xx errors (#2803) 2026-01-07 09:50:41 -05:00
Jeremiah Lowin
10fb217f73
Return 401 for invalid_grant token errors per MCP spec (#2800) 2026-01-06 17:51:33 -05:00
Jeremiah Lowin
151b0ae46f
Use consistent refresh_ttl for JTI mapping store (#2799) 2026-01-06 17:46:39 -05:00
Jeremiah Lowin
945dac57e4
Add debug logging for OAuth token expiry diagnostics (#2797) 2026-01-06 17:18:39 -05:00
Jeremiah Lowin
5a95050762
Fix OAuth token storage TTL calculation (#2796) 2026-01-06 16:55:33 -05:00
Adam Azzam
38ec476f2e
Merge pull request #2786 from jlowin/conference
add link to py ai conf in banner
2025-12-30 20:04:13 -06:00
Adam Azzam
cffde77560 Update docs.json 2025-12-30 20:37:24 -05:00
Adam Azzam
7173e33b03 Update docs.json 2025-12-30 20:18:22 -05:00
Jeremiah Lowin
ad50f73bdc
Lazy import DiskStore to avoid sqlite3 dependency on import (#2784) 2025-12-30 19:20:21 -05:00
Taisei Mima
df3d4e19ec
Fix base_url fallback when url is not set (#2776) 2025-12-29 18:43:51 -05:00
Bryan Thompson
30a239637b
Add MCP tool annotations to smart_home example (#2777)
Co-authored-by: triepod-ai <noreply@github.com>
2025-12-29 18:40:51 -05:00