Commit graph

46 commits

Author SHA1 Message Date
Jeremiah Lowin
ae43039d8e
Audit tests/client/ mode="legacy" pins
Remove 4 unjustified pins (proxy header passthrough, connect timeout,
two response_title validation tests that fail before any request is
dispatched). Keep 81 pins that genuinely exercise older-protocol-only
behavior (ctx.elicit back-channel, sampling, roots, ping, session IDs,
initialize handshake, client.set_logging_level).

Flags a real defect: _on_read_resource/_on_get_prompt only catch
(DisabledError, NotFoundError), unlike _on_call_tool which catches
FastMCPError broadly. A ResourceError/PromptError escapes as a raw
exception and the modern protocol's generic exception ladder masks it
as "Internal server error", losing the detailed message tool errors
still get. Left pinned with a TODO in test_client.py and
test_error_handling.py rather than hidden.
2026-07-20 15:43:04 -04:00
Jeremiah Lowin
1a788cf349
Merge remote-tracking branch 'origin/main' into feature/client-auto-default
# Conflicts:
#	tests/client/test_streamable_http.py
#	tests/server/middleware/test_initialization_middleware.py
#	tests/server/tasks/test_task_status_notifications.py
2026-07-20 12:02:38 -04:00
Jeremiah Lowin
b0e782a2ee
Make the unit suite fast: in-process HTTP tests, no real sleeps, parallel Windows CI (#4554) 2026-07-20 10:51:14 -04:00
Jeremiah Lowin
d2ac7ed3d2
Default fastmcp.Client to mode="auto"; surface extensions=/result_claims=
Client negotiates the newest mutual protocol era by default (probe
server/discover, fall back to the initialize handshake). ProxyClient and the
inspect utility explicitly pin the handshake era so proxy forwarding and
server_info reads are unchanged. SSE and multi-server config transports are
legacy-only. extensions= and result_claims= (SEP-2133) are thin passthroughs
to the SDK session.
2026-07-19 21:22:49 -04:00
Jeremiah Lowin
18b5ab5852
Migrate to MCP SDK v2.0.0b2 (httpx2) (#4503) 2026-07-18 15:12:47 -04:00
Jeremiah Lowin
3522a98766
Migrate to MCP Python SDK v2 (#4437) 2026-07-06 17:36:45 -04:00
Jeremiah Lowin
47907e0767
Fix ty 0.0.55 diagnostics and prefab-ui protocol version drift (#4428) 2026-07-05 19:10:40 -04:00
Jeremiah Lowin
564b4c0d5c
Fix ty 0.0.17 diagnostics and bump lockfile 2026-02-16 16:13:38 -05:00
Jeremiah Lowin
dab2084c74
Return 405 for GET requests on stateless HTTP servers 2026-02-16 09:08:32 -05:00
Jeremiah Lowin
648684d2bb
Introduce ResourceResult as canonical resource return type (#2734) 2025-12-25 21:21:55 -05:00
Jeremiah Lowin
f36b147f60
Unify component storage in LocalProvider (#2680) 2025-12-23 19:24:09 -05:00
Chris Guidry
18538e872b Bump pydocket to 0.16.3 to fix worker cleanup race condition
pydocket 0.16.3 fixes a race condition in `_worker_loop` where cancellation
arriving between `_worker_done.clear()` and the try block would cause
`_worker_done.set()` to never run, blocking `Worker.__aexit__` forever.

Also fixes:
- Simplified `_docket_lifespan` cleanup (timeout wrapper no longer needed)
- Fixed `nested_server` test fixture to use graceful uvicorn shutdown
- Fixed uv transport tests to use local fastmcp in dev mode

Closes #2679

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 18:40:07 -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
Mathew Han
54156d6b93
Expose get_session_id callback (#2486)
* [feat] expose get_session_id callback

* [test] add test for session id callback

* [fix] add test for uninitialized case and default to None

* [fix] add in changes based on reviewers
2025-12-09 12:24:11 -05:00
Jeremiah Lowin
6cc9559f84
Bump ty to ==0.0.1a25 (#2350)
* Bump ty to >=0.0.1a25 with type fixes

Follow-up to #2295. Updates ty and fixes compatibility issues with alpha 25, including:

- Updated ignore comment syntax (possibly-unbound-attribute → possibly-missing-attribute)
- Fixed async generator type handling with anext()
- Fixed type narrowing for timeout parameters
- Converted base_url assignments to AnyHttpUrl after string manipulation
- Added CallToolResult to return type annotations
- Removed redundant type casts
- Fixed test form data to use strings instead of bytes

ty alpha 25 has limitations with isinstance() narrowing on unions (see pyproject.toml for details), requiring some targeted type ignores.

* Pin ty to ==0.0.1a25

Alpha releases can have breaking changes, so pin to the tested version.
2025-11-02 20:02:45 -05:00
Jeremiah Lowin
3321644ad3
Replace subprocess tests with in-process async servers (#2006)
* Use anyio as testing backend

* Remove asyncio markers

* Update streamable http tests

* Replace all subprocess tests

* Replace anyio task groups with asyncio context managers in tests

- Convert run_server_async from anyio task group pattern to asyncio.create_task with async context manager
- Remove task_group fixture from conftest
- Update all test fixtures to use async with run_server_async pattern
- Remove TaskGroup imports from all test files
- Tests now work with pytest-asyncio instead of pytest-anyio

* Update test_github_provider_integration.py
2025-10-19 10:47:54 -04:00
Jeremiah Lowin
e8673b4d8b
Fix Python 3.13 websockets deprecation warning (#1949) 2025-09-29 15:24:20 -04:00
nate nowack
04831b75c2
optimize test suite (#1893)
Co-authored-by: Claude <noreply@anthropic.com>
2025-09-22 20:07:04 -04:00
William Easton
fe4f31c2c7
Enable more type checking rules (#1775) 2025-09-07 11:11:44 -04:00
Jeremiah Lowin
87e103222e
Improve redirect handling to address 307's (#1387) 2025-08-08 11:55:30 -04:00
Jeremiah Lowin
a52c28c319 Ensure tests use stateless mode 2025-07-03 19:55:49 -04:00
Jeremiah Lowin
ebc721bdf1 Fix tests 2025-06-28 20:19:08 -04:00
Jeremiah Lowin
ecfbf5de00 Support implicit Elicitation acceptance 2025-06-28 20:15:23 -04:00
Jeremiah Lowin
d8dc28b9b2 Add structured content & update almost all tests 2025-06-27 15:40:52 -04:00
Jeremiah Lowin
987dd85826 Update test_streamable_http.py 2025-06-22 20:08:36 -04:00
Jeremiah Lowin
ffe0c92d63 Alias streamable-http as http 2025-06-22 20:00:11 -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
Alexander Seeliger
ec24a07060 chore: fix format 2025-06-15 18:25:55 +02:00
Alexander Seeliger
68567e5b59 chore: revert change 2025-06-15 18:12:14 +02:00
Alexander Seeliger
64bf0a4112 chore: clean up tests 2025-06-15 18:11:43 +02:00
Alexander Seeliger
bdc3e395e1 fix: missing related_request_id for report_progress 2025-06-15 17:47:09 +02:00
Jeremiah Lowin
a1955eb5cd Remove old client test; ensure server starts on every test 2025-06-14 14:16:18 -04:00
Jeremiah Lowin
c9c10a55d8 Try expanding timeout because test error 2025-06-14 10:46:20 -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
d7824f1414 Move nested server 2025-06-01 09:35:42 -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
a0e69a4cb2 Skip timeout tests on windows 2025-05-20 09:33:17 -04:00
Jeremiah Lowin
c3e9bdb49e Add lifespan property to app 2025-05-16 10:51:48 -04:00
Jeremiah Lowin
837d4c407d
Add timeout support to client (#455)
* Add timeouts kwargs

* Add timeout support

* Fix windows handling and docs

* Update client.mdx

* Windows tests

* Update test_sse.py

* Update test_sse.py

* Update test_sse.py

* Update test_sse.py

* Fix windows
2025-05-14 20:50:24 -04:00
Jeremiah Lowin
38ae8de404 Add test for SHTTP 2025-05-13 11:06:40 -04:00
Jeremiah Lowin
b6d1b3f52f Deprecate transport-specific methods 2025-05-10 11:34:47 -04:00
Jeremiah Lowin
a0939e57fe test nested servers 2025-05-09 17:27:22 -04:00
Jeremiah Lowin
cabe668e41 Incorporate streamable HTTP server changes 2025-05-07 12:13:17 -04:00