ScavioScavio
产品定价文档
登录开始使用
  1. 首页
  2. 教程
  3. 如何通过 MCP 将 Scavio 搜索添加到 Hermes Agent v0.14.0
教程

如何通过 MCP 将 Scavio 搜索添加到 Hermes Agent v0.14.0

在 Hermes Agent v0.14.0 中将 Scavio 配置为 MCP 搜索工具。逐步设置工具注册、搜索查询和响应解析。

获取免费API密钥API文档

Hermes v0.14.0 引入了原生 MCP 工具支持,使您可以轻松地为代理提供实时网络搜索,而无需自定义 API 包装器。本教程将 Scavio 配置为 Hermes 中的 MCP 搜索提供程序,以便您的代理可以使用实时 Web 数据回答问题,而不是仅仅依赖其训练截止时间。

前置条件

  • 安装 Hermes Agent v0.14.0 或更高版本
  • Python 3.11+
  • 来自 https://scavio.dev 的 Scavio API 密钥
  • Scavio MCP 服务器包 (pip install scavio-mcp)

操作指南

步骤 1: 安装和配置 Scavio MCP 服务器

安装 Scavio MCP 服务器包并设置 Hermes 将读取的配置文件以发现可用的工具。

Bash
# Install the Scavio MCP server
pip install scavio-mcp

# Create the MCP server config
cat > mcp_config.json << 'CONFIG'
{
  "mcpServers": {
    "scavio": {
      "command": "scavio-mcp",
      "env": {
        "SCAVIO_API_KEY": "your-api-key"
      },
      "tools": ["web_search", "news_search"]
    }
  }
}
CONFIG

# Verify the server starts
scavio-mcp --health-check

步骤 2: 在 Hermes v0.14.0 中注册 MCP 工具

将 Hermes 指向 MCP 配置文件,以便它在启动时发现 Scavio 工具。 Hermes v0.14.0 读取 MCP 工具架构并将其提供给代理。

Python
from hermes import Agent, MCPToolProvider

# Load MCP tools from config
mcp_provider = MCPToolProvider.from_config("mcp_config.json")

# Create the Hermes agent with MCP tools
agent = Agent(
    model="hermes-3",
    tools=mcp_provider.get_tools(),
    system_prompt="""You are a research assistant with live web search.
    Use the web_search tool to find current information.
    Always cite your sources with URLs."""
)

# Verify tools are registered
for tool in agent.available_tools:
    print(f"Tool: {tool.name} - {tool.description}")

步骤 3: 通过代理执行搜索查询

使用触发 Web 搜索的查询运行代理。 Hermes 自动决定何时调用搜索工具并将结果合并到其响应中。

Python
import asyncio

async def research_query(agent: Agent, question: str) -> str:
    response = await agent.run(question)

    # Access tool call details
    for step in response.steps:
        if step.tool_call:
            print(f"Tool used: {step.tool_call.name}")
            print(f"Query sent: {step.tool_call.arguments.get('query')}")
            result_count = len(step.tool_call.result.get("results", []))
            print(f"Results returned: {result_count}")

    return response.final_answer

async def main():
    mcp_provider = MCPToolProvider.from_config("mcp_config.json")
    agent = Agent(
        model="hermes-3",
        tools=mcp_provider.get_tools(),
        system_prompt="Research assistant with live web search. Cite sources."
    )

    answer = await research_query(agent, "What are the top MCP servers in May 2026?")
    print(f"Answer: {answer}")

asyncio.run(main())

Python 示例

Python
import asyncio
from hermes import Agent, MCPToolProvider

async def main():
    # Set up MCP tools from Scavio
    mcp_provider = MCPToolProvider.from_config("mcp_config.json")

    agent = Agent(
        model="hermes-3",
        tools=mcp_provider.get_tools(),
        system_prompt="Research assistant with web search. Always cite sources."
    )

    # Run a query
    response = await agent.run("What are the latest AI agent frameworks in 2026?")

    for step in response.steps:
        if step.tool_call:
            print(f"Searched: {step.tool_call.arguments.get('query')}")
            print(f"Results: {len(step.tool_call.result.get('results', []))}")

    print(f"Answer: {response.final_answer}")

asyncio.run(main())

JavaScript 示例

JavaScript
// mcp_config.json must be in the working directory
// Hermes JS SDK example
import { Agent, MCPToolProvider } from "@hermes-ai/sdk";

const mcpProvider = MCPToolProvider.fromConfig("mcp_config.json");

const agent = new Agent({
  model: "hermes-3",
  tools: mcpProvider.getTools(),
  systemPrompt: "Research assistant with web search. Cite sources."
});

async function main() {
  const response = await agent.run("Latest AI agent frameworks in 2026?");
  for (const step of response.steps) {
    if (step.toolCall) {
      console.log("Searched:", step.toolCall.arguments.query);
      console.log("Results:", (step.toolCall.result.results || []).length);
    }
  }
  console.log("Answer:", response.finalAnswer);
}

main();

预期输出

JSON
Tool: web_search - Search the web using Scavio
Searched: latest AI agent frameworks 2026
Results: 10
Answer: Based on current web results, the top AI agent frameworks in 2026 include...

相关教程

  • 如何使用 Scavio 将实时 Web 搜索添加到 LangGraph 代理
  • 如何通过轮换和范围访问来保护 MCP 服务器凭证
  • 如何构建结合搜索和金融数据的交易数据MCP服务器

常见问题

大多数开发者在15到30分钟内完成本教程。您需要一个Scavio API密钥(免费套餐即可)和可用的Python或JavaScript环境。

安装 Hermes Agent v0.14.0 或更高版本. Python 3.11+. 来自 https://scavio.dev 的 Scavio API 密钥. Scavio MCP 服务器包 (pip install scavio-mcp). Scavio API密钥注册即送50个免费积分。

可以。免费套餐注册即送50个积分,完全足够完成本教程并构建一个可运行的原型解决方案。

Scavio提供原生LangChain包(langchain-scavio)、MCP服务器以及适用于任何HTTP客户端的REST API。本教程使用 the raw REST API, 但您可以根据需要适配您选择的框架。

相关资源

Use Case

MCP 自定义搜索服务器

Read more
Use Case

Hermes Agent 搜索 API 可靠性

Read more
Best Of

2026年Hermes智能体最佳搜索API

Read more
Comparison

Scavio MCP vs Perplexity Advanced MCP

Read more
Comparison

Tavily vs Scavio

Read more
Best Of

2026年Hermes Agent最佳搜索API

Read more

开始构建

在 Hermes Agent v0.14.0 中将 Scavio 配置为 MCP 搜索工具。逐步设置工具注册、搜索查询和响应解析。

获取免费API密钥阅读文档
ScavioScavio

面向AI智能体的实时搜索API。搜索所有平台,不仅仅是Google。

产品

  • 功能
  • 定价
  • 控制台
  • 联盟计划

开发者

  • 文档
  • API参考
  • 快速开始
  • MCP集成
  • Python SDK

替代方案

  • Tavily替代方案
  • SerpAPI替代方案
  • Firecrawl替代方案
  • Exa替代方案

工具

  • JSON格式化
  • cURL转代码
  • Token计数器
  • 全部工具

© 2026 Scavio. 保留所有权利。

Featured on TAAFT
服务条款隐私政策