modelcontextprotocol / modelcontextprotocol/php-sdk
[Server] SEP-2663 Tasks: TaskStoreInterface with InMemory and PSR-16 stores
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- PHP
- Star
- 1.6k
- Fork
- 173
- Merge trung bình
- 2 ngày 49 phút
- Pull request đã merge (30 ngày)
- 23
Mô tả
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().InMemoryTaskStorewith 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 separateFileTaskStore.- 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).
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách xác định TasksExtension, Task::isReadable() và các điểm vào được đề xuất của TaskStoreInterface. Theo dõi cách trạng thái task phía máy chủ và Task::$inputRequests được truyền cho extension, sau đó xác định trách nhiệm của InMemoryTaskStore và Psr16TaskStore. Hoàn thành có nghĩa là save/get/delete hoạt động với thời hạn hết hạn, trong bộ nhớ có cơ chế loại bỏ có giới hạn mục cũ nhất theo lần sử dụng gần nhất, và hành vi TTL của PSR-16 hỗ trợ PHP-FPM.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- php
- Lĩnh vực
- backend
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 52/100