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

相关推荐
巴巴博一10 分钟前
2026 最新:Trae / Cursor 一键接入 taste-skill 完整教程(让 AI 前端告别“AI 味”)
前端·ai·ai编程
kyriewen16 分钟前
半夜三点线上崩了,AI替我背了锅——用AI排错,五分钟定位三年老bug
前端·javascript·ai编程
人月神话-Lee19 分钟前
【图像处理】亮度与对比度——图像的线性变换
图像处理·人工智能·ios·ai编程·swift
kyriewen34 分钟前
我让 AI 当了 24 小时全年无休的“毒舌考官”
前端·ci/cd·ai编程
ZengLiangYi2 小时前
Claude Code 对话自动导入完全指南
ai编程
ZengLiangYi2 小时前
LLM 和 Embedding 不能混用——一个血泪教训
ai编程
子昕2 小时前
Claude Code的隐藏功能:让AI组团帮你干活
ai编程
清风雅雨2 小时前
AI编程:OA流程明细表中多个金额字段由整数改为2位小数
数据库·ai编程
阿耶同学2 小时前
🔥 LangChain 实战:构建全能工具调用 Agent
ai编程
该用户已不存在2 小时前
DeepSeek-TUI 发布, GitHub 的终端 AI 编程引爆网络
aigc·ai编程·deepseek