[Story] Let the model discover MCP resources

Đang mở
#2,760 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Start by reading McpHub and the native tool implementations for access_mcp_resource, then trace how allowed and disabled MCP servers are handled. Add list_mcp_resources with the specified paging, query ranking, and metadata fields, and update resource discovery to follow cursors with a page limit. Done means the acceptance criteria pass, including template-only servers and stable offsets.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Context

Zoo Code gets resource and resource template lists from each MCP server. The model does not see them. The model has access_mcp_resource, but it has no source of URIs. A server with many resources (for example, 305) is thus difficult to use.

Part of #584. Starts after #578 merges (#2323). Does not depend on #579.

Related designs: the MCP resources spec leaves this decision to the host application. Codex and Claude Code give the model a tool that lists resources.

Developer Notes

  • Add a native tool list_mcp_resources with these optional parameters: query, server_name, offset.
  • Return a maximum of 20 entries, the total count, and the next offset.
  • For each entry, return server_name, uri or uriTemplate, name, and a shortened description.
  • With query, rank the entries with Bm25Ranker. Include the URI in the ranked text.
  • If query matches nothing, return the first page and say that nothing matched.
  • Without query, return the entries in a stable order.
  • Apply the allowedMcpServers list of the mode. Exclude disabled servers.
  • Offer this tool and access_mcp_resource when an allowed server has a resource or a template. Today, a server with only templates enables neither.
  • Follow nextCursor for resources/list and resources/templates/list. Today, McpHub reads only the first page. Set a page limit. Log a warning at the limit.
  • Do not put resource entries in the system prompt or the tool definitions.
  • Listing needs no approval, because it returns only cached metadata. Reading still needs approval.

Acceptance Criteria

  • With 305 resources, one call returns a maximum of 20 entries and the total count.
  • A query returns the matching resource, and access_mcp_resource can read its URI.
  • A query with no match returns the first page.
  • The offsets reach each entry exactly one time.
  • A server with only templates enables both tools.
  • Disallowed servers and disabled servers do not appear.
  • A server response with two pages gives all entries.
  • The size of the tool definitions does not change with the resource count.

Out of Scope

  • @ mentions for resources
  • resources/subscribe and list_changed notifications
  • Embeddings ranking
  • Filtering by annotations
  • Pagination for tools/list
Ngôn ngữ chính
TypeScript
Star
2k
Fork
301
Merge trung bình
3 ngày 14 giờ
Pull request đã merge (30 ngày)
103

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Zoo-Code-Org/Zoo-Code

Tất cả issue của Zoo-Code-Org/Zoo-Code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.