概述
管理区块链基础设施通常涉及浏览仪表盘、编写 API 调用脚本以及手动检查配置。新的 QuickNode Model Context Protocol (MCP) 通过允许你使用自然语言管理你的整个 QuickNode 环境来改变这个过程。你可以管理 endpoints、监控使用情况、配置安全设置、分析账单数据等等。
本指南解释了如何将 MCP 与 AI 助手(如 Claude 和 Cursor)集成,从而提高你的生产力并简化你的 Web3 开发工作流程。
MCP 新手?
通过这些指南了解基础知识并构建你自己的 MCP 服务器:
你将要做什么
你将需要什么
- 一个 QuickNode 账户
- 一个 QuickNode API 密钥(我们将在以下章节中指导你如何获取它)
- 一个支持自定义工具集成的 AI 助手(例如,Claude for Desktop,Cursor)
- AI 的基本使用知识
什么是 QuickNode MCP?
QuickNode MCP 是一个强大的集成,充当 AI 助手和 QuickNode 之间的桥梁。它使你可以通过自然语言命令与你的 QuickNode endpoints、账单数据、使用情况分析和安全设置进行交互。现在,你可以对话式地管理你的基础设施,而无需编写自定义脚本或手动浏览 QuickNode 仪表板。
MCP 允许你通过使用自然语言命令来执行以下操作或更多操作:
- 管理 endpoints:轻松创建、更新和删除 endpoints
- 监控使用情况:实时跟踪 endpoint 的使用情况和账单数据
- 配置安全设置:设置速率限制、IP 白名单等
- 分析账单数据:通过 AI 深入了解你的使用情况和成本
设置 QuickNode MCP
你可以将 MCP 连接到任何兼容的 AI 助手(例如,Claude Desktop,Cursor)。在本指南中,我们将使用 Claude Desktop,但对于 Cursor 或任何其他 AI 助手,该过程类似。
要配置 MCP 服务器,你需要在配置文件中定义它(对于 Claude,它是 claude_desktop_config.json,对于 Cursor,它是 mcp.json)。此文件包含 MCP 服务器的必要设置,包括任何环境变量、命令和其他配置。
- 打开 Claude Desktop,导航到 Claude > Settings > Developer
- 编辑
claude_desktop_config.json
以包含以下内容(如果存在其他配置,则添加到 mcpServers
下):
{
"mcpServers": {
"quicknode-mcp": {
"command": "npx",
"args": ["-y", "@quicknode/mcp"],
"env": {
"QUICKNODE_API_KEY": "<replace-with-qn-token>"
}
}
}
}
- 将
<replace-with-qn-token>
替换为你的 QuickNode API 密钥。
获取你的 QuickNode API 密钥
要创建你的密钥,请登录到你的 QuickNode 帐户,单击左上角的头像图标,然后选择 API Keys。它将带你进入 API 密钥页面。
生成一个启用了 Console API 权限的 API 密钥。复制密钥并将其粘贴到 claude_desktop_config.json
文件中,如上所示。
- 保存文件并重新启动 Claude。现在,你可以通过单击 Search and Tools 图标并选择 QuickNode MCP,在 Claude 中使用 MCP 命令。

使用 QuickNode MCP
现在,让我们探索 QuickNode MCP 的一些实际用例。你可以使用自然语言命令来管理你的 QuickNode 环境,例如创建 endpoints、监控使用情况和配置安全设置。
你不需要记住特定的命令;你可以简单地询问 MCP 你想做什么。它将判断你的意图并执行适当的命令。例如,你可以输入:
"Create a new Bitcoin mainnet endpoint and apply some security settings"
MCP 将解释你的请求并执行必要的命令来创建 endpoint 并应用安全设置。

请注意,AI 助手可能会要求你确认该操作以作为预防措施。你可以简单地允许或拒绝该请求。

可用的命令可以很好地了解你可以使用 MCP 做什么。你可以像前面一节中所述的那样访问它们,但这里有一些你可以使用的命令示例:
Endpoint 生命周期管理
创建和配置新的 Endpoints:
- "Create a new Base mainnet endpoint with high rate limits for our production trading bot" (为我们的生产交易机器人创建一个具有高速率限制的新 Base 主网 endpoint)
- "Set up security restrictions on the new endpoint to only allow requests from our server IP" (在新 endpoint 上设置安全限制,仅允许来自我们服务器 IP 的请求)
监控和维护:
- "Show me which endpoints haven't been used in the last 30 days" (显示过去 30 天内未使用的 endpoints)
- "What are the top 5 RPC methods being called across all my endpoints?" (在我的所有 endpoints 中被调用的前 5 个 RPC 方法是什么?)
- "Check for any failed requests in the last hour on our Ethereum mainnet endpoint" (检查我们的以太坊主网 endpoint 在过去一小时内是否有任何失败的请求)
安全和访问控制
实施安全策略:
- "Add JWT authentication to all Solana endpoints" (将 JWT 身份验证添加到所有 Solana endpoints)
- "Create IP whitelist restrictions for our internal development endpoints" (为我们的内部开发 endpoints 创建 IP 白名单限制)
- "Set up referrer restrictions for our frontend-facing endpoints" (为我们的面向前端的 endpoints 设置引用者限制)
安全审计:
- "Review security settings across all endpoints and identify any that lack proper authentication" (查看所有 endpoints 的安全设置,并识别任何缺少适当身份验证的 endpoints)
- "Generate a security compliance report for our infrastructure" (为我们的基础设施生成安全合规性报告)
成本优化和计费
使用分析:
- "Which endpoint is consuming the most requests this month and what's driving the usage?" (哪个 endpoint 本月消耗的请求最多,是什么驱动了使用量?)
- "Compare our RPC usage patterns between this month and last month" (比较我们本月和上个月的 RPC 使用模式)
- "Identify opportunities to reduce costs by consolidating underused endpoints" (通过合并未充分利用的 endpoints 来识别降低成本的机会)
账单管理:
- "Show me our billing trend over the last 6 months" (显示我们过去 6 个月的账单趋势)
- "What's our projected spend for this month based on current usage?" (根据当前使用情况,我们本月的预计支出是多少?)
- "Break down our costs by blockchain network and identify the highest contributors" (按区块链网络细分我们的成本,并确定最大的贡献者)
调试和故障排除
性能分析:
- "Show me response times and error rates for all endpoints over the last 24 hours" (显示过去 24 小时内所有 endpoints 的响应时间和错误率)
- "Identify any endpoints experiencing elevated latency or error rates" (识别任何经历延迟或错误率升高的 endpoints)
- "Find patterns in failed requests that might indicate configuration issues" (在失败的请求中查找可能表明配置问题的模式)
日志调查:
- "Search logs for any requests returning 500 errors on our Base mainnet endpoint" (在我们的 Base 主网 endpoint 上搜索返回 500 错误的任何请求的日志)
- "Show me the request patterns leading up to the rate limit violations yesterday" (显示导致昨天速率限制违规的请求模式)
- "Find all requests from a specific IP address across all endpoints" (查找来自特定 IP 地址的所有 endpoints 的所有请求)
结论
你已成功配置 QuickNode MCP,这是一种借助 AI 管理区块链基础设施的全新高效方式。通过使用自然语言命令,你现在可以在几秒钟内处理复杂的任务,从而让你有更多时间使用 QuickNode 构建和扩展 Web3 应用程序。
无论你是原型化你的第一个 dApp 的独立开发者,还是管理复杂的多链基础设施的企业团队,QuickNode MCP 都能适应你的工作流程并根据你的需求进行扩展。对于希望保持竞争力并大规模交付高质量应用程序的团队来说,像 QuickNode MCP 这样的工具将变得至关重要。
订阅我们的 newsletter,获取更多关于 Web3 和区块链的文章和指南。如果你有任何问题或需要进一步的帮助,请随时加入我们的 Discord 服务器或使用下面的表格提供反馈。通过在 X (@QuickNode) 和我们的 Telegram announcement channel 上关注我们,保持信息灵通并保持联系。
我们 ❤️ 反馈!
如果你有任何反馈或对新主题的请求,请 Let us know。我们很乐意听取你的意见。