Skip to content

feat: use MCP Tasks protocol for async operations#1631

Merged
bokelley merged 4 commits into
mainfrom
bokelley/mcp-task-support
Mar 23, 2026
Merged

feat: use MCP Tasks protocol for async operations#1631
bokelley merged 4 commits into
mainfrom
bokelley/mcp-task-support

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Replace hand-rolled task store (~60 lines) with SDK's InMemoryTaskStore — the SDK auto-registers handlers for tasks/get, tasks/result, tasks/list, tasks/cancel
  • Training agent uses extra.taskStore (SDK wrapper with status notifications and session propagation) with raw store fallback for test harness
  • TTL clamped to 24h max / 1h default to prevent memory exhaustion
  • Tool definitions declare execution.taskSupport per MCP Tasks spec
  • Docs show both Server + taskStore and McpServer + registerToolTask paths
  • Security guidance for publishers: session scoping, TTL limits, rate limits

Related client-side work: adcontextprotocol/adcp-client#378, adcontextprotocol/adcp-client#379

Test plan

  • 191 training agent tests pass (including 9 MCP Tasks protocol tests)
  • TypeScript compiles cleanly
  • Pre-commit hooks pass (schema validation, doc nav, link checking, accessibility)
  • Code review: 2 rounds, all findings addressed
  • Security review: no must-fixes, TTL clamping and session isolation guidance added
  • Protocol expert review: extra.taskStore pattern verified, SDK behavior confirmed
  • Docs expert review: code examples accurate, cross-references valid
  • CI passes

🤖 Generated with Claude Code

bokelley and others added 4 commits March 23, 2026 07:09
Replace hand-rolled task store with the MCP SDK's InMemoryTaskStore.
The SDK auto-registers handlers for tasks/get, tasks/result, tasks/list,
and tasks/cancel when taskStore is passed to the Server constructor.

- Training agent uses extra.taskStore (SDK wrapper with status
  notifications and session propagation) with raw store fallback for tests
- TTL clamped to 24h max, 1h default to prevent memory exhaustion
- Tool definitions declare execution.taskSupport per MCP spec
- Docs show both Server + taskStore and McpServer + registerToolTask paths
- Security guidance for publishers: session scoping, TTL limits, rate limits

Related: adcontextprotocol/adcp-client#378

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge main into mcp-task-support branch. Resolve conflict in
task-handlers.ts tools/call handler by combining our task-augmented
result assignment pattern with main's adcpError() structured error
format. Update 27 test assertions to match adcpError response shape.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… format and status_filter defaults

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit c9606a7 into main Mar 23, 2026
12 checks passed
bokelley added a commit that referenced this pull request Mar 23, 2026
Take main's training-agent tests (already fixed by MCP Tasks PR #1631),
renumber our migration from 323 to 324 to avoid conflict with
323_addie_no_speculation.sql, and update test reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant