57 Commits

Author SHA1 Message Date
Max 9678a3b347 [v1.x] Route Context.report_progress() to the originating request stream (#2994) 2026-06-26 15:43:15 +02: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
David Soria Parra df2d3a57c2 Fix #355: Fix type error with lifespan context (#368)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2025-03-26 14:18:41 +00:00
David Soria Parra 568cbd1a66 Fix #201: Move incoming message stream from BaseSession to ServerSession (#325)
Co-authored-by: Claude <noreply@anthropic.com>
2025-03-24 14:14:14 +00:00
Marcelo Trylesinski ae77772ea8 Add strict mode to pyright (#315)
* Add strict mode to pyright

* Apply UP rule

* fix readme

* More correct

* Leave wrong Context for now

* Add strict mode to pyright

* Apply UP rule

* fix readme

* fix

* ignore
2025-03-20 09:13:08 +00:00
Marcelo Trylesinski 7196604468 Revert "refactor: reorganize message handling for better type safety and clar…" (#282)
Main branch checks / checks (push) Failing after 0s
Check uv.lock / check-lock (push) Has been cancelled
This reverts commit 9d0f2daddb.
2025-03-14 09:50:46 +00:00
David Soria Parra 9d0f2daddb refactor: reorganize message handling for better type safety and clarity (#239)
Main branch checks / checks (push) Failing after 0s
Check uv.lock / check-lock (push) Has been cancelled
* refactor: improve typing with memory stream type aliases

Move memory stream type definitions to models.py and use them throughout
the codebase for better type safety and maintainability.

GitHub-Issue:#201

* refactor: move streams to ParsedMessage

* refactor: update test files to use ParsedMessage

Updates test files to work with the ParsedMessage stream type aliases
and fixes a line length issue in test_201_client_hangs_on_logging.py.

Github-Issue:#201

* refactor: rename ParsedMessage to MessageFrame for clarity

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: move MessageFrame class to types.py for better code organization

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>

* fix pyright

* refactor: update websocket client to use MessageFrame

Modified the websocket client to work with the new MessageFrame type,
preserving raw message text and properly extracting the root JSON-RPC
message when sending.

Github-Issue:#204

* fix: use NoneType instead of None for type parameters in MessageFrame

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

* refactor: rename root to message
2025-03-13 13:44:55 +00:00
Marcelo Trylesinski 94d326dbf1 Close unclosed resources in the whole project (#267)
* Close resources

* Close all resources

* Update pyproject.toml

* Close all resources

* Close all resources

* try now...

* try to ignore this

* try again

* try adding one more..

* try now

* try now

* revert ci changes
2025-03-13 10:59:45 +00:00
David Soria Parra b1942b31c4 Fix #177: Returning multiple tool results (#222)
* feat: allow lowlevel servers to return a list of resources

The resource/read message in MCP allows of multiple resources
to be returned. However, in the SDK we do not allow this. This
change is such that we allow returning multiple resource in
the lowlevel API if needed. However in FastMCP we stick to
one, since a FastMCP resource defines the mime_type in the decorator
and hence a resource cannot dynamically return different mime_typed resources.
It also is just the better default to only return one resource.
However in the lowlevel API we will allow this.

Strictly speaking this is not a BC break since the new return value
is additive, but if people subclassed server, it will break them.

* feat: lower the type requriements for call_tool to Iterable
2025-02-20 21:31:26 +00:00
David Soria Parra 10a85e452d fix: mark test as pytest.mark.anyio 2025-02-20 11:04:29 +00:00
David Soria Parra faf3a9d7d6 Merge pull request #205 from modelcontextprotocol/issue-192-request-id-test
Add test to verify request ID preservation
2025-02-13 15:10:00 +00:00
David Soria Parra fbf4acc679 fix: method ordering 2025-02-13 14:54:53 +00:00
David Soria Parra 41af509bcb Add test to verify request ID preservation
This test ensures that the server properly preserves and returns the same request ID in responses,
which is a fundamental part of the JSON-RPC protocol. The test initializes the server, sends
requests with custom IDs, and verifies that these IDs are correctly returned.

Github-Issue:#192
2025-02-12 16:32:21 +00:00
David Soria Parra e598750cba test: add tests for server lifespan support
Adds comprehensive tests for lifespan functionality:
- Tests for both low-level Server and FastMCP classes
- Coverage for startup, shutdown, and context access
- Verifies context passing to request handlers
2025-02-11 12:16:47 +00:00
David Soria Parra c58adfe3f5 Merge pull request #167 from modelcontextprotocol/davidsp/88-v2
feat: add request cancellation and cleanup
2025-02-04 20:23:05 +00:00
David Soria Parra 08cfbe522a fix: improve error handling and request cancellation for issue #88 2025-02-04 18:20:17 +00:00
David Soria Parra 888bdd3c34 tests for issue 88 2025-02-03 14:03:41 +00:00
David Soria Parra 0d3e02f6a2 fix: standardize resource response format
Github-Issue:#141
2025-02-03 11:33:32 +00:00
David Soria Parra 5e19c7cf73 Merge pull request #176 from sheffler/fixFirstProgressReport
progress_token is 0 on first tool-call and the return is taken mistakenly
2025-01-30 16:00:01 +00:00
David Soria Parra 2dc5fbfa3d fix: add test for #176 2025-01-28 11:19:13 +00:00