Commit graph

22 commits

Author SHA1 Message Date
Jeremiah Lowin
7d6c36a85d
Pin legacy for handshake-era features after mode=auto flip 2026-07-09 11:14:16 -04:00
Jeremiah Lowin
6a6fdcb2bb
Repoint tests and examples off removed deprecations
Replaces FastMCP.as_proxy() helper calls with create_proxy(), rewrites the
mount() as_proxy=/prefix= kwarg tests to plain mount() (the params are gone),
and deletes deprecation-only tests for as_proxy() and remove_tool().
2026-07-07 07:53:11 -04:00
Jeremiah Lowin
3522a98766
Migrate to MCP Python SDK v2 (#4437) 2026-07-06 17:36:45 -04:00
Jeremiah Lowin
96c7a74b27
Move OpenAPI to providers/openapi submodule (#2672)
* Move OpenAPI to providers/openapi/ submodule

Migrates the OpenAPI implementation to the provider pattern:
- Creates src/fastmcp/server/providers/openapi/ submodule with provider.py,
  components.py, and routing.py
- Converts server/openapi/ to deprecated re-export stubs
- FastMCPOpenAPI remains as deprecated wrapper that uses OpenAPIProvider
- Updates experimental/server/openapi to import from new canonical location

* Update tests and FastMCP methods to use OpenAPIProvider

- Update FastMCP.from_openapi() and from_fastapi() to use OpenAPIProvider
  directly, returning FastMCP instead of deprecated FastMCPOpenAPI
- Move tests from tests/server/openapi/ to tests/server/providers/openapi/
- Update all test imports to use new canonical location
- Add tests/deprecated/openapi/ for backward compatibility testing
- Update tests/client/test_openapi.py to use new imports

* Fix deprecation warning tests and address CodeRabbit feedback

- Use importlib.reload() to ensure deprecation warnings fire in tests
- Change logger.error to logger.exception for better stack traces
2025-12-22 11:13:33 -05:00
Jeremiah Lowin
049bd22827
Replace type: ignore[attr-defined] with isinstance assertions in tests (#2665)
* Replace type: ignore[attr-defined] with isinstance assertions in tests

* Fix isinstance assertions in failing tests

- Fix enum test to check for ResponseEnum instead of str
- Fix binary resource test to check for BlobResourceContents instead of TextResourceContents
- Fix Root type tests to check attributes directly instead of isinstance checks

* Fix type errors without using type: ignore

- Remove execution methods from TransformingProvider (only handles transformations)
- Add execution methods to base Provider class with default implementations
- Fix type narrowing in tests using cast() instead of type: ignore
- Fix PromptResult type handling in prompt render tests
- Fix type narrowing in middleware test for arguments and structured_content
2025-12-21 16:37:20 -05:00
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
d043511370
Add tests for headers with both legacy and experimental openapi parser (#1259) 2025-07-25 15:11:17 -04: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
d8dc28b9b2 Add structured content & update almost all tests 2025-06-27 15:40:52 -04:00
Jeremiah Lowin
76e3df1bc1 Add "http" as an alias for streamable-http 2025-06-22 18:55:07 -04:00
Jeremiah Lowin
18ae625fef Update docs and test 2025-06-20 13:06:48 -04:00
Jeremiah Lowin
1866c17400 Update tests 2025-06-10 17:08:23 -04:00
Jeremiah Lowin
8fb709c98c Simplify code for running servers in processes 2025-06-01 09:35:06 -04:00
Jeremiah Lowin
f1e3713fc6 Update test typing 2025-05-31 20:41:18 -04:00
Jeremiah Lowin
ee059b02b6 Update test_openapi.py 2025-05-28 18:38:16 -04:00
Jeremiah Lowin
d311a2b878 Ensure behavior-affecting headers are excluded 2025-05-28 18:30:33 -04:00
Jeremiah Lowin
307a3b908a Ensure content-length is always stripped from client headers 2025-05-24 07:38:34 -04:00
Jeremiah Lowin
ae960e2f5a Update tests for new names 2025-05-23 17:16:32 -04:00
Jeremiah Lowin
e0ae84c75f Use lowercase name for headers 2025-05-23 16:02:42 -04:00
Jeremiah Lowin
de666be70d Update test_openapi.py 2025-05-23 15:40:03 -04:00
Jeremiah Lowin
b8e918a862 Ensure headers are passed through proxy servers 2025-05-23 15:39:45 -04:00
Jeremiah Lowin
213abc4244 Pass client headers through to OpenAPI client 2025-05-23 12:38:24 -04:00