关于 n8n AI Agent for DVM MCP
这是一个基于 n8n 工作流的 AI Agent 示例,可在 Nostr 网络上发现并调用以 DVM 提供的 MCP 工具。它适合需要使用本地未安装工具的 Agent 场景,并通过查询、发送请求和读取响应完成工具调用。
主要功能
- 01在 Nostr 上发现 DVM MCP 工具
- 02向工具发送请求
- 03等待并读取工具响应
- 04使用 n8n 子工作流编排调用
适用场景
- 01查找尚未安装的 MCP 工具
- 02通过 Nostr 网络调用远程工具
- 03让 Agent 汇总工具响应并回复用户
MCP 相关
该 Agent 通过 DVMCP 在 Nostr 网络上发现并调用 MCP 服务提供的工具。它依次提交请求、等待响应并读取结果。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
暂未收录安装方式
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
还没有获取到工具列表
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
面向 DVM MCP 的 n8n AI Agent
这些工作流创建了一个 AI Agent,它是通过 Nostr 网络以数据售卖机(DVM)形式提供的 Model Context Protocol (MCP) Server Tools 的使用者 –
给定一个需要工具的提示词,该 Agent 会 –
- 在网络中查询其可使用的可用工具,
- 通过网络向这些工具发送请求,
- 按需等待工具响应,
- 读取这些工具的响应,并回复用户。
为什么这很有趣 –
- 对于大模型来说,要使用 MCP 工具,MCP 服务通常需要与 LLM 位于同一系统上,
- 目前还没有一种发现方法,能让大模型找到尚未安装的 MCP 服务和工具,
- 数据售卖机允许大模型通过 Nostr 网络发现并使用工具,
- 这个 AI Agent 示例展示了一个 AI 如何通过查询 Nostr 网络上的 DVM,找到并使用它尚未安装的 MCP 工具。
技术
- MCP:Model Context Protocol 是一种开放协议,允许 AI Agent 访问数据源和工具。了解更多,
- DVM:数据售卖机会监听并通过 Nostr 网络响应查询。了解更多,
- DVMCP:Data Vending Machine Context Protocol 将 Model Context Protocol 服务与 Nostr 的数据售卖机生态连接起来。任何 MCP 服务都可以通过网络提供任何工具,任何 Agent 客户端都可以访问任何服务提供的所有工具。参见 DVMCP by Gzuuus 和 NostrDVM by BelieveTheHype,
- n8n:一个低代码平台,非常适合创建 Langchain Tools Agent。了解更多。
前置条件
- n8n:在你的系统上安装一个可自托管的 n8n。你可以按照 n8n 网站上的说明进行操作,
- Nostrobots:安装由 Ocknamo 提供的 Nostrobots Community Nodes,安装说明见 n8n 网站,它会为你的 n8n 实例添加 Nostr 工具,
- 将工作流从 Github 添加到 n8n:将这五个工作流添加到你的 n8n。1. 从 Github 复制 Raw .json 的 URL(示例),2. 在 n8n 中创建一个新工作流,然后点击“...”和“Import from URL”,
- 凭据:添加 OpenAI API(或其他大模型)、SerpAPI、Nostr 私钥(Nsec)、Postgresql/Supabase 的凭据,
- 设置:在 Set Variables 节点中设置的工作流变量:Assistant Name、Assistant Npub、Nostr Relays、User Localisation。
如果你没有 Nostr 私钥,可以在 NostrTool.com 生成一个。
组件工作流

主工作流是 DVMCP Agent Example v1.0。
请将其与以下四个 Tools 子工作流一起使用 –
- AI Tool – Find Nostr DVMCP Servers
- AI Tool – Post Nostr DVMCP Server Query
- AI Tool – Wait
- AI Tool – Read Nostr DVMCP Server Response
安装时的初始设置
- DVMCP Agent 必须连接到它的 Tools 子工作流,
- 在初始安装时,你可能需要手动重新连接这些。为此,请打开 DVMCP Agent Example v1.0,并点击每个工具的节点,以从数据库中选择正确的子工作流,
- 必须在 DVMCP Agent Example v1.0 工作流中输入凭据,并且也必须在 Post Nostr DVMCP Server Query 子工作流中输入凭据。
工作原理
系统会提示 Agent 按顺序使用工具来满足用户需求。以下是系统提示词中的一段示例:
**Tips for DVM Use**
- If your User requests something where you would need a tool, but do not have a tool, query for DVM MCP server tools on Nostr, and where you find a relevant tool, ask your User if you should use it.
- If your User requests to use a tool, follow these steps in sequence:
1) post your request to the MCP server
2) wait for 15 seconds
3) read the response from the MCP server
4) if there is no response from the MCP server and less than 45 seconds have passed –
Then go back to step 2 and repeat.
Else continue.
5) perform any final steps or required localisation (e.g. query forex and convert USD to local currency)
系统提示词和工作流可根据你的使用场景进行调整。
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。