Claude Code中英文系列教程31:使用 MCP 里面的资源

MCP servers can expose resources that you can reference using @ mentions, similar to how you reference files.

MCP 服务器可以暴露资源,你可以使用@来引用这些资源,类似于引用文件的方式。

List available resources 列出可用资源

Type @ in your prompt to see available resources from all connected MCP servers. Resources appear alongside files in the autocomplete menu.

在提示中输入 @ 以查看所有已连接 MCP 服务器的可用资源。资源会显示在自动完成菜单中的文件旁边。

Reference a specific resource

引用特定资源

Use the format @server\:protocol://resource/path to reference a resource:

使用 @server\:protocol://resource/path 格式引用资源:

```bash

> Can you analyze @github:issue://123 and suggest a fix?

> Please review the API documentation at @docs:file://api/authentication

```

Multiple resource references

多个资源引用

You can reference multiple resources in a single prompt:

您可以在单个提示中引用多个资源:

```bash

> Compare @postgres:schema://users with @docs:file://database/user-model

```

Tips: 提示:

Resources are automatically fetched and included as attachments when referenced

当被引用时,资源会自动获取并以附件形式包含

Resource paths are fuzzy-searchable in the @ mention autocomplete

资源路径可以在@的自动补全中进行模糊搜索

Claude Code automatically provides tools to list and read MCP resources when servers support them

当服务器支持时,Claude Code 会自动提供工具来列出和读取 MCP 资源

Resources can contain any type of content that the MCP server provides (text, JSON, structured data, etc.)

资源可以包含 MCP 服务器提供的任何类型的内容(文本、JSON、结构化数据等)

相关推荐
90后的晨仔4 小时前
Claude Code + pytest 接口自动化是什么?
ai编程
哪吒编程8 小时前
GPT-5.4上线,编程能力超过Claude Opus 4.6
openai·ai编程
万少9 小时前
使用Trae轻松安装openclaw的教程-附带免费token
前端·openai·ai编程
gyx_这个杀手不太冷静10 小时前
让 AI 替你写代码:OpenCode 完全配置与高效使用手册
前端·ai编程
摆烂工程师13 小时前
GPT-5.4 发布!再看 OpenClaw:AI 真正危险的,不是更会聊天,而是开始自己“干活”
人工智能·openai·ai编程
恋猫de小郭1 天前
你用的 Claude 可能是虚假 Claude ,论文数据告诉你,Shadow API 中的欺骗性模型声明
前端·人工智能·ai编程
cipher1 天前
HAPI + 设备指纹认证:打造更安全的远程编程体验
前端·后端·ai编程
NikoAI编程1 天前
Claude Code 的记忆体系:CLAUDE.md 和 MEMORY.md
ai编程
量子位1 天前
Transformer论文作者重造龙虾,Rust搓出钢铁版,告别OpenClaw裸奔漏洞
rust·openai·ai编程
量子位1 天前
1秒1元!Seedance 2.0模型定价公布,短剧真的要被颠覆了
aigc·ai编程