github / github/copilot-cli

Support MCP resources/read primitive

未关闭
#1,803 1 条评论 11 个 reaction 已指派 0 人 在 GitHub 查看
area:mcp
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the feature or problem you'd like to solve

MCP servers can expose data through the `resources` primitive (`resources/list`, `resources/read`). This is one of the three core MCP primitives alongside tools and prompts.

Currently, Copilot CLI only supports MCP **tools**. When an MCP tool returns a resource URI (e.g. `knowledge://domain/version/topic`), the agent has no way to read it and falls back to `web_fetch`, which fails on custom URI schemes:

```
✓ search_topics: pekko kafka consumer actor ordering sharding entity
└ Found 5 results for "pekko kafka consumer actor ordering sharding entity":

✗ Fetching web content: knowledge://hyraco/2.2.2/support/pekko
TypeError: fetch failed

✗ Fetching web content: knowledge://hyraco/2.2.2/support/kafka
TypeError: fetch failed
```

### Proposed solution

Implement MCP `resources/list` and `resources/read` support so the agent can:
1. Discover available resources from connected MCP servers
2. Read resource content by URI when tools return resource references

This would bring Copilot CLI's MCP support in line with Claude Code, which already supports all three MCP primitives.

### Additional context

- MCP spec: https://modelcontextprotocol.io/docs/concepts/resources
- The workaround for MCP server authors is to inline content in tool responses, but this increases token usage and loses the two-step search-then-read pattern that resources enable.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。