|
| 1 | +# AnySearch MCP Integration — Development Document |
| 2 | + |
| 3 | +## What this is |
| 4 | + |
| 5 | +This document describes the AnySearch integration shipped with Zoo Code. AnySearch |
| 6 | +(https://anysearch.com) is search infrastructure for AI agents: general web search, |
| 7 | +vertical domain search, parallel batch search, and web page extraction. It is exposed |
| 8 | +to Zoo Code as a **remote MCP server** listed in the built-in MCP Marketplace, so users |
| 9 | +can install it in one click and immediately give the agent up-to-date web knowledge |
| 10 | +for research, documentation lookup, and fact-checking. |
| 11 | + |
| 12 | +## How it is wired |
| 13 | + |
| 14 | +- **Marketplace entry:** `src/assets/marketplace/mcps.yml`, item id `anysearch` |
| 15 | + (kept first in the file — entries are alphabetical). It declares a single install |
| 16 | + method, "Remote Server", whose JSON config is: |
| 17 | + ```json |
| 18 | + { |
| 19 | + "type": "streamable-http", |
| 20 | + "url": "https://api.anysearch.com/mcp", |
| 21 | + "headers": { |
| 22 | + "Authorization": "Bearer {{ANYSEARCH_API_KEY}}" |
| 23 | + } |
| 24 | + } |
| 25 | + ``` |
| 26 | +- **Install flow:** `MarketplaceManager` → `SimpleInstaller` substitutes the |
| 27 | + `{{ANYSEARCH_API_KEY}}` parameter (collected from the user at install time) and |
| 28 | + writes the server into the user's `mcp_settings.json`. |
| 29 | +- **Runtime:** `McpHub` (`src/services/mcp/McpHub.ts`) natively supports the |
| 30 | + `streamable-http` transport type, so no code changes were needed — this integration |
| 31 | + is configuration only. |
| 32 | + |
| 33 | +## Tools exposed by the AnySearch MCP server |
| 34 | + |
| 35 | +| Tool | Purpose | Key parameters | |
| 36 | +| ---- | ------- | -------------- | |
| 37 | +| `search` | Web search | `query` (required), `max_results` (1–50, default 10), `region` (`us`/`eu`/`ap`), `recency` (`day`/`week`/`month`/`year`), `domains[]` (include-list) | |
| 38 | +| `extract` | Fetch a URL and return its content as markdown | `url` (required) | |
| 39 | +| `get_sub_domains` | Discover vertical (domain-specific) search scopes | — | |
| 40 | + |
| 41 | +Anonymous requests work with lower rate limits; an API key raises the limits. |
| 42 | +Get a key at https://anysearch.com. |
| 43 | + |
| 44 | +## User flow |
| 45 | + |
| 46 | +1. Open the MCP Marketplace in Zoo Code (MCP Servers → Marketplace). |
| 47 | +2. Find **AnySearch**, click Install, paste the API key when prompted. |
| 48 | +3. The agent can now call `search`, `extract`, and `get_sub_domains` via the |
| 49 | + `use_mcp_tool` mechanism like any other MCP server. |
| 50 | + |
| 51 | +## Maintenance notes |
| 52 | + |
| 53 | +- **If AnySearch changes its endpoint or auth scheme:** edit only the `content` |
| 54 | + block of the `anysearch` item in `src/assets/marketplace/mcps.yml`. No TypeScript |
| 55 | + changes are required as long as the transport stays `streamable-http`/`sse`/`stdio` |
| 56 | + (all supported by `McpHub`). |
| 57 | +- **If AnySearch adds/removes tools:** nothing to change on our side — tools are |
| 58 | + discovered dynamically from the MCP server at connection time. |
| 59 | +- **Validation:** after editing the YAML, confirm it still parses and that item ids |
| 60 | + stay unique and alphabetical. The marketplace zod schema lives in |
| 61 | + `packages/types/src/marketplace.ts` (`mcpMarketplaceItemSchema`); the entry must |
| 62 | + keep satisfying it (`id`, `name`, `description`, `url`, `content`). |
| 63 | +- **Testing the connection:** install the entry from a dev build of the extension, |
| 64 | + then check MCP Servers view shows AnySearch as connected and try a `search` call. |
| 65 | + This requires a real API key; there is no offline stub. |
0 commit comments