Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2f23ceb
update types.py for tasks
maxisbey Nov 18, 2025
7105d9d
add mvp for server side tasks
maxisbey Nov 19, 2025
2588391
tasks additions
maxisbey Nov 20, 2025
109920e
client
maxisbey Nov 20, 2025
f75029f
taskhint gone
maxisbey Nov 21, 2025
aff2a8c
add task helpers to context
maxisbey Nov 21, 2025
d2968a9
fix utc datetime import, circular dependency, and add type hints
maxisbey Nov 24, 2025
61354eb
notifications and client side
maxisbey Nov 24, 2025
b709d6f
Add client-side task handler protocols and auto-capability building
maxisbey Nov 24, 2025
4c0385f
Refactor client task handlers into ExperimentalTaskHandlers dataclass
maxisbey Nov 24, 2025
78e177b
Add interactive task examples and move call_tool_as_task to experimental
maxisbey Nov 25, 2025
f138fcb
Rename TaskExecutionMode values to match updated spec
maxisbey Nov 25, 2025
0c7df11
Add initial basic docs
maxisbey Nov 25, 2025
ec08851
Add lastUpdatedAt field and related-task metadata for spec conformance
maxisbey Nov 25, 2025
71b7324
Add cancel_task helper and terminal status transition validation
maxisbey Nov 25, 2025
4dde3fc
Add model-immediate-response support to run_task helper
maxisbey Nov 25, 2025
6e2b727
Fix race condition in response routing and simplify handler registration
maxisbey Nov 26, 2025
3c4f262
Fix ElicitRequestParams usage in task_session.py
maxisbey Nov 26, 2025
34ad089
Refactor task architecture: separate pure state from server integration
maxisbey Nov 27, 2025
800b409
Use call_tool_as_task helper in simple-task-client example
maxisbey Nov 27, 2025
9c535a7
Simplify simple-task server example using new task API
maxisbey Nov 27, 2025
e200fbd
Replace magic strings with constants for task status and metadata
maxisbey Nov 27, 2025
8b31b61
Clean up task code: fix error codes, imports, type annotations, and a…
maxisbey Nov 27, 2025
76b3a26
Refactor test_handlers.py to use client_streams fixture
maxisbey Nov 27, 2025
499602e
Use typed request classes instead of hardcoded method strings in test…
maxisbey Nov 27, 2025
dadcccb
Add experimental warning to send_message docstring
maxisbey Nov 27, 2025
4eb5e45
Remove unnecessary request_params from RequestResponder
maxisbey Nov 27, 2025
2f3b792
Add test for task-augmented elicitation (covers client/session.py lin…
maxisbey Nov 27, 2025
b184785
Add coverage tests and fix gaps
maxisbey Nov 27, 2025
27303bc
Add TaskResultHandler unit tests
maxisbey Nov 27, 2025
5830e3c
Add coverage tests for experimental tasks code
maxisbey Nov 27, 2025
a118f98
Add session method coverage tests
maxisbey Nov 27, 2025
49543bb
Add coverage for remaining branch gaps
maxisbey Nov 27, 2025
b529e26
Achieve 100% coverage for experimental tasks
maxisbey Nov 27, 2025
98782fc
Add poll_task() method and update examples to use spec-compliant polling
maxisbey Nov 28, 2025
a9548e8
Revert unnecessary refactor of pkg_version function
maxisbey Nov 28, 2025
a28a650
Add explanatory comment for type narrowing guard in _handle_response
maxisbey Nov 28, 2025
1efe8b0
Add server→client task-augmented elicitation and sampling support
maxisbey Nov 28, 2025
8cd2765
Refactor tasks capability checking into isolated module
maxisbey Nov 28, 2025
b7d44fa
Add comprehensive capability tests and improve test coverage
maxisbey Nov 28, 2025
6eb1b3f
Unify sampling and elicitation code paths with shared validation
maxisbey Nov 28, 2025
e8c7c8a
Achieve 100% test coverage for tasks code
maxisbey Nov 28, 2025
e68f821
Refactor example servers to have simpler tool dispatch
maxisbey Nov 28, 2025
05e19de
Clean up test code patterns
maxisbey Nov 28, 2025
fde9dc8
Clean up test code: remove useless comments and replace sleeps with e…
maxisbey Nov 28, 2025
fc60097
Merge branch 'main' into maxisbey/SEP-1686_Tasks
felixweinberger Nov 28, 2025
4516515
Rewrite tasks documentation for new API
maxisbey Nov 28, 2025
757df38
Fix outdated references in example READMEs
maxisbey Nov 28, 2025
1688c6a
Simplify catch-all case in client session match
maxisbey Nov 28, 2025
31b5aa1
Mark unreachable catch-all case as excluded from coverage
maxisbey Nov 28, 2025
973641c
Re-enable disabled stdio cleanup tests
maxisbey Nov 28, 2025
14c8fb3
Align types.py with official MCP schema for tasks
maxisbey Nov 28, 2025
bbd0ed3
Address review feedback
maxisbey Nov 28, 2025
728c139
Use distinct variable names in interactive task client example
maxisbey Nov 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2512,6 +2512,7 @@ MCP servers declare capabilities during initialization:
## Documentation

- [API Reference](https://modelcontextprotocol.github.io/python-sdk/api/)
- [Experimental Features (Tasks)](https://modelcontextprotocol.github.io/python-sdk/experimental/tasks/)
- [Model Context Protocol documentation](https://modelcontextprotocol.io)
- [Model Context Protocol specification](https://modelcontextprotocol.io/specification/latest)
- [Officially supported servers](https://github.com/modelcontextprotocol/servers)
Expand Down
43 changes: 43 additions & 0 deletions docs/experimental/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Experimental Features

!!! warning "Experimental APIs"

The features in this section are experimental and may change without notice.
They track the evolving MCP specification and are not yet stable.

This section documents experimental features in the MCP Python SDK. These features
implement draft specifications that are still being refined.

## Available Experimental Features

### [Tasks](tasks.md)

Tasks enable asynchronous execution of MCP operations. Instead of waiting for a
long-running operation to complete, the server returns a task reference immediately.
Clients can then poll for status updates and retrieve results when ready.

Tasks are useful for:

- **Long-running computations** that would otherwise block
- **Batch operations** that process many items
- **Interactive workflows** that require user input (elicitation) or LLM assistance (sampling)

## Using Experimental APIs

Experimental features are accessed via the `.experimental` property:

```python
# Server-side
@server.experimental.get_task()
async def handle_get_task(request: GetTaskRequest) -> GetTaskResult:
...

# Client-side
result = await session.experimental.call_tool_as_task("tool_name", {"arg": "value"})
```

## Providing Feedback

Since these features are experimental, feedback is especially valuable. If you encounter
issues or have suggestions, please open an issue on the
[python-sdk repository](https://github.com/modelcontextprotocol/python-sdk/issues).
Loading