python-sdk/tests/server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Paul Carleton d3a184119e
Some checks failed
Main branch checks / checks (push) Has been cancelled
Merge commit from fork
* Auto-enable DNS rebinding protection for localhost servers

When a FastMCP server is created with host="127.0.0.1" or "localhost"
and no explicit transport_security is provided, automatically enable
DNS rebinding protection. Both 127.0.0.1 and localhost are allowed
as valid hosts/origins since clients may use either to connect.

* Add tests for auto DNS rebinding protection on localhost

Tests verify that:
- Protection auto-enables for host=127.0.0.1
- Protection auto-enables for host=localhost
- Both 127.0.0.1 and localhost are in allowed hosts/origins
- Protection does NOT auto-enable for other hosts (e.g., 0.0.0.0)
- Explicit transport_security settings are not overridden

* Add IPv6 localhost (::1) support for DNS rebinding protection

Extend auto-enable DNS rebinding protection to also cover IPv6
localhost. When host="::1", protection is now auto-enabled with
appropriate allowed hosts ([::1]:*) and origins (http://[::1]:*).

* Fix import ordering in test file
2025-12-02 13:23:55 +00:00
..
auth Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
fastmcp Merge commit from fork 2025-12-02 13:23:55 +00:00
lowlevel Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
__init__.py Initial import 2024-09-24 22:04:19 +01:00
test_cancel_handling.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_completion_with_context.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_lifespan.py Add pyright strict mode on the whole project (#1254) 2025-08-11 18:56:37 +01:00
test_lowlevel_exception_handling.py Handles message type Exception in lowlevel/server.py _handle_message function. Mentioned as TODO on line 528. (#786) 2025-10-13 14:29:03 +01:00
test_lowlevel_input_validation.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_lowlevel_output_validation.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_lowlevel_tool_annotations.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_read_resource.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_session.py Implement SEP-1577 - Sampling With Tools (#1594) 2025-11-22 23:58:14 -05:00
test_session_race_condition.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_sse_security.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_stdio.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_streamable_http_manager.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_streamable_http_security.py Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
test_validation.py SEP-1686: Tasks (#1645) 2025-11-28 18:51:58 +00:00