Skip to content

Add task calls for MCP client tools - #1789

Open
luisangelrod wants to merge 1 commit into
modelcontextprotocol:mainfrom
luisangelrod:feature/mcp-client-tool-tasks
Open

Add task calls for MCP client tools#1789
luisangelrod wants to merge 1 commit into
modelcontextprotocol:mainfrom
luisangelrod:feature/mcp-client-tool-tasks

Conversation

@luisangelrod

Copy link
Copy Markdown

Summary

  • expose the owning client and a reusable request-parameter builder from McpClientTool
  • add CallAsTaskAsync and CallWithPollingAsync extensions for discovered client tools
  • preserve the original protocol tool name, serializer settings, and merged WithMeta / RequestOptions metadata
  • document direct task calls from McpClientTool

The tool extensions intentionally do not add get/cancel/update wrappers that accept arbitrary task IDs; callers can continue using the existing McpClient lifecycle methods for those operations.

Validation

  • McpClientTaskMethodsTests: 12 passed
  • McpClientToolTests: 39 passed
  • Tasks package builds for net10.0, net9.0, net8.0, and netstandard2.0 with 0 warnings
  • dotnet format --verify-no-changes passes

Closes #1730

@luisangelrod
luisangelrod marked this pull request as ready for review August 4, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide extensions for calling McpClientTools as tasks

1 participant