From a53030a806e91d4c0ac0bff474228e52a09937b6 Mon Sep 17 00:00:00 2001 From: "marvin-context-protocol[bot]" <225465937+marvin-context-protocol[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 21:00:34 +0000 Subject: [PATCH] chore: Update SDK documentation --- .../fastmcp-server-tasks-elicitation.mdx | 24 ++++++++++++++++++- .../fastmcp-server-tasks-notifications.mdx | 16 +++++++------ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/docs/python-sdk/fastmcp-server-tasks-elicitation.mdx b/docs/python-sdk/fastmcp-server-tasks-elicitation.mdx index f30b084ca..3bdd697ef 100644 --- a/docs/python-sdk/fastmcp-server-tasks-elicitation.mdx +++ b/docs/python-sdk/fastmcp-server-tasks-elicitation.mdx @@ -50,7 +50,29 @@ in a Docket worker context where there's no active MCP request. - `McpError`: If the elicitation request fails -### `handle_task_input` +### `relay_elicitation` + +```python +relay_elicitation(session: ServerSession, session_id: str, task_id: str, elicitation: dict[str, Any], fastmcp: FastMCP) -> None +``` + + +Relay elicitation from a background task worker to the client. + +Called by the notification subscriber when it detects an input_required +notification with elicitation metadata. Sends a standard elicitation/create +request to the client session, then uses handle_task_input() to push the +response to Redis so the blocked worker can resume. + +**Args:** +- `session`: MCP ServerSession +- `session_id`: Session identifier +- `task_id`: Background task ID +- `elicitation`: Elicitation metadata (message, requestedSchema) +- `fastmcp`: FastMCP server instance + + +### `handle_task_input` ```python handle_task_input(task_id: str, session_id: str, action: str, content: dict[str, Any] | None, fastmcp: FastMCP) -> bool diff --git a/docs/python-sdk/fastmcp-server-tasks-notifications.mdx b/docs/python-sdk/fastmcp-server-tasks-notifications.mdx index a69f97f7b..6652d7600 100644 --- a/docs/python-sdk/fastmcp-server-tasks-notifications.mdx +++ b/docs/python-sdk/fastmcp-server-tasks-notifications.mdx @@ -25,7 +25,7 @@ require reliable delivery (input_required prompts, cancel signals). ## Functions -### `push_notification` +### `push_notification` ```python push_notification(session_id: str, notification: dict[str, Any], docket: Docket) -> None @@ -43,10 +43,10 @@ that need reliable delivery across distributed processes. - `docket`: Docket instance for Redis access -### `notification_subscriber_loop` +### `notification_subscriber_loop` ```python -notification_subscriber_loop(session_id: str, session: ServerSession, docket: Docket) -> None +notification_subscriber_loop(session_id: str, session: ServerSession, docket: Docket, fastmcp: FastMCP) -> None ``` @@ -64,12 +64,13 @@ This loop: - `session_id`: Session identifier to subscribe to - `session`: MCP ServerSession for sending notifications - `docket`: Docket instance for Redis access +- `fastmcp`: FastMCP server instance (for elicitation relay) -### `ensure_subscriber_running` +### `ensure_subscriber_running` ```python -ensure_subscriber_running(session_id: str, session: ServerSession, docket: Docket) -> None +ensure_subscriber_running(session_id: str, session: ServerSession, docket: Docket, fastmcp: FastMCP) -> None ``` @@ -82,9 +83,10 @@ Safe to call multiple times for the same session. - `session_id`: Session identifier - `session`: MCP ServerSession - `docket`: Docket instance +- `fastmcp`: FastMCP server instance (for elicitation relay) -### `stop_subscriber` +### `stop_subscriber` ```python stop_subscriber(session_id: str) -> None @@ -100,7 +102,7 @@ for delivery if client reconnects (with TTL expiration). - `session_id`: Session identifier -### `get_subscriber_count` +### `get_subscriber_count` ```python get_subscriber_count() -> int