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

Open
#347 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php
Domain
backend

Research direction

Start by locating TasksExtension, Task::isReadable(), and the proposed TaskStoreInterface entry points. Trace how server-side task state and Task::$inputRequests are handed to the extension, then define the InMemoryTaskStore and Psr16TaskStore responsibilities. Done means save/get/delete work with expiry, bounded oldest-by-last-use eviction exists in memory, and PSR-16 TTL behavior supports PHP-FPM.

Written by the indexing model from the issue text.

Description

2026-07-28 enhancement improves spec compliance needs design Server

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 #346).
Dominant language
PHP
Stars
1.6k
Forks
173
Avg merge
2d 49m
Merged PRs (30d)
23

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/php-sdk

All issues in modelcontextprotocol/php-sdk

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.