@agentsearchhq/agentsearch-mcp 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/dist/backend.d.ts +5 -3
- package/dist/backend.js +29 -1
- package/dist/backend.js.map +1 -1
- package/dist/direct.d.ts +7 -6
- package/dist/direct.js +12 -10
- package/dist/direct.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tools/search.d.ts +1 -1
- package/dist/tools/search.js +53 -3
- package/dist/tools/search.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/llms-install.md +3 -2
- package/manifest.json +8 -4
- package/package.json +1 -1
- package/server.json +5 -5
package/README.md
CHANGED
|
@@ -4,14 +4,15 @@ MCP (Model Context Protocol) server from [AgentSearch](https://agentsearchhq.com
|
|
|
4
4
|
|
|
5
5
|
- **Free web search with no setup:** with no configuration, `agentsearch_web_search` uses the AgentSearch free tier (`https://relay.agentsearchhq.com/v1/search`): **up to 25 searches/day per IP, subject to shared daily capacity**, no key or wallet. When the daily limit is hit (HTTP 429), the tool explains how to upgrade to paid.
|
|
6
6
|
- **Extract and render free trial, no wallet (new in 1.4.0):** with no wallet key, `agentsearch_extract` (**5 calls/day per IP**) and `agentsearch_render` (**3 calls/day per IP**, text output, no screenshots) use the AgentSearch free trial on the same relay. Past it they return HTTP 429 with [wallet setup](https://agentsearchhq.com/wallet-setup?utm_source=github&utm_medium=readme&utm_campaign=mcp) steps. Set `AGENTSEARCH_FREE_TRIAL=0` to turn the trial off.
|
|
7
|
-
- **Extract and render, pay per call (search too, if you opt in):** `agentsearch_extract` and `agentsearch_render`. Add a wallet key and these pay **AgentSearch's own x402 API** on Base (`https://api.agentsearchhq.com`) in USDC: **extract $0.007, render $0.010 per call**, charged only when a usable answer comes back. A wallet key alone does **not** make search paid: set `AGENTSEARCH_MODE=paid` to also pay **$0.008 per search call**. No account, no API key, no ETH for gas. The [Pocket Network Agentic Portal](https://agent.pocket.network) route ($0.005 per call) is still available with `AGENTSEARCH_PAYMENT_ROUTE=pocket
|
|
7
|
+
- **Extract and render, pay per call (search too, if you opt in):** `agentsearch_extract` and `agentsearch_render`. Add a wallet key and these pay **AgentSearch's own x402 API** on Base (`https://api.agentsearchhq.com`) in USDC: **extract $0.007, render $0.010 per call**, charged only when a usable answer comes back. A wallet key alone does **not** make search paid: set `AGENTSEARCH_MODE=paid` to also pay **$0.008 per search call**. No account, no API key, no ETH for gas. The [Pocket Network Agentic Portal](https://agent.pocket.network) route ($0.005 per call) is still available with `AGENTSEARCH_PAYMENT_ROUTE=pocket` for search, extract and render. Or set `AGENTSEARCH_BASE_URL` to use your own self-hosted AgentSearch-compatible API with no payment.
|
|
8
|
+
- **Search + Read, one paid call (new in 1.7.0):** `agentsearch_search_and_read` searches the live web and returns the top pages as markdown for **$0.015**, versus **$0.029** as one search plus three extracts, and one payment instead of four. Charged only when at least one page has text. Direct-only (not on Pocket or the free relay). Needs a wallet key. Docs: [Search + Read](https://agentsearchhq.com/search-and-read?utm_source=github&utm_medium=readme&utm_campaign=mcp).
|
|
8
9
|
- **AgentSearch Review Board (works out of the box, free):** `agentsearch_review_lookup` checks which Pocket Network, x402 and remote MCP services work right now for a task before you pick one; `agentsearch_review_submit` posts a short structured review after you use one. No configuration or key needed; the board is at https://reviews.agentsearchhq.com.
|
|
9
10
|
|
|
10
11
|
```bash
|
|
11
12
|
npx -y @agentsearchhq/agentsearch-mcp # free search + review tools work immediately
|
|
12
13
|
```
|
|
13
14
|
|
|
14
|
-
**Search, then read the page.**
|
|
15
|
+
**Search, then read the page.** For hits and their text in one payment, use `agentsearch_search_and_read` ($0.015). Or the two-step loop: free `agentsearch_web_search` → `agentsearch_extract` on the 1–2 best URLs (clean markdown, $0.007 each; $1 covers about 140 calls) → `agentsearch_render` only for pages extract couldn't read (JavaScript apps). Guides: [Claude Code research workflow](https://agentsearchhq.com/blog/claude-code-web-research-workflow-mcp?utm_source=github&utm_medium=readme&utm_campaign=mcp), [n8n AI agent reading pages](https://agentsearchhq.com/blog/n8n-ai-agent-read-web-pages?utm_source=github&utm_medium=readme&utm_campaign=mcp), [LangChain (Python) search-then-read](https://agentsearchhq.com/blog/langchain-agent-search-then-read-page?utm_source=github&utm_medium=readme&utm_campaign=mcp).
|
|
15
16
|
|
|
16
17
|
### Modes
|
|
17
18
|
|
|
@@ -31,6 +32,7 @@ To use paid Extract/Render, set `AGENTSEARCH_WALLET_PRIVATE_KEY` (a new wallet w
|
|
|
31
32
|
| Tool | Endpoint | Price (USDC on Base) |
|
|
32
33
|
|---|---|---|
|
|
33
34
|
| `agentsearch_extract` | `POST https://api.agentsearchhq.com/x402/v1/extract` | $0.007 |
|
|
35
|
+
| `agentsearch_search_and_read` | `POST https://api.agentsearchhq.com/x402/v1/search_and_read` | $0.015 |
|
|
34
36
|
| `agentsearch_render` | `POST https://api.agentsearchhq.com/x402/v1/render` | $0.010 |
|
|
35
37
|
| `agentsearch_web_search` (only with `AGENTSEARCH_MODE=paid`) | `POST https://api.agentsearchhq.com/x402/v1/search` | $0.008 |
|
|
36
38
|
|
|
@@ -54,7 +56,7 @@ Portal errors (`{ "error": { "code", "message", "retryable" } }`, e.g. `400 UPST
|
|
|
54
56
|
|
|
55
57
|
### Spending safety
|
|
56
58
|
|
|
57
|
-
- **Per call:** never signs more than **$0.
|
|
59
|
+
- **Per call:** never signs more than **$0.020** (20000 atomic units) on the default direct route, or **$0.005** (5000) on the Pocket route. `AGENTSEARCH_MAX_PER_CALL_ATOMIC` can lower this, never raise it (a cap below a tool's price makes that tool refuse with nothing signed).
|
|
58
60
|
- **Per session:** never signs more than `AGENTSEARCH_MAX_TOTAL_ATOMIC` in total while it runs (default **1000000 = $1.00**). Spend is counted when a payment is signed. The total resets when the server restarts.
|
|
59
61
|
- **Only these terms:** scheme `exact`, network Base (`eip155:8453`), asset USDC (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`), and the route's pinned payee: AgentSearch (`0xC49B157887e51c21CB655f39CF65D6a4c2a4C337`) on the direct route, or the portal's payee (`0xF732ea490c5766071785a2310523f7fA2CEbB829`) on the Pocket route, with a 402 whose resource is the tool's own endpoint. Anything else is refused with nothing signed.
|
|
60
62
|
- The key is read from env, used only to sign, and is not returned in a tool result.
|
|
@@ -80,6 +82,7 @@ If `AGENTSEARCH_BASE_URL` is set, it takes precedence and no payment is made:
|
|
|
80
82
|
| `agentsearch_web_search` | `query` (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. |
|
|
81
83
|
| `agentsearch_extract` | `url` (absolute URL, required), `formats` (`markdown`\|`text`, optional), `max_chars` (1–100000, optional) | Page extract (title, markdown/text, links, meta) via `POST /v1/extract`. Use when you already have a URL. Read-only HTTP. |
|
|
82
84
|
| `agentsearch_render` | `url` (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. |
|
|
85
|
+
| `agentsearch_search_and_read` | `query` (required); optional: `num_results` (1–5, default 3), `max_results` (alias), `max_chars` (1–20000, default 8000), `render_fallback` (default false, at most one page) | Search the live web and return the top pages as markdown in one paid call via `POST /x402/v1/search_and_read` ($0.015, direct-only, charged only when at least one page has text). Use when you need hits and their text together. Read-only HTTP. |
|
|
83
86
|
| `agentsearch_review_lookup` | `task` (`search`\|`extract`\|`render`\|`scrape`\|`llm`\|`data`\|`finance`\|`crypto`\|`other`) or `service_id`; optional: `max_price_usd`, `network` (`pocket`\|`x402`\|`mcp`), `limit` (1–20, default 5), `include_down` | **Look up before choosing a tool.** Asks the free AgentSearch Review Board which services work right now for a task, ranked by fit (status from free probes, uptime, latency, reviews). Notes from other agents come back only as `untrusted_note`. Read-only HTTP to the board (not to your AgentSearch API). |
|
|
84
87
|
| `agentsearch_review_submit` | `service_id`, `success` (required); optional: `task`, `latency_ms`, `quality` (1–5), `price_paid_usd`, `note`, `called_at`, `proof_tx_hash`, `pocket_session_id` | **Submit after using one.** Posts a short structured review to the board. Free; anonymous unless `AGENTSEARCH_REVIEW_KEY` is set. Writes one public review; does not call or pay the reviewed service. |
|
|
85
88
|
|
|
@@ -125,7 +128,7 @@ Binary: `agentsearch-mcp` → `dist/index.js`
|
|
|
125
128
|
|----------|----------|--------|
|
|
126
129
|
| `AGENTSEARCH_WALLET_PRIVATE_KEY` | no | Without it, search uses the free tier (up to 25 searches/day per IP, subject to shared daily capacity) and extract/render are unavailable. Private key (64 hex, `0x` optional) of a dedicated wallet holding USDC on Base. Enables paid mode. Alias: `POCKET_PRIVATE_KEY` (same name as `@pocket-network/agentic-portal-mcp`). |
|
|
127
130
|
| `AGENTSEARCH_MAX_TOTAL_ATOMIC` | no | Session spend cap in USDC atomic units. Default `1000000` ($1.00). Alias: `POCKET_MAX_TOTAL_ATOMIC`. |
|
|
128
|
-
| `AGENTSEARCH_MAX_PER_CALL_ATOMIC` | no | Lower per-call cap; default and maximum `
|
|
131
|
+
| `AGENTSEARCH_MAX_PER_CALL_ATOMIC` | no | Lower per-call cap; default and maximum `20000` ($0.020) on the direct route, `5000` ($0.005) on the Pocket route. Alias: `POCKET_MAX_PER_CALL_ATOMIC`. |
|
|
129
132
|
| `AGENTSEARCH_PAYMENT_ROUTE` | no | `direct` (default since 1.6.0: AgentSearch's own x402 API) or `pocket` (Pocket Network Agentic Portal, $0.005 per call). The 1.5.0 switch `AGENTSEARCH_X402_DIRECT=0` also selects `pocket`. |
|
|
130
133
|
| `AGENTSEARCH_BASE_URL` | no | Base URL of your self-hosted API (no trailing slash). When set, search/extract/render use it instead of the paid portal. |
|
|
131
134
|
| `AGENTSEARCH_TIMEOUT_MS` | no | Per-request timeout, 1000–300000 ms (default 30000). |
|
|
@@ -286,7 +289,7 @@ To fund the wallet, send a little USDC **on Base** (for example $1, enough for a
|
|
|
286
289
|
|
|
287
290
|
## Paid route: direct by default since 1.6.0
|
|
288
291
|
|
|
289
|
-
In 1.5.0 the direct x402 API was opt-in (`AGENTSEARCH_X402_DIRECT=1`). **From 1.6.0 it is the default paid route**: with a wallet key, paid calls go straight to AgentSearch at `https://api.agentsearchhq.com` (search $0.008, extract $0.007, render $0.010), a little more than the Pocket route's $0.005.
|
|
292
|
+
In 1.5.0 the direct x402 API was opt-in (`AGENTSEARCH_X402_DIRECT=1`). **From 1.6.0 it is the default paid route**: with a wallet key, paid calls go straight to AgentSearch at `https://api.agentsearchhq.com` (search $0.008, extract $0.007, render $0.010, and from 1.7.0 search_and_read $0.015), a little more than the Pocket route's $0.005.
|
|
290
293
|
|
|
291
294
|
```json
|
|
292
295
|
"env": {
|
|
@@ -294,7 +297,7 @@ In 1.5.0 the direct x402 API was opt-in (`AGENTSEARCH_X402_DIRECT=1`). **From 1.
|
|
|
294
297
|
}
|
|
295
298
|
```
|
|
296
299
|
|
|
297
|
-
To keep paying $0.005 through the Pocket Network Agentic Portal, add `"AGENTSEARCH_PAYMENT_ROUTE": "pocket"` (or keep `"AGENTSEARCH_X402_DIRECT": "0"`). If you set `AGENTSEARCH_MAX_PER_CALL_ATOMIC=5000`
|
|
300
|
+
To keep paying $0.005 through the Pocket Network Agentic Portal, add `"AGENTSEARCH_PAYMENT_ROUTE": "pocket"` (or keep `"AGENTSEARCH_X402_DIRECT": "0"`). If you set `AGENTSEARCH_MAX_PER_CALL_ATOMIC=5000` or `10000` from an older release, raise it to `20000` or remove it, or Search + Read (and any tool above your cap) will refuse (nothing is signed).
|
|
298
301
|
|
|
299
302
|
Unchanged: free search with no wallet, the no-wallet extract/render free trial, search staying free unless `AGENTSEARCH_MODE=paid`, self-hosted mode, and the review tools.
|
|
300
303
|
|
package/dist/backend.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Chooses how search/extract/render are served: self-hosted base URL, AgentSearch's direct x402 API (default paid route since 1.6.0), Pocket portal (x402, AGENTSEARCH_PAYMENT_ROUTE=pocket), or the free relay (search + extract/render free trial). */
|
|
2
2
|
import { type ExtractRequest, type RenderRequest, type SearchRequest } from "./client.js";
|
|
3
|
-
import { type
|
|
3
|
+
import { type DirectOperation } from "./direct.js";
|
|
4
4
|
export type BackendMode = "self-hosted" | "pocket" | "direct" | "free-relay";
|
|
5
5
|
export declare const MODE_ENV_VAR = "AGENTSEARCH_MODE";
|
|
6
6
|
export declare const SEARCH_MODES: readonly ["free", "paid", "auto"];
|
|
@@ -14,7 +14,9 @@ export type SearchMode = (typeof SEARCH_MODES)[number];
|
|
|
14
14
|
export declare function searchMode(): SearchMode | "invalid";
|
|
15
15
|
export declare function invalidModeMessage(): string;
|
|
16
16
|
/** Which backend serves an operation. Search: free relay by default, portal only in paid mode (or auto + wallet key). Extract/render: portal when a wallet key is set, else the relay's free trial. */
|
|
17
|
-
export declare
|
|
17
|
+
export declare const SEARCH_AND_READ_POCKET_MESSAGE = "agentsearch_search_and_read is only available on AgentSearch's direct x402 API ($0.015 per call at https://api.agentsearchhq.com/x402/v1/search_and_read). Unset AGENTSEARCH_PAYMENT_ROUTE or set it to direct. It is not on Pocket Network. Nothing was signed.";
|
|
18
|
+
export declare const SEARCH_AND_READ_SELF_HOSTED_MESSAGE = "agentsearch_search_and_read is only available on AgentSearch's direct x402 API (https://api.agentsearchhq.com/x402/v1/search_and_read), not on a self-hosted AGENTSEARCH_BASE_URL. Unset AGENTSEARCH_BASE_URL to use the direct API (needs a wallet key).";
|
|
19
|
+
export declare function backendMode(op?: DirectOperation): BackendMode;
|
|
18
20
|
type ToolResult = {
|
|
19
21
|
content: {
|
|
20
22
|
type: "text";
|
|
@@ -23,5 +25,5 @@ type ToolResult = {
|
|
|
23
25
|
isError?: boolean;
|
|
24
26
|
structuredContent?: Record<string, unknown>;
|
|
25
27
|
};
|
|
26
|
-
export declare function runOperation(op:
|
|
28
|
+
export declare function runOperation(op: DirectOperation, body: SearchRequest | ExtractRequest | RenderRequest | Record<string, unknown>): Promise<ToolResult>;
|
|
27
29
|
export {};
|
package/dist/backend.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Chooses how search/extract/render are served: self-hosted base URL, AgentSearch's direct x402 API (default paid route since 1.6.0), Pocket portal (x402, AGENTSEARCH_PAYMENT_ROUTE=pocket), or the free relay (search + extract/render free trial). */
|
|
2
2
|
import { extractPage, hasBaseUrl, loadConfig, renderPage, webSearch } from "./client.js";
|
|
3
3
|
import { callPortal, hasWalletKey, PortalError } from "./pocket.js";
|
|
4
|
-
import { callDirect, directEnabled } from "./direct.js";
|
|
4
|
+
import { callDirect, directEnabled, DIRECT_SETUP_MESSAGE } from "./direct.js";
|
|
5
5
|
import { invalidRouteMessage, paidRoute } from "./route.js";
|
|
6
6
|
import { AgentSearchHttpError } from "./client.js";
|
|
7
7
|
import { FreeTrialUnavailableError, freeTrialEnabled, paidOnlyMessage, relaySearch, relayTrial } from "./relay.js";
|
|
@@ -23,7 +23,19 @@ export function invalidModeMessage() {
|
|
|
23
23
|
return `${MODE_ENV_VAR} must be one of 'free', 'paid' or 'auto' (got ${JSON.stringify((process.env[MODE_ENV_VAR] ?? "").trim())}). No call was made.`;
|
|
24
24
|
}
|
|
25
25
|
/** Which backend serves an operation. Search: free relay by default, portal only in paid mode (or auto + wallet key). Extract/render: portal when a wallet key is set, else the relay's free trial. */
|
|
26
|
+
export const SEARCH_AND_READ_POCKET_MESSAGE = "agentsearch_search_and_read is only available on AgentSearch's direct x402 API ($0.015 per call at https://api.agentsearchhq.com/x402/v1/search_and_read). Unset AGENTSEARCH_PAYMENT_ROUTE or set it to direct. It is not on Pocket Network. Nothing was signed.";
|
|
27
|
+
export const SEARCH_AND_READ_SELF_HOSTED_MESSAGE = "agentsearch_search_and_read is only available on AgentSearch's direct x402 API (https://api.agentsearchhq.com/x402/v1/search_and_read), not on a self-hosted AGENTSEARCH_BASE_URL. Unset AGENTSEARCH_BASE_URL to use the direct API (needs a wallet key).";
|
|
26
28
|
export function backendMode(op = "search") {
|
|
29
|
+
if (op === "search_and_read") {
|
|
30
|
+
if (hasBaseUrl())
|
|
31
|
+
return "self-hosted";
|
|
32
|
+
if (!hasWalletKey())
|
|
33
|
+
return "free-relay";
|
|
34
|
+
const route = paidRoute();
|
|
35
|
+
if (route === "pocket")
|
|
36
|
+
return "pocket";
|
|
37
|
+
return "direct";
|
|
38
|
+
}
|
|
27
39
|
const m = paidBackend(op);
|
|
28
40
|
// Since 1.6.0 the paid rail is AgentSearch's own x402 API unless AGENTSEARCH_PAYMENT_ROUTE=pocket (or AGENTSEARCH_X402_DIRECT=0); nothing else changes.
|
|
29
41
|
return m === "pocket" && directEnabled() ? "direct" : m;
|
|
@@ -47,6 +59,22 @@ const RESPONSE_NOTE = "response is the portal envelope {portal, data}; data is t
|
|
|
47
59
|
export async function runOperation(op, body) {
|
|
48
60
|
const mode = backendMode(op);
|
|
49
61
|
try {
|
|
62
|
+
if (op === "search_and_read") {
|
|
63
|
+
if (mode === "self-hosted")
|
|
64
|
+
return fail(SEARCH_AND_READ_SELF_HOSTED_MESSAGE);
|
|
65
|
+
if (mode === "free-relay")
|
|
66
|
+
return fail(DIRECT_SETUP_MESSAGE);
|
|
67
|
+
if (paidRoute() === "invalid")
|
|
68
|
+
return fail(invalidRouteMessage());
|
|
69
|
+
if (mode === "pocket")
|
|
70
|
+
return fail(SEARCH_AND_READ_POCKET_MESSAGE);
|
|
71
|
+
const clean = {};
|
|
72
|
+
for (const [k, v] of Object.entries(body))
|
|
73
|
+
if (v !== undefined && v !== null)
|
|
74
|
+
clean[k] = v;
|
|
75
|
+
const result = await callDirect("search_and_read", clean);
|
|
76
|
+
return ok({ ...result, note: DIRECT_RESPONSE_NOTE });
|
|
77
|
+
}
|
|
50
78
|
if (op === "search" && mode !== "self-hosted" && searchMode() === "invalid")
|
|
51
79
|
return fail(invalidModeMessage());
|
|
52
80
|
if (mode === "self-hosted") {
|
package/dist/backend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,0PAA0P;AAC1P,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAA+D,MAAM,aAAa,CAAC;AACtJ,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAwB,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,0PAA0P;AAC1P,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAA+D,MAAM,aAAa,CAAC;AACtJ,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAwB,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAwB,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAInH,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,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AE,KAAK,CAAC,CAAC;QAC9D,OAAO,EAAE,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,WAAW,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtG,CAAC;QACD,IAAI,GAAG,YAAY,oBAAoB,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,KAAK,YAAY;YAAE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC9G,IAAI,GAAG,YAAY,oBAAoB,IAAI,IAAI,KAAK,YAAY,IAAI,EAAE,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC,cAAc,EAAE,iBAAiB,GAAG,CAAC,MAAM,qCAAqC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QAC3M,OAAO,IAAI,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC"}
|
package/dist/direct.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type PortalOperation, type PortalResult } from "./pocket.js";
|
|
2
|
+
export type DirectOperation = PortalOperation | "search_and_read";
|
|
2
3
|
export declare const DIRECT_ENV_VAR = "AGENTSEARCH_X402_DIRECT";
|
|
3
4
|
export declare const DEFAULT_DIRECT_URL = "https://api.agentsearchhq.com";
|
|
4
5
|
/** AgentSearch's own payee for the direct API (published in /.well-known/x402 and the 402 terms). */
|
|
5
6
|
export declare const DIRECT_PAYEE = "0xC49B157887e51c21CB655f39CF65D6a4c2a4C337";
|
|
6
|
-
/** $0.
|
|
7
|
-
export declare const DIRECT_MAX_PER_CALL_ATOMIC =
|
|
7
|
+
/** $0.020 in USDC atomic units: hard ceiling per direct call (search_and_read is $0.015, render $0.010, search $0.008, extract $0.007). */
|
|
8
|
+
export declare const DIRECT_MAX_PER_CALL_ATOMIC = 20000n;
|
|
8
9
|
/** Published direct prices, for messages only (the 402 is authoritative, the ceiling is the guard). */
|
|
9
|
-
export declare const DIRECT_PRICES_USD: Record<
|
|
10
|
+
export declare const DIRECT_PRICES_USD: Record<DirectOperation, string>;
|
|
10
11
|
/** True unless AGENTSEARCH_PAYMENT_ROUTE=pocket (or AGENTSEARCH_X402_DIRECT=0). An invalid route value is refused in runOperation. */
|
|
11
12
|
export declare function directEnabled(): boolean;
|
|
12
13
|
export declare const DIRECT_SETUP_MESSAGE: string;
|
|
@@ -16,11 +17,11 @@ export interface DirectSettings {
|
|
|
16
17
|
perCallCapAtomic: bigint;
|
|
17
18
|
}
|
|
18
19
|
export declare function loadDirectSettings(): DirectSettings;
|
|
19
|
-
/** Only the fields the direct API reads: search {query, max_results
|
|
20
|
-
export declare function directBody(op:
|
|
20
|
+
/** Only the fields the direct API reads: search {query, max_results}; extract/render {url}; search_and_read {query, num_results, max_results, max_chars, render_fallback}. */
|
|
21
|
+
export declare function directBody(op: DirectOperation, body: Record<string, unknown>): {
|
|
21
22
|
body: Record<string, unknown>;
|
|
22
23
|
dropped: string[];
|
|
23
24
|
};
|
|
24
|
-
export declare function callDirect(op:
|
|
25
|
+
export declare function callDirect(op: DirectOperation, input: Record<string, unknown>): Promise<PortalResult & {
|
|
25
26
|
dropped?: string[];
|
|
26
27
|
}>;
|
package/dist/direct.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Direct x402 route (the default paid route since 1.6.0; opt-in in 1.5.0): call AgentSearch's own x402 API on Base mainnet
|
|
3
|
-
* (https://api.agentsearchhq.com/x402/v1/{search,extract,render}) instead of the Pocket portal.
|
|
3
|
+
* (https://api.agentsearchhq.com/x402/v1/{search,extract,render,search_and_read}) instead of the Pocket portal.
|
|
4
4
|
*
|
|
5
5
|
* Same safety model as pocket.ts: unpaid POST -> 402 with PAYMENT-REQUIRED -> every limit is checked
|
|
6
|
-
* BEFORE signing (scheme exact, Base, USDC, pinned AgentSearch payee, per-call ceiling $0.
|
|
6
|
+
* BEFORE signing (scheme exact, Base, USDC, pinned AgentSearch payee, per-call ceiling $0.020, session cap)
|
|
7
7
|
* -> retry once with PAYMENT-SIGNATURE -> 200 with the raw result and the receipt in PAYMENT-RESPONSE.
|
|
8
8
|
* The API settles only after a successful answer; 400/502 and empty results are not charged.
|
|
9
9
|
*
|
|
@@ -20,10 +20,10 @@ export const DIRECT_ENV_VAR = "AGENTSEARCH_X402_DIRECT";
|
|
|
20
20
|
export const DEFAULT_DIRECT_URL = "https://api.agentsearchhq.com";
|
|
21
21
|
/** AgentSearch's own payee for the direct API (published in /.well-known/x402 and the 402 terms). */
|
|
22
22
|
export const DIRECT_PAYEE = "0xC49B157887e51c21CB655f39CF65D6a4c2a4C337";
|
|
23
|
-
/** $0.
|
|
24
|
-
export const DIRECT_MAX_PER_CALL_ATOMIC =
|
|
23
|
+
/** $0.020 in USDC atomic units: hard ceiling per direct call (search_and_read is $0.015, render $0.010, search $0.008, extract $0.007). */
|
|
24
|
+
export const DIRECT_MAX_PER_CALL_ATOMIC = 20000n;
|
|
25
25
|
/** Published direct prices, for messages only (the 402 is authoritative, the ceiling is the guard). */
|
|
26
|
-
export const DIRECT_PRICES_USD = { search: "$0.008", extract: "$0.007", render: "$0.010" };
|
|
26
|
+
export const DIRECT_PRICES_USD = { search: "$0.008", extract: "$0.007", render: "$0.010", search_and_read: "$0.015" };
|
|
27
27
|
/** True unless AGENTSEARCH_PAYMENT_ROUTE=pocket (or AGENTSEARCH_X402_DIRECT=0). An invalid route value is refused in runOperation. */
|
|
28
28
|
export function directEnabled() {
|
|
29
29
|
return paidRoute() !== "pocket";
|
|
@@ -31,7 +31,7 @@ export function directEnabled() {
|
|
|
31
31
|
export const DIRECT_SETUP_MESSAGE = [
|
|
32
32
|
"This paid call needs a wallet: no wallet key is configured (agentsearch_web_search is free by default and only pays when AGENTSEARCH_MODE=paid or auto).",
|
|
33
33
|
"Set AGENTSEARCH_WALLET_PRIVATE_KEY (or POCKET_PRIVATE_KEY) to the 64-hex private key of a NEW wallet made only for this, fund it with a little USDC on Base (no ETH needed), and restart the client.",
|
|
34
|
-
`Paid calls go to AgentSearch's own x402 API by default: search ${DIRECT_PRICES_USD.search}, extract ${DIRECT_PRICES_USD.extract}, render ${DIRECT_PRICES_USD.render} per call, paid to AgentSearch at ${DEFAULT_DIRECT_URL} (docs: https://agentsearchhq.com/docs/x402). Spending is capped at $0.
|
|
34
|
+
`Paid calls go to AgentSearch's own x402 API by default: search ${DIRECT_PRICES_USD.search}, extract ${DIRECT_PRICES_USD.extract}, render ${DIRECT_PRICES_USD.render}, search_and_read ${DIRECT_PRICES_USD.search_and_read} per call, paid to AgentSearch at ${DEFAULT_DIRECT_URL} (docs: https://agentsearchhq.com/docs/x402). Spending is capped at $0.020 per call and AGENTSEARCH_MAX_TOTAL_ATOMIC per session (default $1.00). Search + Read is direct-only.`,
|
|
35
35
|
"Set AGENTSEARCH_PAYMENT_ROUTE=pocket to pay through the Pocket Network Agentic Portal instead ($0.005 per call). Or set AGENTSEARCH_BASE_URL to your own self-hosted AgentSearch-compatible API.",
|
|
36
36
|
"Wallet setup takes about 2 minutes: https://agentsearchhq.com/wallet-setup",
|
|
37
37
|
].join(" ");
|
|
@@ -52,12 +52,14 @@ export function loadDirectSettings() {
|
|
|
52
52
|
throw new PortalError("AGENTSEARCH_X402_DIRECT_URL must be https:// (http only for localhost). Nothing was signed.");
|
|
53
53
|
const session = atomicEnv(["AGENTSEARCH_MAX_TOTAL_ATOMIC", "POCKET_MAX_TOTAL_ATOMIC"], DEFAULT_SESSION_CAP_ATOMIC);
|
|
54
54
|
const perCall = atomicEnv(["AGENTSEARCH_MAX_PER_CALL_ATOMIC", "POCKET_MAX_PER_CALL_ATOMIC"], DIRECT_MAX_PER_CALL_ATOMIC);
|
|
55
|
-
// A per-call setting can only lower the hard $0.
|
|
55
|
+
// A per-call setting can only lower the hard $0.020 ceiling, never raise it.
|
|
56
56
|
return { baseUrl, sessionCapAtomic: session, perCallCapAtomic: perCall < DIRECT_MAX_PER_CALL_ATOMIC ? perCall : DIRECT_MAX_PER_CALL_ATOMIC };
|
|
57
57
|
}
|
|
58
|
-
/** Only the fields the direct API reads: search {query, max_results
|
|
58
|
+
/** Only the fields the direct API reads: search {query, max_results}; extract/render {url}; search_and_read {query, num_results, max_results, max_chars, render_fallback}. */
|
|
59
59
|
export function directBody(op, body) {
|
|
60
|
-
const keep = op === "search" ? ["query", "max_results"]
|
|
60
|
+
const keep = op === "search" ? ["query", "max_results"]
|
|
61
|
+
: op === "search_and_read" ? ["query", "num_results", "max_results", "max_chars", "render_fallback"]
|
|
62
|
+
: ["url"];
|
|
61
63
|
const out = {};
|
|
62
64
|
const dropped = [];
|
|
63
65
|
for (const [k, v] of Object.entries(body)) {
|
|
@@ -110,7 +112,7 @@ export async function callDirect(op, input) {
|
|
|
110
112
|
}
|
|
111
113
|
catch (e) {
|
|
112
114
|
if (e instanceof PortalError && settings.perCallCapAtomic < DIRECT_MAX_PER_CALL_ATOMIC && ceiling === settings.perCallCapAtomic) {
|
|
113
|
-
throw new PortalError(`${e.message} Your per-call cap (AGENTSEARCH_MAX_PER_CALL_ATOMIC=${settings.perCallCapAtomic}) is below this route's price; since 1.
|
|
115
|
+
throw new PortalError(`${e.message} Your per-call cap (AGENTSEARCH_MAX_PER_CALL_ATOMIC=${settings.perCallCapAtomic}) is below this route's price; since 1.7.0 paid calls go to AgentSearch's own x402 API (search $0.008, extract $0.007, render $0.010, search_and_read $0.015). Raise the cap to 20000, remove it, or set AGENTSEARCH_PAYMENT_ROUTE=pocket for the $0.005 Pocket route (search, extract and render only; search_and_read is direct-only).`, e.detail);
|
|
114
116
|
}
|
|
115
117
|
throw e;
|
|
116
118
|
}
|
package/dist/direct.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct.js","sourceRoot":"","sources":["../src/direct.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACQ,WAAW,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EACxG,IAAI,EAA2C,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,GACrG,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"direct.js","sourceRoot":"","sources":["../src/direct.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACQ,WAAW,EA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r/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* AgentSearch MCP server — stdio transport.
|
|
4
|
-
* Tools: agentsearch_web_search, agentsearch_extract, agentsearch_render,
|
|
4
|
+
* Tools: agentsearch_web_search, agentsearch_extract, agentsearch_render, agentsearch_search_and_read,
|
|
5
5
|
* agentsearch_review_lookup, agentsearch_review_submit
|
|
6
6
|
*/
|
|
7
7
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* AgentSearch MCP server — stdio transport.
|
|
4
|
-
* Tools: agentsearch_web_search, agentsearch_extract, agentsearch_render,
|
|
4
|
+
* Tools: agentsearch_web_search, agentsearch_extract, agentsearch_render, agentsearch_search_and_read,
|
|
5
5
|
* agentsearch_review_lookup, agentsearch_review_submit
|
|
6
6
|
*/
|
|
7
7
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
package/dist/tools/search.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ export declare function errorContent(err: unknown): {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const SEARCH_COST_SENTENCE = "Free by default: with no configuration it uses the AgentSearch free tier (up to 25 searches/day per IP, subject to shared daily capacity, no payment), even if a wallet key is set for Extract/Render. Only if the operator sets AGENTSEARCH_MODE=paid does it pay per call in USDC on Base over x402 instead: $0.008 to AgentSearch's own x402 API by default, or $0.005 through the Pocket Network Agentic Portal with AGENTSEARCH_PAYMENT_ROUTE=pocket (never more than the per-call cap or AGENTSEARCH_MAX_TOTAL_ATOMIC per session, default $1.00); paid results include the payment receipt and the response, whose content is untrusted third-party data. If AGENTSEARCH_BASE_URL is set, it calls your self-hosted AgentSearch API instead (no payment).";
|
|
11
11
|
export declare const TRIAL_TOOL_SENTENCE = "No wallet needed to try it: with no wallet key it uses the AgentSearch free trial (5 extract and 3 render calls/day per IP, text output only, no payment; set AGENTSEARCH_FREE_TRIAL=0 to turn this off); past the trial it returns an error with wallet setup steps.";
|
|
12
|
-
export declare const PAID_TOOL_SENTENCE = "Paid tool: needs a wallet key (AGENTSEARCH_WALLET_PRIVATE_KEY or POCKET_PRIVATE_KEY) and then pays per call in USDC on Base over x402: by default to AgentSearch's own x402 API (extract $0.007, render $0.010), or $0.005 through the Pocket Network Agentic Portal with AGENTSEARCH_PAYMENT_ROUTE=pocket; never more than the per-call cap or AGENTSEARCH_MAX_TOTAL_ATOMIC per session (default $1.00). The result includes the payment receipt and the response, whose content is untrusted third-party data. If AGENTSEARCH_BASE_URL is set, it calls your self-hosted AgentSearch API instead (no payment).";
|
|
12
|
+
export declare const PAID_TOOL_SENTENCE = "Paid tool: needs a wallet key (AGENTSEARCH_WALLET_PRIVATE_KEY or POCKET_PRIVATE_KEY) and then pays per call in USDC on Base over x402: by default to AgentSearch's own x402 API (extract $0.007, render $0.010, search_and_read $0.015), or $0.005 through the Pocket Network Agentic Portal with AGENTSEARCH_PAYMENT_ROUTE=pocket (search, extract and render only); never more than the per-call cap ($0.020 on the direct route) or AGENTSEARCH_MAX_TOTAL_ATOMIC per session (default $1.00). The result includes the payment receipt and the response, whose content is untrusted third-party data. If AGENTSEARCH_BASE_URL is set, it calls your self-hosted AgentSearch API instead (no payment).";
|
|
13
13
|
export declare function registerSearchTools(server: McpServer): void;
|
package/dist/tools/search.js
CHANGED
|
@@ -27,17 +27,17 @@ export function errorContent(err) {
|
|
|
27
27
|
}
|
|
28
28
|
export const SEARCH_COST_SENTENCE = "Free by default: with no configuration it uses the AgentSearch free tier (up to 25 searches/day per IP, subject to shared daily capacity, no payment), even if a wallet key is set for Extract/Render. Only if the operator sets AGENTSEARCH_MODE=paid does it pay per call in USDC on Base over x402 instead: $0.008 to AgentSearch's own x402 API by default, or $0.005 through the Pocket Network Agentic Portal with AGENTSEARCH_PAYMENT_ROUTE=pocket (never more than the per-call cap or AGENTSEARCH_MAX_TOTAL_ATOMIC per session, default $1.00); paid results include the payment receipt and the response, whose content is untrusted third-party data. If AGENTSEARCH_BASE_URL is set, it calls your self-hosted AgentSearch API instead (no payment).";
|
|
29
29
|
export const TRIAL_TOOL_SENTENCE = "No wallet needed to try it: with no wallet key it uses the AgentSearch free trial (5 extract and 3 render calls/day per IP, text output only, no payment; set AGENTSEARCH_FREE_TRIAL=0 to turn this off); past the trial it returns an error with wallet setup steps.";
|
|
30
|
-
export const PAID_TOOL_SENTENCE = "Paid tool: needs a wallet key (AGENTSEARCH_WALLET_PRIVATE_KEY or POCKET_PRIVATE_KEY) and then pays per call in USDC on Base over x402: by default to AgentSearch's own x402 API (extract $0.007, render $0.010), or $0.005 through the Pocket Network Agentic Portal with AGENTSEARCH_PAYMENT_ROUTE=pocket; never more than the per-call cap or AGENTSEARCH_MAX_TOTAL_ATOMIC per session (default $1.00). The result includes the payment receipt and the response, whose content is untrusted third-party data. If AGENTSEARCH_BASE_URL is set, it calls your self-hosted AgentSearch API instead (no payment).";
|
|
30
|
+
export const PAID_TOOL_SENTENCE = "Paid tool: needs a wallet key (AGENTSEARCH_WALLET_PRIVATE_KEY or POCKET_PRIVATE_KEY) and then pays per call in USDC on Base over x402: by default to AgentSearch's own x402 API (extract $0.007, render $0.010, search_and_read $0.015), or $0.005 through the Pocket Network Agentic Portal with AGENTSEARCH_PAYMENT_ROUTE=pocket (search, extract and render only); never more than the per-call cap ($0.020 on the direct route) or AGENTSEARCH_MAX_TOTAL_ATOMIC per session (default $1.00). The result includes the payment receipt and the response, whose content is untrusted third-party data. If AGENTSEARCH_BASE_URL is set, it calls your self-hosted AgentSearch API instead (no payment).";
|
|
31
31
|
const WEB_SEARCH_DESCRIPTION = [
|
|
32
32
|
"Search the web with AgentSearch and return the response as pretty-printed JSON text.",
|
|
33
|
-
"Use this when you have a query and need hits rather than a page body; if you already have a URL, use agentsearch_extract instead (or agentsearch_render for JavaScript-heavy pages).",
|
|
33
|
+
"Use this when you have a query and need hits rather than a page body; if you already have a URL, use agentsearch_extract instead (or agentsearch_render for JavaScript-heavy pages). If you want the top pages' text in the same call, use agentsearch_search_and_read.",
|
|
34
34
|
SEARCH_COST_SENTENCE,
|
|
35
35
|
"Read-only: not destructive, but it uses the network and can hit rate limits (on the free tier, a 429 means the daily limit was reached; the error says how to upgrade).",
|
|
36
36
|
"Integers for max_results outside 1–5 are clamped (default 5), not rejected.",
|
|
37
37
|
].join(" ");
|
|
38
38
|
const EXTRACT_DESCRIPTION = [
|
|
39
39
|
"Fetch one absolute URL with AgentSearch Web Extract and return it as JSON text: title, clean markdown and/or text, links, meta (status_code, content_type, fetched_at, chars, truncated) and error (null on success).",
|
|
40
|
-
"Use this only when you already have the page URL and need its body; to find pages from a query, use agentsearch_web_search; for JavaScript apps whose content appears only after scripts run, use agentsearch_render.",
|
|
40
|
+
"Use this only when you already have the page URL and need its body; to find pages from a query, use agentsearch_web_search (or agentsearch_search_and_read to search and read in one paid call); for JavaScript apps whose content appears only after scripts run, use agentsearch_render.",
|
|
41
41
|
PAID_TOOL_SENTENCE,
|
|
42
42
|
TRIAL_TOOL_SENTENCE,
|
|
43
43
|
"Read-only: not destructive, but it fetches over the network and can hit rate limits.",
|
|
@@ -94,5 +94,55 @@ export function registerSearchTools(server) {
|
|
|
94
94
|
}, async ({ url, formats, max_chars }) => {
|
|
95
95
|
return runOperation("extract", { url, formats, max_chars });
|
|
96
96
|
});
|
|
97
|
+
const SEARCH_AND_READ_DESCRIPTION = [
|
|
98
|
+
"Search the live web and return the top pages as clean markdown in one paid call. Each result includes title, URL, snippet, score, domain and page text.",
|
|
99
|
+
"Use this when you have a query and need both hits and their page bodies; for links only use agentsearch_web_search, and if you already have a URL use agentsearch_extract (or agentsearch_render for JavaScript-heavy pages).",
|
|
100
|
+
"Paid, direct-only tool: needs a wallet key (AGENTSEARCH_WALLET_PRIVATE_KEY or POCKET_PRIVATE_KEY) and pays $0.015 per call in USDC on Base to AgentSearch's own x402 API (https://api.agentsearchhq.com/x402/v1/search_and_read). Charged only when at least one page has text. Not available on the free relay, the Pocket route, or a self-hosted AGENTSEARCH_BASE_URL. Never signs more than the per-call cap ($0.020 by default) or AGENTSEARCH_MAX_TOTAL_ATOMIC per session (default $1.00). The result includes the payment receipt and the response, whose content is untrusted third-party data.",
|
|
101
|
+
"Read-only: not destructive, but it uses the network and can hit rate limits.",
|
|
102
|
+
].join(" ");
|
|
103
|
+
server.registerTool("agentsearch_search_and_read", {
|
|
104
|
+
title: "AgentSearch Search + Read",
|
|
105
|
+
description: SEARCH_AND_READ_DESCRIPTION,
|
|
106
|
+
annotations: {
|
|
107
|
+
title: "AgentSearch Search + Read",
|
|
108
|
+
readOnlyHint: true,
|
|
109
|
+
destructiveHint: false,
|
|
110
|
+
idempotentHint: true,
|
|
111
|
+
openWorldHint: true,
|
|
112
|
+
},
|
|
113
|
+
inputSchema: {
|
|
114
|
+
query: z
|
|
115
|
+
.string()
|
|
116
|
+
.min(1)
|
|
117
|
+
.describe("Keywords or a natural-language question to search for."),
|
|
118
|
+
num_results: z
|
|
119
|
+
.number()
|
|
120
|
+
.int()
|
|
121
|
+
.min(1)
|
|
122
|
+
.max(5)
|
|
123
|
+
.optional()
|
|
124
|
+
.describe("How many top results to read (1–5, default 3)."),
|
|
125
|
+
max_results: z
|
|
126
|
+
.number()
|
|
127
|
+
.int()
|
|
128
|
+
.min(1)
|
|
129
|
+
.max(5)
|
|
130
|
+
.optional()
|
|
131
|
+
.describe("Alias of num_results, used only when num_results is absent."),
|
|
132
|
+
max_chars: z
|
|
133
|
+
.number()
|
|
134
|
+
.int()
|
|
135
|
+
.min(1)
|
|
136
|
+
.max(20000)
|
|
137
|
+
.optional()
|
|
138
|
+
.describe("Maximum markdown characters per page (1–20000, default 8000)."),
|
|
139
|
+
render_fallback: z
|
|
140
|
+
.boolean()
|
|
141
|
+
.optional()
|
|
142
|
+
.describe("If true, retry at most one empty or thin page in a headless browser (default false)."),
|
|
143
|
+
},
|
|
144
|
+
}, async ({ query, num_results, max_results, max_chars, render_fallback }) => {
|
|
145
|
+
return runOperation("search_and_read", { query, num_results, max_results, max_chars, render_fallback });
|
|
146
|
+
});
|
|
97
147
|
}
|
|
98
148
|
//# sourceMappingURL=search.js.map
|
package/dist/tools/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,UAAU,YAAY,CAAC,IAAa;IACxC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAY;IAIvC,IAAI,IAAY,CAAC;IACjB,IAAI,GAAG,YAAY,oBAAoB,EAAE,CAAC;QACxC,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;SAAM,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;QAChC,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACjC,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAC/B,kuBAAkuB,CAAC;AAEruB,MAAM,CAAC,MAAM,mBAAmB,GAC9B,uQAAuQ,CAAC;AAE1Q,MAAM,CAAC,MAAM,kBAAkB,GAC7B,
|
|
1
|
+
{"version":3,"file":"search.js","sourceR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GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,EAAE;iBACV,QAAQ,CAAC,6DAA6D,CAAC;YAC1E,SAAS,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,KAAK,CAAC;iBACV,QAAQ,EAAE;iBACV,QAAQ,CAAC,+DAA+D,CAAC;YAC5E,eAAe,EAAE,CAAC;iBACf,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,QAAQ,CAAC,sFAAsF,CAAC;SACpG;KACF,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,EAAE;QACxE,OAAO,YAAY,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;IAC1G,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/llms-install.md
CHANGED
|
@@ -38,6 +38,7 @@ After the server connects, it lists exactly these tools:
|
|
|
38
38
|
|
|
39
39
|
- `agentsearch_web_search`
|
|
40
40
|
- `agentsearch_extract`
|
|
41
|
+
- `agentsearch_search_and_read`
|
|
41
42
|
- `agentsearch_render`
|
|
42
43
|
- `agentsearch_review_lookup`
|
|
43
44
|
- `agentsearch_review_submit`
|
|
@@ -83,10 +84,10 @@ Set the wallet key and a session spend cap on the same `agentsearch` entry:
|
|
|
83
84
|
|----------|------|
|
|
84
85
|
| `AGENTSEARCH_WALLET_PRIVATE_KEY` | Private key (64 hex, `0x` optional) of a dedicated wallet with a little USDC on Base. Alias: `POCKET_PRIVATE_KEY`. |
|
|
85
86
|
| `AGENTSEARCH_MAX_TOTAL_ATOMIC` | Session spend cap in USDC atomic units. `1000000` = $1.00 (the default). Alias: `POCKET_MAX_TOTAL_ATOMIC`. |
|
|
86
|
-
| `AGENTSEARCH_MAX_PER_CALL_ATOMIC` | Optional. Can only lower the per-call cap; default and maximum `
|
|
87
|
+
| `AGENTSEARCH_MAX_PER_CALL_ATOMIC` | Optional. Can only lower the per-call cap; default and maximum `20000` ($0.020; `5000` on the Pocket route). Alias: `POCKET_MAX_PER_CALL_ATOMIC`. |
|
|
87
88
|
| `AGENTSEARCH_MODE` | Search only. Leave unset (or `free`) to keep search on the free tier (up to 25 searches/day per IP). Set to `paid` to pay $0.008 per search call. A wallet key alone does **not** make search paid. |
|
|
88
89
|
|
|
89
|
-
With no wallet key, `agentsearch_extract` and `agentsearch_render` use a small free trial (5 and 3 calls per day per IP; `AGENTSEARCH_FREE_TRIAL=0` turns it off). A wallet key enables them at $0.007 (extract) and $0.010 (render) per call. Search stays free until you also set `"AGENTSEARCH_MODE": "paid"`. Leave `autoApprove` empty so Cline asks before a tool runs; the caps above are what limit spend if it does not.
|
|
90
|
+
With no wallet key, `agentsearch_extract` and `agentsearch_render` use a small free trial (5 and 3 calls per day per IP; `AGENTSEARCH_FREE_TRIAL=0` turns it off). A wallet key enables them at $0.007 (extract) and $0.010 (render) per call, and `agentsearch_search_and_read` at $0.015 (direct-only, charged only when at least one page has text). Search stays free until you also set `"AGENTSEARCH_MODE": "paid"`. The direct per-call ceiling is $0.020. Leave `autoApprove` empty so Cline asks before a tool runs; the caps above are what limit spend if it does not.
|
|
90
91
|
|
|
91
92
|
Fund the wallet with a little USDC **on Base** (for example $1, enough for about 100-140 paid calls). Save the settings file again so Cline restarts the server with the new env.
|
|
92
93
|
|
package/manifest.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "agentsearch-mcp",
|
|
4
4
|
"display_name": "AgentSearch (agentsearchhq.com)",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.7.0",
|
|
6
6
|
"description": "Free web search out of the box (up to 25 searches/day per IP, subject to shared daily capacity) and a no-wallet free trial of page extract (5/day) and JS render (3/day); then pay per call in USDC on Base via x402 to AgentSearch's own API, or self-hosted; plus the free AgentSearch Review Board.",
|
|
7
|
-
"long_description": "Stdio MCP server from AgentSearch. With no configuration, agentsearch_web_search uses the AgentSearch free tier (up to 25 searches/day per IP, subject to shared daily capacity); with no wallet key, agentsearch_extract and agentsearch_render use the AgentSearch free trial (5 extract and 3 render calls/day per IP, text output only; set AGENTSEARCH_FREE_TRIAL=0 to turn it off), and past it they return wallet setup steps (https://agentsearchhq.com/wallet-setup). With a wallet key, agentsearch_extract and
|
|
7
|
+
"long_description": "Stdio MCP server from AgentSearch. With no configuration, agentsearch_web_search uses the AgentSearch free tier (up to 25 searches/day per IP, subject to shared daily capacity); with no wallet key, agentsearch_extract and agentsearch_render use the AgentSearch free trial (5 extract and 3 render calls/day per IP, text output only; set AGENTSEARCH_FREE_TRIAL=0 to turn it off), and past it they return wallet setup steps (https://agentsearchhq.com/wallet-setup). With a wallet key, agentsearch_extract, agentsearch_render and agentsearch_search_and_read pay AgentSearch's own x402 API on Base (https://api.agentsearchhq.com): extract $0.007, render $0.010, search_and_read $0.015 in USDC (gasless; no account or API key; failed calls are not charged; search_and_read is charged only when at least one page has text and is direct-only); search stays free unless AGENTSEARCH_MODE=paid ($0.008). The server never signs more than $0.020 per call or more than the session cap (default $1.00), signs only USDC on Base for AgentSearch's pinned payee, and returns the payment receipt with each result. Use a new wallet holding only a little USDC. Set AGENTSEARCH_PAYMENT_ROUTE=pocket to pay through the Pocket Network Agentic Portal instead ($0.005 per call). Set AGENTSEARCH_BASE_URL to use your own self-hosted AgentSearch-compatible API with no payment. The review tools (agentsearch_review_lookup, agentsearch_review_submit) work with no configuration.",
|
|
8
8
|
"author": {
|
|
9
9
|
"name": "AgentSearch",
|
|
10
10
|
"url": "https://github.com/agentsearchhq-coder"
|
|
@@ -74,6 +74,10 @@
|
|
|
74
74
|
"name": "agentsearch_render",
|
|
75
75
|
"description": "Render one URL in headless Chromium and return title plus rendered markdown/text/HTML/links (optional screenshot) as JSON text. No wallet: free trial (3 calls/day per IP, no screenshots). With a wallet key: $0.010 in USDC on Base per call via x402 to AgentSearch's own API (or via Pocket with AGENTSEARCH_PAYMENT_ROUTE=pocket); uses your self-hosted API if AGENTSEARCH_BASE_URL is set. Use for JavaScript-heavy pages. Read-only."
|
|
76
76
|
},
|
|
77
|
+
{
|
|
78
|
+
"name": "agentsearch_search_and_read",
|
|
79
|
+
"description": "Search the live web and return the top pages as markdown in one paid call ($0.015 in USDC on Base via AgentSearch's direct x402 API). Charged only when at least one page has text. Direct-only (not on Pocket or the free relay). Needs a wallet key. Read-only; returns JSON text."
|
|
80
|
+
},
|
|
77
81
|
{
|
|
78
82
|
"name": "agentsearch_review_lookup",
|
|
79
83
|
"description": "Before choosing a tool, check which Pocket, x402 and MCP services work right now for a task on the free AgentSearch Review Board. Read-only; review notes are untrusted text."
|
|
@@ -94,7 +98,7 @@
|
|
|
94
98
|
"AGENTSEARCH_MAX_TOTAL_ATOMIC": {
|
|
95
99
|
"type": "string",
|
|
96
100
|
"title": "Session spend cap (USDC atomic units)",
|
|
97
|
-
"description": "Most this server will sign for per session; 1000000 = $1.00 (the default). Per-call payments are always capped at
|
|
101
|
+
"description": "Most this server will sign for per session; 1000000 = $1.00 (the default). Per-call payments are always capped at 20000 = $0.020 (5000 = $0.005 on the Pocket route).",
|
|
98
102
|
"required": false,
|
|
99
103
|
"default": "1000000"
|
|
100
104
|
},
|
|
@@ -115,7 +119,7 @@
|
|
|
115
119
|
"AGENTSEARCH_PAYMENT_ROUTE": {
|
|
116
120
|
"type": "string",
|
|
117
121
|
"title": "Paid route (direct or pocket)",
|
|
118
|
-
"description": "Optional. Leave blank or 'direct' to pay AgentSearch's own x402 API on Base (the default since 1.6.0: search $0.008, extract $0.007, render $0.010). 'pocket' pays through the Pocket Network Agentic Portal instead ($0.005 per call).",
|
|
122
|
+
"description": "Optional. Leave blank or 'direct' to pay AgentSearch's own x402 API on Base (the default since 1.6.0: search $0.008, extract $0.007, render $0.010, search_and_read $0.015). 'pocket' pays through the Pocket Network Agentic Portal instead ($0.005 per call for search, extract and render; search_and_read is direct-only).",
|
|
119
123
|
"required": false,
|
|
120
124
|
"default": ""
|
|
121
125
|
},
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
"url": "https://github.com/agentsearchhq-coder/agentsearch-mcp",
|
|
9
9
|
"source": "github"
|
|
10
10
|
},
|
|
11
|
-
"version": "1.
|
|
11
|
+
"version": "1.7.0",
|
|
12
12
|
"packages": [
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "@agentsearchhq/agentsearch-mcp",
|
|
16
|
-
"version": "1.
|
|
16
|
+
"version": "1.7.0",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|
|
20
20
|
"environmentVariables": [
|
|
21
21
|
{
|
|
22
22
|
"name": "AGENTSEARCH_WALLET_PRIVATE_KEY",
|
|
23
|
-
"description": "Private key of a dedicated wallet with a little USDC on Base; enables paid extract/render via x402, paid to AgentSearch's own API by default (extract $0.007, render $0.010). Without it, extract/render use the free trial (5/3 calls per day per IP). Search stays free unless AGENTSEARCH_MODE=paid. Alias: POCKET_PRIVATE_KEY",
|
|
23
|
+
"description": "Private key of a dedicated wallet with a little USDC on Base; enables paid extract/render via x402, paid to AgentSearch's own API by default (extract $0.007, render $0.010, search_and_read $0.015). Without it, extract/render use the free trial (5/3 calls per day per IP). Search stays free unless AGENTSEARCH_MODE=paid. Alias: POCKET_PRIVATE_KEY",
|
|
24
24
|
"isRequired": false,
|
|
25
25
|
"isSecret": true,
|
|
26
26
|
"format": "string"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"name": "AGENTSEARCH_PAYMENT_ROUTE",
|
|
44
|
-
"description": "Paid route: direct (default since 1.6.0; AgentSearch's own x402 API on Base, search $0.008, extract $0.007, render $0.010) or pocket (Pocket Network Agentic Portal, $0.005 per call)",
|
|
44
|
+
"description": "Paid route: direct (default since 1.6.0; AgentSearch's own x402 API on Base, search $0.008, extract $0.007, render $0.010, search_and_read $0.015) or pocket (Pocket Network Agentic Portal, $0.005 per call)",
|
|
45
45
|
"isRequired": false,
|
|
46
46
|
"format": "string",
|
|
47
47
|
"default": "direct"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"name": "AGENTSEARCH_MAX_PER_CALL_ATOMIC",
|
|
64
|
-
"description": "Optional lower per-call cap in USDC atomic units (hard max
|
|
64
|
+
"description": "Optional lower per-call cap in USDC atomic units (hard max 20000 = $0.020 on the default direct route, 5000 = $0.005 on the Pocket route)",
|
|
65
65
|
"isRequired": false,
|
|
66
66
|
"format": "string"
|
|
67
67
|
},
|