|
| 1 | +# Experimental Features |
| 2 | + |
| 3 | +!!! warning "Experimental APIs" |
| 4 | + |
| 5 | +The features in this section are experimental and may change without notice. |
| 6 | +They track the evolving MCP specification and are not yet stable. |
| 7 | + |
| 8 | +This section documents experimental features in the MCP Python SDK. These features |
| 9 | +implement draft specifications that are still being refined. |
| 10 | + |
| 11 | +## Available Experimental Features |
| 12 | + |
| 13 | +### [Tasks](tasks.md) |
| 14 | + |
| 15 | +Tasks enable asynchronous execution of MCP operations. Instead of waiting for a |
| 16 | +long-running operation to complete, the server returns a task reference immediately. |
| 17 | +Clients can then poll for status updates and retrieve results when ready. |
| 18 | + |
| 19 | +Tasks are useful for: |
| 20 | + |
| 21 | +- **Long-running computations** that would otherwise block |
| 22 | +- **Batch operations** that process many items |
| 23 | +- **Interactive workflows** that require user input (elicitation) or LLM assistance (sampling) |
| 24 | + |
| 25 | +## Using Experimental APIs |
| 26 | + |
| 27 | +Experimental features are accessed via the `.experimental` property: |
| 28 | + |
| 29 | +```python |
| 30 | +# Server-side |
| 31 | +@server.experimental.get_task() |
| 32 | +async def handle_get_task(request: GetTaskRequest) -> GetTaskResult: |
| 33 | +... |
| 34 | + |
| 35 | +# Client-side |
| 36 | +result = await session.experimental.call_tool_as_task("tool_name", {"arg": "value"}) |
| 37 | +``` |
| 38 | + |
| 39 | +## Providing Feedback |
| 40 | + |
| 41 | +Since these features are experimental, feedback is especially valuable. If you encounter |
| 42 | +issues or have suggestions, please open an issue on the |
| 43 | +[python-sdk repository](https://github.com/modelcontextprotocol/python-sdk/issues). |