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

相关推荐
AwesomeDevin2 小时前
AI时代,我们的任务不应沉溺于与 AI 聊天 - 🤔 从“对话式编程”迈向“数字软件工厂”
ai编程
努力的小郑2 小时前
突发!Claude Code 51万行源码全网裸奔:一场史诗级“开源”事故,国内大厂笑麻了
前端·后端·ai编程
HashTang3 小时前
Claude Code 源码中 REPL.tsx 深度解析:一个 5005 行 React 组件的架构启示
前端·后端·ai编程
天蓝色的鱼鱼5 小时前
别再只会写 Prompt 了!Claude Code Skills 才是 AI 编程的正确打开方式
ai编程·claude
爱吃的小肥羊5 小时前
Codex 被 OpenAI 做成插件,塞进了 Claude Code,这招绝了!
openai·ai编程
想打游戏的程序猿6 小时前
工具与协议层——Agent 如何连接世界
后端·ai编程
与虾牵手8 小时前
Claude Tool Use 怎么用?从零到生产的完整教程(2026)
ai编程·claude
像我这样帅的人丶你还8 小时前
从交稿到甩锅预防:AI 前端流水线
前端·ai编程
量子位8 小时前
2700GB高质量数据,训出空间智能SOTA,背后秘诀全栈开源
llm·ai编程
量子位8 小时前
Claude Code能控制电脑了!开发全程不离终端,全无人值守模式启动
ai编程·claude