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、结构化数据等)

相关推荐
丿BAIKAL巛4 小时前
KimiCode 使用教程:从开通会员到本地高效编码
ai编程
小马过河R5 小时前
Skill三件套:构建可进化技能仓库的开源工具链
人工智能·开源·ai编程·vibe coding·skills·ai辅助编码
谭光志5 小时前
OpenClaw 安装与运行教程
前端·后端·ai编程
namelessmyth6 小时前
聚合AI大模型API平台-横向评测对比
人工智能·语言模型·chatgpt·ai编程
threerocks6 小时前
AI 时代掌握 Markdown,是最基础也最必要的技能 (小红书长文也可以用哦)
人工智能·ai编程
github.com/starRTC6 小时前
规范驱动开发2:spec kit入门与使用
ai编程
三点水-here6 小时前
03 - KV Cache与批处理:大模型推理的内存管理核心技术
服务器·人工智能·ai编程
黑巧克力可减脂6 小时前
工欲善其事:从先秦工匠到AI辅助编程的智慧传承
人工智能·语言模型·ai编程
github.com/starRTC6 小时前
规范驱动开发4:openspec使用
ai编程