Commit Graph

75 Commits

Author SHA1 Message Date
Max Isbey cfde91dacd chore: exempt tests from ANN, enable mypy-init-return
Align with ecosystem norms per review feedback:
- Add mypy-init-return = true to skip -> None on __init__ when args are typed
- Exempt tests/** from ANN rules (near-universal practice)
- Revert test file annotations and __init__-only changes

Shrinks diff from 149 to ~47 files, keeping the valuable src/ return
type annotations that close the pyright gap.
2026-03-24 23:04:34 +00:00
Max Isbey 5697d68e65 chore: enforce type annotations on all functions via ruff ANN rules
Enable the `ANN` (flake8-annotations) rule set to require return type
and argument annotations on all function definitions. Pyright strict
already enforces argument types but infers return types silently; this
closes the gap so every function has an explicit return annotation.

Configuration choices:
- `ANN401` (any-type) is ignored: `Any` is sometimes the right answer
  and pyright strict already catches genuine misuse.
- `allow-star-arg-any = true`: `*args: Any, **kwargs: Any` is a common
  valid pattern for pass-through wrappers.
- Per-file ignores for `test_func_metadata.py` and `test_server.py` where
  untyped parameters are intentional (testing schema inference on
  unannotated signatures).
- README code snippets (via pytest-examples) exempt — short doc
  examples shouldn't need full annotations.

Auto-fix added `-> None` or inferred return types to ~910 functions.
The remaining ~100 were annotated manually — mostly
`@asynccontextmanager` generators, pytest fixtures, and ASGI handlers
that Ruff couldn't infer.
2026-03-24 23:04:34 +00:00
Akshan Krithick fc57c2c4c5 test: fix progress notification assertions for related_request_id (#2038)
Co-authored-by: Lee Hubbard <hubbard.zlee@unknowncyber.com>
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
2026-02-18 11:53:03 +00:00
Max Isbey 0a22a9dc33 refactor: replace lowlevel Server decorators with on_* constructor kwargs (#1985) 2026-02-12 15:55:54 +00:00
Marcelo Trylesinski b1f7eec3cd refactor: split RequestContext between server and client (#1987) 2026-02-03 14:35:07 +01:00
Marcelo Trylesinski 14744c66c5 Add tests for MCPServer.read_resource exception handling (#1957) 2026-01-27 13:49:06 +01:00
Marcelo Trylesinski acba5478a9 refactor: McpError renamed to MCPError and flatten parameters (#1956)
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
2026-01-26 14:37:44 +01:00
Marcelo Trylesinski 65c614e48e Rename FastMCP to MCPServer (#1951) 2026-01-25 14:45:52 +01:00
Max Isbey a7ddfdae07 ci: add strict-no-cover to detect unnecessary coverage pragmas (#1897) 2026-01-23 21:00:20 +01:00
Marcelo Trylesinski f0ab53e194 Add meta to Client methods (#1923) 2026-01-22 14:50:39 +01:00
Marcelo Trylesinski 5fdd48a0d3 Completely drop RootModel from types module (#1910) 2026-01-19 14:29:15 +01:00
Marcelo Trylesinski f4672c5084 Drop RootModel from JSONRPCMessage (#1908) 2026-01-19 14:04:15 +01:00
Felix Weinberger d41d0c0128 chore: add D212 lint rule to enforce Google-style docstrings (#1892) 2026-01-16 16:10:52 +00:00
Felix Weinberger df039bf97c Add ergonomic Client class for testing MCP servers (#1870) 2026-01-16 15:49:26 +00:00
Marcelo Trylesinski e94b386a13 refactor: use snake case instead of camel case in types (#1894) 2026-01-16 15:51:27 +01:00
Felix Weinberger 0622babbd9 fix: URL-decode parameters extracted from resource templates (#1864) 2026-01-16 13:47:21 +00:00
Felix Weinberger cfb2909631 fix: change Resource URI fields from AnyUrl to str (#1863) 2026-01-16 09:58:57 +01:00
Marcelo Trylesinski 6149b63a44 tests: add missing init files (#1831) 2026-01-06 19:52:09 +01:00
Yugan 2aa1ad2a69 feat: standardize timeout values to floats in seconds (#1766) 2025-12-19 12:22:56 +00:00
Anton Pidkuiko 8ac11ec604 fix: allow MIME type parameters in resource validation (RFC 2045) (#1755)
Co-authored-by: Claude <noreply@anthropic.com>
2025-12-09 14:56:40 +00:00
Edison 9ed0b93ceb fix: handle ClosedResourceError in StreamableHTTP message router (#1384)
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2025-12-04 11:36:23 +01:00
Felix Weinberger 8e02fc17e1 chore: update LATEST_PROTOCOL_VERSION to 2025-11-25 (#1715)
Main branch checks / checks (push) Failing after 1s
2025-12-02 18:27:27 +00:00
Max Isbey 89e9c43acf Get baseline 100% clean coverage (#1553) 2025-11-11 14:09:32 +01:00
Max Isbey c44e68f766 Fix flaky timeout test in test_88_random_error (#1525) 2025-10-28 14:45:25 -07:00
Peter Alexander 3e798bfc01 Add icons support for ResourceTemplate (#1412)
Main branch checks / checks (push) Failing after 0s
2025-10-01 13:23:46 +01:00
Peter Alexander 80c0d23d48 Update Icon.sizes to use string array format (#1411) 2025-09-29 14:27:32 +01:00
Peter Alexander 71889d7387 Implementation of SEP 973 - Additional metadata + icons support (#1357)
Main branch checks / checks (push) Failing after 1s
2025-09-24 20:29:04 +01:00
Sreenath Somarajapuram 07ae8c0d4e types: Setting default value for method: Literal (#1292) 2025-08-26 16:22:56 +01:00
Marcelo Trylesinski c7671e470c Add pyright strict mode on the whole project (#1254) 2025-08-11 18:56:37 +01:00
Inna Harper 0b1b52ba45 fix flaky test test_88_random_error (#1171) 2025-07-18 16:21:33 +01:00
Felix Weinberger 3abefeeeaf fweinberger/align shutdown with spec (#1091)
Co-authored-by: davenpi <davenport.ianc@gmail.com>
2025-07-09 10:14:30 -04:00
Daniel Avdar b16c2a8518 #552 (#707)
Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com>
Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
2025-07-08 17:24:36 +01:00
Inna Harper 3d67e723e5 Fix async resource functions not being awaited (#1092)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2025-07-06 10:22:52 +01:00
Marcelo Trylesinski 3fa7bc7b61 tests: add lowest dependency tests (#1067)
Co-authored-by: ihrpr <inna@anthropic.com>
2025-07-06 09:38:56 +02:00
AishwaryaKalloli 6f43d1f170 Flaky test fix (#1050) 2025-06-29 21:53:32 +01:00
bhosmer-ant 43bb24f62b feat: Add structured output support for tool functions (#993) 2025-06-26 09:36:17 +01:00
Inna Harper d0443a1832 Add resource Link (#974) 2025-06-17 20:23:07 +01:00
Marc Abramowitz 029f434109 Allow longer duration in test_188_concurrency (#969) 2025-06-17 11:55:29 +01:00
Luca Chang d69b290b65 chore: create union for working with message content (#939) 2025-06-12 09:01:33 +02:00
Marcelo Trylesinski 543961968c Use 120 characters instead of 88 (#856) 2025-06-11 11:45:50 +02:00
David Dworken 29c69e6a47 Fix uncaught exception in MCP server (#822) 2025-06-09 17:03:15 -07:00
Luca Chang 7123556a34 feat: support audio content (#725)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2025-06-07 14:32:11 +00:00
Nate Barbettini e80c0150e1 fix: Pass cursor parameter to server (#745)
Main branch checks / checks (push) Failing after 0s
Check uv.lock / check-lock (push) Has been cancelled
2025-05-21 22:27:06 +01:00
Akshey D 9e66f7ce89 feat: add message to ProgressNotification (#435)
Co-authored-by: ihrpr <inna.hrpr@gmail.com>
2025-05-13 18:40:15 +01:00
ihrpr 9d99aee014 Revert "Add message queue for SSE messages POST endpoint (#459)" (#649) 2025-05-07 16:35:20 +01:00
Akash D 3b1b213a96 Add message queue for SSE messages POST endpoint (#459) 2025-05-06 17:10:43 -07:00
ihrpr da0cf22355 Wrap JSONRPC messages with SessionMessage for metadata support (#590) 2025-05-02 14:29:00 +01:00
ihrpr 78f0b11a09 StreamableHttp - Server transport with state management (#553) 2025-05-02 11:58:54 +01:00
Christian Clauss babb477dff Python lint: Ruff rules for comprehensions and performance (#512) 2025-04-15 16:58:33 +02:00
evalstate 6d66ab8be0 Fix/base64 handling (Issue #342) (#343)
Co-authored-by: David Soria Parra <167242713+dsp-ant@users.noreply.github.com>
2025-03-27 09:18:02 +00:00