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

相关推荐
倔强的石头_4 小时前
不想每次都从头解释:我用 Doubao-Seed-Evolving 做了一个「稿件接力站」
ai编程
大模型码小白6 小时前
【Python零基础教程】继承、多态与魔法函数:面向对象编程三大核心特性详解
java·大数据·开发语言·人工智能·python·ai编程
-XWB-7 小时前
【LLM】Agent Planning 完全指南:8 种纯 LLM 范式 + 8 种混合规划模式详解(二)
人工智能·经验分享·aigc·学习方法·ai编程
沉默王二7 小时前
腾讯一面,我霸气反问:“你说你们在做Agent项目,说说 SubAgent、Plan 模式、Skill 调用这些你们都是怎么做的?”面试官一直在擦汗。。
面试·agent·ai编程
kyriewen8 小时前
我让AI改一个bug——它偷偷动了5个我没让它碰的地方
前端·javascript·ai编程
神奇霸王龙10 小时前
Claude Code屠榜:MiMo与Grok紧追Codex
服务器·网络·人工智能·gpt·ai·ai编程
z1234567898611 小时前
2026最新两款AI编程工具深度对比实测
java·数据库·ai编程
GeekArch11 小时前
第24讲:Vibe模式代码风格控制——适配Keil/STM32工程规范
人工智能·stm32·单片机·嵌入式硬件·mcu·决策树·ai编程
OpenTiny社区11 小时前
深度解析 LSP 如何为 AI 装上“眼睛”
前端·ai编程