agent-web-search

agent-web-search

Provides a unified web search tool for AI agents by running multiple search providers concurrently and returning normalized results. It integrates with Claude Code, Codex CLI, OpenCode, and Hermes.

Category
访问服务器

README

Agent Web Search

Multi-provider web search for AI agents.

Agent Web Search gives Hermes, Codex CLI, Claude Code, OpenCode, and ordinary scripts one consistent web-search tool. It runs independent providers concurrently and returns normalized results. The default provider set is:

  • ARK grounding — Volcengine ARK Responses API + web_search (Doubao)
  • DDGS — DuckDuckGo search
  • Exa — Exa MCP search (best effort; availability depends on the endpoint)

Optional providers are also implemented:

  • Gemini — Google Search grounding via Gemini Interactions API
  • Grok — xAI Responses API with native web search and X Search
  • Tavily — Tavily Search API with native result-count and time-range filters

The architecture is provider-based, so DeepSeek, Brave, and other search-capable providers can be added without changing the MCP or Hermes interfaces.

Quick start

# Omit this line when the ARK provider is not enabled.
export ARK_API_KEY="your_ark_api_key"
pipx install 'git+https://github.com/JerryLiu369/agent-web-search.git'
agent-web-search-mcp

Do not put API keys in shell history, source code, Git commits, or screenshots. Use a local .env/secret manager and export the variable in the process environment.

Use from Codex CLI

export ARK_API_KEY="your_ark_api_key"
codex mcp add agent-web-search -- \
  agent-web-search-mcp
codex mcp list

Use from Claude Code

export ARK_API_KEY="your_ark_api_key"
claude mcp add agent-web-search -- \
  agent-web-search-mcp

Or add a project .mcp.json:

{
  "mcpServers": {
    "agent-web-search": {
      "command": "agent-web-search-mcp",
      "args": [],
      "env": {"ARK_API_KEY": "${ARK_API_KEY}"}
    }
  }
}

Use from OpenCode

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "agent-web-search": {
      "type": "local",
      "command": ["agent-web-search-mcp"],
      "environment": {"ARK_API_KEY": "${ARK_API_KEY}"},
      "enabled": true
    }
  }
}

Use from Hermes

Install the native plugin directly from GitHub:

pip install 'ddgs>=9.0'
hermes plugins install JerryLiu369/agent-web-search --no-enable
hermes plugins enable agent-web-search --allow-tool-override

The plugin registers the standard web_search tool and calls the same Agent Web Search core used by MCP and CLI. If you prefer the generic MCP path, Hermes can also connect with hermes mcp add.

The GitHub installer installs the package and its optional dependencies:

pipx install 'git+https://github.com/JerryLiu369/agent-web-search.git'

Hermes requires the explicit --allow-tool-override grant because this plugin intentionally replaces its built-in web_search tool. Start a new Hermes session after enabling it; restart the gateway if you use a messaging channel.

CLI

agent-web-search "What changed in the latest OpenAI Codex CLI?"
agent-web-search "GPU kernel generation papers from the past month" --time-range m --max-results 5
agent-web-search "latest news" --provider ark --provider ddgs

Volcengine collaboration rewards

Agent Web Search does not require participation in any rewards program. Users who choose to use ARK can create their own API key and optionally review the official Volcengine Collaboration Rewards Program. The program may provide reward resources according to its current rules, but quota, supported models, validity period, and data authorization terms can change. Check the official page before opting in. Participation means accepting the provider's data-authorization terms; it is not required to use Agent Web Search.

Configuration

  • ARK_API_KEY: optional; required only when the ARK provider is enabled. Comma/newline-separated keys are accepted.
  • AGENT_WEB_SEARCH_PROVIDERS: startup-enabled provider set; default is ark,ddgs,exa.
  • AGENT_WEB_SEARCH_TIMEOUT: per-provider timeout in seconds (default 60).
  • AGENT_WEB_SEARCH_ARK_MODELS: comma-separated ARK model IDs.
  • EXA_MCP_URL: optional Exa MCP endpoint override.
  • GEMINI_API_KEY: optional Gemini provider key.
  • AGENT_WEB_SEARCH_GEMINI_MODEL: optional Gemini model ID.
  • XAI_API_KEY: optional Grok provider key.
  • AGENT_WEB_SEARCH_GROK_MODEL: optional Grok model ID.
  • TAVILY_API_KEY: optional Tavily provider key.

The provider set is resolved when the Hermes plugin or MCP server starts. The public web_search schema is generated from that set. A request can narrow the set with providers, but cannot activate a provider that was disabled at startup. If grok is startup-enabled, the schema additionally exposes grok_search_mode with web_search, x_search, and both values. both passes both xAI server-side tools in one request and lets Grok decide which to call; it does not send two independent requests.

Common search controls

The public interface keeps one provider-neutral set of controls. Each backend maps them to its native API when possible and silently ignores unsupported controls:

Control ARK DDGS Exa Gemini / Grok Tavily
max_results native limit native max_results native num_results English prompt constraint native max_results
max_keyword native max_keyword ignored ignored English prompt constraint ignored
time_range English prompt constraint native timelimit native publish-date filter Gemini: prompt; Grok web: prompt; Grok X: native dates + prompt native time_range

Prompt constraints are best-effort for model-backed providers; they are not presented as strict guarantees.

Design principles

  • One core, multiple adapters.
  • A failed provider does not discard successful providers.
  • Provider responses are marked with searched, error, and model instead of pretending every HTTP 200 was a successful search.
  • No telemetry and no shared API key service.

Development

python -m venv .venv
. .venv/bin/activate
pip install -e '.[dev,ddgs,mcp]'
pytest -q
ruff check .

License

MIT.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选