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