Commit graph

53 commits

Author SHA1 Message Date
Jeremiah Lowin
b501f05794
Switch to new OpenAPI parser as default (#2513)
* Switch to new OpenAPI parser as default

Remove the legacy OpenAPI parser and make the experimental parser the
default. The experimental parser (introduced in 2.11) offers better
performance, improved compatibility, and a more maintainable architecture.

- Delete legacy parser (server/openapi.py, utilities/openapi.py)
- Move experimental parser to main locations
- Remove enable_new_openapi_parser feature flag
- Update documentation to remove experimental references

* Add deprecation stubs for experimental OpenAPI imports

* Add deprecated enable_new_openapi_parser setting and deprecation tests

* SDK docs

* REview comments

* Fix docstrings

* Update docstring

* Review comments

* Fix broken links
2025-12-01 20:29:18 -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
Jeremiah Lowin
e9667b6624 Fix test regex pattern for updated error message 2025-11-15 12:32:37 -05:00
William Easton
063ffe9f64
Derive jwt_signing_key from Client Secret, default to Encrypted Disk Store (#2223)
* Checkpoint progress

* Checkpoint progress

* add derive b64 method

* PR clean-up

* refactor da proxy

* Updates to tests

* Make jwt_signing_key required for oauth proxy

* use typing_extensions and fix tests

* PR Cleanup

* also adjust integration tests

* Update docs, use client secret to derive jwt signing key

* You win some you lose some, gg claude

* check for both in derive

* update documentation / clean up

* Update http.mdx

---------

Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-10-24 19:08:58 -04:00
William Easton
c1e154ad66
Use abstract types for FastMCP class instantiation (#2219)
* feat: use abstract collection types in FastMCP.__init__

Use Sequence, Collection, and Mapping from collections.abc for more
flexible typing in FastMCP.__init__ parameters. This allows downstream
developers to pass tuples, sets, and other collection types instead of
being restricted to list and dict.

Changes:
- middleware: list -> Sequence (converted to list internally)
- tools: list -> Sequence
- tool_transformations: dict -> Mapping (ToolManager updated)
- include_tags: set -> Collection
- exclude_tags: set -> Collection
- dependencies: kept as list per maintainer request

Closes #2212

Co-authored-by: William Easton <strawgate@users.noreply.github.com>

* Concrete types in class inits

* Small imports cleanup

* Fix include/exclude tag handling

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: William Easton <strawgate@users.noreply.github.com>
2025-10-24 17:50:07 -04:00
Jeremiah Lowin
1f11b5e641
Refactor mounting logic from managers to server (#2069) 2025-10-11 18:28:21 -04:00
Jeremiah Lowin
91af3cd2ae
Internal refactor of MCP handlers (#2005) 2025-10-05 08:45:10 -04:00
Peter Droogmans
39a1e59bfd
feat: Set instructions in code (#1838) 2025-09-16 09:09:10 -04:00
William Easton
4a02c9a563
Delay import of Provider classes until FastMCP Server Creation (#1820) 2025-09-15 11:08:49 -04:00
marvin-context-protocol[bot]
9822024424 feat: improve debugging for nested servers with server/client names and hierarchy visualization
- Add random ID generation for unnamed FastMCP servers (FastMCP-xxxxxx format)
- Add name field to Client class with random ID support
- Update all server/client logging to include server/client names in brackets
- Add generate_hierarchy_diagram() method to visualize server/proxy/client relationships
- Handle proxy classes automatically through inheritance
- Update tests to accommodate new random naming behavior

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

Co-authored-by: William Easton <strawgate@users.noreply.github.com>
2025-08-24 01:09:43 +00:00
Jeremiah Lowin
3fc2510110
Add meta parameter support to tools, resources, templates, and prompts decorators (#1294) 2025-07-29 17:16:05 -04:00
Sourav Tripathy
126dd7b16a
Logcapture addition to test_server file (#1229) 2025-07-22 13:49:49 -04:00
Jeremiah Lowin
4a38784194
Introduce experimental OpenAPI parser with improved performance and maintainability (#1209) 2025-07-21 16:17:36 -04:00
Jeremiah Lowin
db24c85359 Update all tests 2025-06-27 21:41:37 -04:00
Jeremiah Lowin
d8dc28b9b2 Add structured content & update almost all tests 2025-06-27 15:40:52 -04:00
Jeremiah Lowin
cc69e56758 Add output schema to tool decorator 2025-06-20 18:58:23 -04:00
Jeremiah Lowin
725c061d66 Fix import prefix behavior 2025-06-19 15:19:31 -04:00
Jeremiah Lowin
35e13ef9bf Update resource manager 2025-06-19 12:22:14 -04:00
Jeremiah Lowin
8eaa6096b4 Make prefixes optional 2025-06-18 11:28:24 -04:00
Jeremiah Lowin
084e52badd Consolidate prefix logic 2025-06-17 20:23:47 -04:00
Jeremiah Lowin
c5fb5f7fd2 Remove tuple tags 2025-06-10 19:50:43 -04:00
Jeremiah Lowin
7224295f93 Incorporate enabled property 2025-06-10 19:32:31 -04:00
Jeremiah Lowin
956488635e Add support for tag-based include/exclude 2025-06-07 18:38:29 -04:00
Jeremiah Lowin
424978397b Fix indentation 2025-06-05 11:15:25 -04:00
Jeremiah Lowin
f495de6f3a Ensure methods work/are documented 2025-06-05 10:59:32 -04:00
Jeremiah Lowin
d26a5dffc3 Return objects from decorators 2025-06-05 10:04:39 -04:00
Jeremiah Lowin
099d340208 Update tests for prompts 2025-06-04 16:37:41 -04:00
Jeremiah Lowin
e7a94eb8a6 allow naked prompt decorator 2025-06-04 16:34:19 -04:00
Jeremiah Lowin
d1549c3d35 Remove empty parens 2025-06-04 15:37:55 -04:00
Jeremiah Lowin
699b457748 Support "naked" tool decorator usage 2025-06-04 14:33:08 -04:00
Jeremiah Lowin
cc541d6eee Ensure tool serializer is applied 2025-06-04 12:47:12 -04:00
Jeremiah Lowin
0535a70d31 Server add_* methods no longer accept functions 2025-06-04 12:39:34 -04:00
Jeremiah Lowin
3a3c01708d Split Tool into Tool and FunctionTool 2025-06-04 10:19:14 -04:00
Jeremiah Lowin
8a0f9aab5a Support providing tools at init 2025-05-31 22:42:00 -04:00
Jeremiah Lowin
f1e3713fc6 Update test typing 2025-05-31 20:41:18 -04:00
Jeremiah Lowin
cec40ddfea Remove customizable separators; improve resource separator 2025-05-20 20:30:33 -04:00
Jeremiah Lowin
6b4f700a59 Improve handling of exceptiongroups when raised in clients 2025-05-14 19:34:17 -04:00
davenpi
d6f7dab9e6 feat: add support for removing tools from server 2025-05-13 16:39:04 -04:00
Jeremiah Lowin
2eb0e7c1b3 Ensure prompts return descriptions 2025-05-05 12:33:05 -04:00
Jeremiah Lowin
cd97b1c201 Document and test input types 2025-04-25 19:30:43 -04:00
Jeremiah Lowin
09cf6550b5 Split server interaction tests into new file 2025-04-25 17:49:42 -04:00
Jeremiah Lowin
713864aa9a Ensure servers expose template wildcards 2025-04-25 14:25:17 -04:00
Jeremiah Lowin
d27141a935 Refactor remote servers 2025-04-15 20:28:14 -04:00
Jeremiah Lowin
8d922d995a restore mcp tool generation to server 2025-04-15 13:54:33 -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
649329351b permit optional resource template args 2025-04-15 01:17:59 -04:00
Jeremiah Lowin
0cc7d88bd7 Update docs and add_resource_fn 2025-04-13 21:54:56 -04:00
Jeremiah Lowin
3ea0685a17 Expand support for various method interactions 2025-04-13 21:39:19 -04:00
Jeremiah Lowin
a833a7afa4 Clean up server tests 2025-04-12 15:03:48 -04:00
Jeremiah Lowin
2df89204f4 Add tests for tags in server decorators 2025-04-12 11:30:22 -04:00