Skip to content

[Server] SEP-2663 Tasks: TaskStoreInterface with InMemory and PSR-16 stores #347

Description

@chr-hertel

Task persistence for SEP-2663 for the 2026-07-28 release. Tracked by umbrella #335.

Scope

  • Mcp\Server\Task\TaskStoreInterface: save(), get() (null for unknown or expired — a client cannot tell them apart and does not need to), delete().
  • InMemoryTaskStore with a task limit (default 1000, oldest-by-last-use evicted) so unbounded task creation cannot exhaust memory. Right for stdio and single-process runtimes; wrong under PHP-FPM, where the worker that creates a task is not the one polled for it.
  • Psr16TaskStore (PSR-16 cache-backed) for PHP-FPM — a filesystem adapter covers the "file store" case, so no separate FileTaskStore.
  • Expiry is TTL-based (Task::isReadable() on read, cache TTL for PSR-16) plus the in-memory limit; no request-counted GC pass.
  • The store is the one place both server-side task state and the pending server→client asks (Task::$inputRequests) live.
  • The store is handed to TasksExtension, not to the builder (see [Server] SEP-2663 Tasks: TasksExtension, capability gate, tasks/* handlers #346).

Metadata

Metadata

Assignees

No one assigned

    Labels

    2026-07-28All issues and PRs related to the spec release 2026-07-28ServerIssues & PRs related to the Server componentenhancementRequest for a new feature that's not currently supportedimproves spec complianceImproves consistency with other SDKs such as TyepScriptneeds designValid issue but needs maintainer alignment on design or approach

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions