AgentSearch (agentsearchhq.com)

io.github.agentsearchhq-coderv1.1.1更新于 Oct 3, 2026

AgentSearch web search, page extract and JS page render for agents. Self-hosted API via stdio.

概览

AI 生成的概览

让助手通过你自建的 AgentSearch 兼容 API 执行网页搜索、页面提取和 JavaScript 页面渲染。

功能
通过 stdio 提供三个只读工具:agentsearch_web_search 用于搜索查询,agentsearch_extract 用于提取已有 URL 的页面内容,agentsearch_render 用无头 Chromium 渲染依赖 JavaScript 的页面,返回标题、状态、元数据以及 markdown、文本、HTML 或链接,并可选截图。三者都通过 HTTP 调用你自己的 AgentSearch 兼容后端。
适用场景
当你已经运行 AgentSearch 兼容后端,并希望 Cursor、Claude Desktop 或其他 MCP 宿主能够搜索网页、提取页面或渲染单页应用时使用。静态页面优先用 extract,当 extract 返回空或部分内容时改用 render。
运行要求
需要 Node.js 20 或更高版本,以及你自己的 AgentSearch 兼容 API。AGENTSEARCH_BASE_URL 为必填且没有默认值,缺失时进程会在启动时退出。AGENTSEARCH_API_KEY 可选,以 Bearer 令牌发送。需要能访问你的后端网络。
安装前请注意
AGENTSEARCH_API_KEY 是可选的机密,作为 Authorization Bearer 请求头发送;遇到 401 时客户端会不带该密钥重试一次。README 提醒不要提交真实的 .env。工具本身是只读 HTTP,但会把给定的 URL 和查询发送到你配置的后端,render 还会抓取第三方页面。

安装

在 SourceWeft 中

  1. 打开 控制台中的 AgentSearch (agentsearchhq.com),将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

agentsearch-mcp

MCP (Model Context Protocol) server for people running their own AgentSearch-compatible backend. It exposes web search, page extract, and JavaScript page rendering (headless browser) to Cursor, Claude Desktop, and other MCP hosts over stdio.

AGENTSEARCH_BASE_URL is required and points at that API. There is no built-in default host.

For pay-per-call access with no backend of your own, use Pocket's official MCP server instead:

bash
npx -y @pocket-network/agentic-portal-mcp

That server calls agentsearch-web-search-v1 and agentsearch-web-extract-v1 at $0.005/call over x402. Details: https://agentsearchhq.com/?utm_source=github&utm_medium=readme&utm_campaign=mcp

This package calls your API directly:

  • Search: POST {AGENTSEARCH_BASE_URL}/v1/search with body { "query": "...", "max_results": 5 }
  • Extract: POST {AGENTSEARCH_BASE_URL}/v1/extract
  • Render: POST {AGENTSEARCH_BASE_URL}/v1/render (headless Chromium; OpenAPI spec)

Tools

ToolArgsDescription
agentsearch_web_searchquery (string, required), max_results (number, optional, default 5, clamped 1–5)Web search. Returns pretty-printed JSON. Use for a query; use extract when you already have a URL. Read-only HTTP.
agentsearch_extracturl (absolute URL, required), formats (string[], optional), max_chars (positive integer, optional)Page extract via POST /v1/extract. Use when you already have a URL. Read-only HTTP.
agentsearch_renderurl (absolute http(s) URL, required); optional: formats (markdown|text|html|links, default ["markdown"]), max_chars (1–100000), screenshot, screenshot_format (png|jpeg), full_page, viewport ({width 320–1920, height 240–1600}), wait_until (domcontentloaded|load|networkidle), wait_for_selector, wait_ms (0–1500), block (image|media|font|stylesheet)Renders a JavaScript-heavy page in headless Chromium via POST /v1/render and returns title, status, meta, and the rendered markdown/text/HTML/links (plus optional base64 screenshot). Use when extract returns empty/partial content for an SPA; prefer extract for static pages. Read-only HTTP.

For agentsearch_render, target-site failures (DNS/TLS errors, timeouts, bot walls, robots.txt) come back as a normal result whose JSON has a non-null error object (code, message, retryable); bad input (400), oversize body (413), rate limits (429) and backend faults (500) are MCP errors. The backend enforces a ~4.2 s render deadline.


Requirements

  • Node.js 20+
  • Your own AgentSearch-compatible API. Set AGENTSEARCH_BASE_URL to its base URL. The process exits at startup if that variable is missing.

Install

bash
npx -y @agentsearchhq/agentsearch-mcp# or install into a projectnpm i @agentsearchhq/agentsearch-mcp

From a local checkout:

bash
cd agentsearch-mcpnpm installnpm run build

Scripts: build → tsc, start → node dist/index.js, test → build + node --test test/*.mjs, prepare → runs build.

Binary: agentsearch-mcp → dist/index.js


Environment variables

VariableRequiredNotes
AGENTSEARCH_BASE_URLyesBase URL of your API (no trailing slash). No default.
AGENTSEARCH_API_KEYnoOptional Authorization: Bearer …. On 401 the client retries once without the key.

See .env.example. Never commit a real .env.


Cursor

Project (.cursor/mcp.json) or user (~/.cursor/mcp.json / Cursor Settings → MCP):

json
{  "mcpServers": {    "agentsearch": {      "command": "npx",      "args": ["-y", "@agentsearchhq/agentsearch-mcp"],      "env": {        "AGENTSEARCH_BASE_URL": "https://your-agentsearch-host.example"      }    }  }}

Optional API key:

json
"env": {  "AGENTSEARCH_BASE_URL": "https://your-agentsearch-host.example",  "AGENTSEARCH_API_KEY": "your-key-here"}

Claude Desktop

Edit Claude Desktop config (claude_desktop_config.json):

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
json
{  "mcpServers": {    "agentsearch": {      "command": "npx",      "args": ["-y", "@agentsearchhq/agentsearch-mcp"],      "env": {        "AGENTSEARCH_BASE_URL": "https://your-agentsearch-host.example"      }    }  }}

Restart Claude Desktop after saving.


Local run

bash
npm run buildAGENTSEARCH_BASE_URL=https://your-agentsearch-host.example node dist/index.js# process waits on stdin — Ctrl+C to stop

If AGENTSEARCH_BASE_URL is unset, the process prints an error and exits.


License

MIT

来源:README.md,提交 9654fc0

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v1.1.1最新Oct 3, 2026