Commit graph

41 commits

Author SHA1 Message Date
Jeremiah Lowin
b8ae95a4bb
Add tool_names parameter to mount() for name overrides (#2619)
* Add tool_names parameter to mount() for name overrides

* Fix Docket registration to use tool_names overrides
2025-12-14 20:56:42 -05:00
Jeremiah Lowin
080ffa578a
Fix nested server mount routing for 3+ levels deep (#2586)
Tools, resources, and prompts from servers mounted more than 2 levels
deep failed to invoke even though they were correctly listed.

The bug was in the routing methods which used manager methods that only
search locally, not through nested mounted servers. Changed to use
server-level methods that search recursively.

Fixes #2583
2025-12-09 21:06:47 -05:00
Chris Guidry
47d3044b06 Remove enable_docket setting; Docket is now always on
Docket provides background task execution and is now always available
for all FastMCP servers. Only `enable_tasks` remains to control the
SEP-1686 task protocol support.

Changes:
- Remove `enable_docket` setting and related validation
- Docket/Worker lifecycle is always active in server lifespan
- CurrentDocket and CurrentWorker dependencies work without config
- Add server readiness signaling via `_started` event
- Fix test timing issues with proper port probing

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 11:40:04 -05:00
Jeremiah Lowin
ee5f465a82
2.14 deprecation removals (#2329)
* Initialize 2.14 deprecation removal branch

* Remove deprecated FASTMCP_SERVER_ environment variable prefix (#2330)

* Remove deprecated Context.get_http_request method (#2332)

* Remove fastmcp.Image top-level import (deprecated 2.8.1) (#2334)

* Remove test warnings (#2331)

* Create new branch and fix issue

* Remove deprecated client parameter from FastMCPProxy (#2333)

* Remove deprecated run_streamable_http_async method (#2338)

* Remove deprecated sse_app method (#2337)

* Remove deprecated run_sse_async method (#2335)

* Remove deprecated run_sse_async method

* Update CLI and tests to use run_http_async(transport="sse")

- Change CLI to call run_http_async with transport="sse" instead of run_sse_async
- Update test to mock run_http_async with create=True for v1 servers

* Revert CLI changes - v1 servers do have run_sse_async

- Keep CLI calling run_sse_async() for v1 compatibility
- Update test to mock run_sse_async (which exists on v1)

* Remove unnecessary type ignore for run_sse_async

Method exists on v1 FastMCP class, no type error

* Remove unused imports after test deletion

* Remove deprecated streamable_http_app method (#2336)

* Remove deprecated dependencies parameter from FastMCP constructor (#2340)

* Remove output_schema=False support (deprecated 2.11.4) (#2339)

* Remove deprecated client parameter from FastMCPProxy (#2333)

* Delete deprecated test_output_schema_false.py

Tests functionality that has been removed

* Remove deprecated BearerAuthProvider module (#2341)

* Remove resource_prefix_format="protocol" support (deprecated 2.4.0) (#2342)

* Remove resource_prefix_format="protocol" support (fixes #2195)

Removes deprecated protocol format (prefix+resource://path) and keeps only
path format (resource://prefix/path). Since only one format remains:

- Removed resource_prefix_format from settings, FastMCP.__init__, and helpers
- Simplified add_resource_prefix, remove_resource_prefix, has_resource_prefix
- Removed MountedServer.resource_prefix_format field
- Deleted tests for protocol format

All resource prefixes now use path format exclusively.

* Clean up resource_prefix_format references

- Remove from test files
- Update documentation to remove protocol format section
- Move custom HTTP routes note to mounting section
- Remove resource_prefix_format from settings docs

* Use inline version note instead of badge for prefix format

* Remove obsolete test functions and update docs

- Delete test functions that no longer assert anything
- Remove proxy.mdx reference to deleted prefix format section

* Format error messages per ruff

* Remove from_client classmethod (deprecated 2.8.0) (#2343)

* Remove deprecated from_client classmethod (fixes #2192)

* Remove unused Client import

* Remove add_resource_fn method (deprecated 2.7.0) (#2345)

* Update SDK

* Add missing imports for exclude_args deprecation warning
2025-12-01 14:11:00 -05:00
William Easton
5d195878c4
Switch Lifespan to being a Server Lifespan (#2013)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-10-14 11:49:53 -07:00
Jeremiah Lowin
1f11b5e641
Refactor mounting logic from managers to server (#2069) 2025-10-11 18:28:21 -04:00
William Easton
185bb47713
Updates to tests 2025-08-24 10:59:01 -05:00
Jeremiah Lowin
38d772b437
Support importing custom_route endpoints when mounting servers (#1470)
Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2025-08-12 12:57:38 -04:00
Jeremiah Lowin
19a4dd85d4
Ensure resource + template names are properly prefixed when importing/mounting (#1423) 2025-08-08 21:29:07 -04:00
Jeremiah Lowin
aedb1993a2
Remove unused arg (#1382) 2025-08-06 11:09:17 -04:00
William Easton
e62d2dd3c2
Manually set _key after model_copy (#1357) 2025-08-04 11:08:51 -04:00
William Easton
cae431c001
Remove unused TimedCache (#1303) 2025-07-31 23:10:08 -04:00
Aidan
ebe817601c
add server name to mounted server warnings (#1147) 2025-07-17 12:02:30 -07:00
Jeremiah Lowin
ef742d9400
Ensure multi-client configurations use new ProxyClient (#1045)
* Validate elicitation responses are dicts

* Ensure advanced MCP features are forwarded through proxy

* Use proxy client in tests
2025-07-05 11:57:03 -04:00
Jeremiah Lowin
228425e309
Avoid propagating logs (#1042)
* Avoid propagating logs

* Set up caplog for non-root loggers

* Update tests
2025-07-04 12:22:11 -04:00
Jeremiah Lowin
d8dc28b9b2 Add structured content & update almost all tests 2025-06-27 15:40:52 -04:00
Jeremiah Lowin
7b9696405b Remove legacy json parsing
Because the server now validates inputs, its no longer viable to provide a JSON string where e.g. an array is expected, so we can entirely remove FastMCP's "legacy json parsing" support from 1.x.

This is a breaking change (for legacy opt-in behavior)
2025-06-26 18:19:43 -04:00
Jeremiah Lowin
18ae625fef Update docs and test 2025-06-20 13:06:48 -04:00
Jeremiah Lowin
725c061d66 Fix import prefix behavior 2025-06-19 15:19:31 -04:00
Jeremiah Lowin
2e31b2704b Update tests 2025-06-19 14:05:19 -04:00
Jeremiah Lowin
a2bb2314c7 Add key to component 2025-06-18 21:05:11 -04:00
Jeremiah Lowin
8eaa6096b4 Make prefixes optional 2025-06-18 11:28:24 -04:00
Jeremiah Lowin
e7672bf0bc Update test_mount.py 2025-06-07 17:37:48 -04:00
Jeremiah Lowin
099d340208 Update tests for prompts 2025-06-04 16:37:41 -04:00
Jeremiah Lowin
18615bc48b Remove empty parens 2025-06-04 15:41:28 -04:00
Jeremiah Lowin
f1e3713fc6 Update test typing 2025-05-31 20:41:18 -04:00
davenpi
b7607af17a Handle unreachable mounted servers. 2025-05-27 08:25:52 -04:00
Jeremiah Lowin
cec40ddfea Remove customizable separators; improve resource separator 2025-05-20 20:30:33 -04:00
Jeremiah Lowin
9a2d92b46d Add as_proxy improvements and tests 2025-05-17 12:23:48 -04:00
Jeremiah Lowin
456db4db63 Add test for no prefix 2025-05-10 15:50:03 -04:00
Jeremiah Lowin
25f941aa85 Prevent invalid resource URIs 2025-05-06 09:27:13 -04:00
Jeremiah Lowin
6d5da3643a Update test_mount.py 2025-05-03 12:11:12 -04:00
Jeremiah Lowin
a9253d3111 use pydantic_core.to_json 2025-04-30 17:29:38 -04:00
Jeremiah Lowin
5ff93f6bd6 Add mount tests 2025-04-15 21:03:00 -04:00
Jeremiah Lowin
d39f787537 rename mount -> import 2025-04-15 13:01:36 -04:00
Jeremiah Lowin
67fbb4c3e8 Ensure quoted URIs work; fix proxy template issue 2025-04-15 12:54:58 -04:00
Jeremiah Lowin
9d8f237b82 Add get_tools() and update tests to include proxy tools 2025-04-15 09:15:18 -04:00
Jeremiah Lowin
a691b40cf7 Allow tool manager to store an alternative name for tools 2025-04-15 08:54:52 -04:00
Jeremiah Lowin
218c49ce8d Enter mounted app lifespans 2025-04-12 21:58:06 -04:00
Jeremiah Lowin
e5843f9782 Use _ as default mount separator and make configurable 2025-04-12 21:30:14 -04:00
Jeremiah Lowin
9b89715294 Support mounting FastMCPs as sub-servers 2025-04-07 17:54:55 -04:00