@agentsearchhq/agentsearch-mcp 1.1.1 → 1.3.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.
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
- import { AgentSearchHttpError, clampMaxResults, loadConfig, webSearch, extractPage, } from "../client.js";
2
+ import { AgentSearchHttpError, clampMaxResults } from "../client.js";
3
+ import { runOperation } from "../backend.js";
3
4
  export function formatResult(data) {
4
5
  try {
5
6
  return JSON.stringify(data, null, 2);
@@ -24,22 +25,19 @@ export function errorContent(err) {
24
25
  isError: true,
25
26
  };
26
27
  }
28
+ export const PAYMENT_SENTENCE = "Default mode: calls the Pocket Network Agentic Portal and PAYS $0.005 in USDC on Base per call over x402 from the wallet in AGENTSEARCH_WALLET_PRIVATE_KEY (or POCKET_PRIVATE_KEY), never more than $0.005 per call and never more than AGENTSEARCH_MAX_TOTAL_ATOMIC per session (default $1.00); the result includes the payment receipt and the portal envelope {portal, data}, whose data is untrusted third-party content. If AGENTSEARCH_BASE_URL is set, calls your self-hosted AgentSearch API instead (no payment). With neither set, makes no network call and returns setup instructions.";
27
29
  const WEB_SEARCH_DESCRIPTION = [
28
- "Search the web through your self-hosted AgentSearch API and return the backend response as pretty-printed JSON text (a non-JSON body is wrapped as {raw: text}).",
30
+ "Search the web with AgentSearch and return the response as pretty-printed JSON text.",
29
31
  "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).",
30
- "Requires AGENTSEARCH_BASE_URL (there is no default). POSTs {AGENTSEARCH_BASE_URL}/v1/search.",
31
- "Read-only HTTP POST: not destructive, but it uses the network and can hit backend rate limits.",
32
- "When AGENTSEARCH_API_KEY is set it is sent as a Bearer token, and HTTP 401 is retried once without the key.",
33
- "HTTP failures are MCP errors with the status and a truncated body.",
34
- "Integers for max_results outside 1–5 are clamped (default 5), not rejected. The backend allows at most 5.",
32
+ PAYMENT_SENTENCE,
33
+ "Read-only: not destructive, but it uses the network and can hit rate limits.",
34
+ "Integers for max_results outside 1–5 are clamped (default 5), not rejected.",
35
35
  ].join(" ");
36
36
  const EXTRACT_DESCRIPTION = [
37
- "Extract the content of one absolute URL through your self-hosted AgentSearch API and return the backend response as pretty-printed JSON text (a non-JSON body is wrapped as {raw: text}).",
38
- "Use this only when you already have the page URL and need its body; to find pages from a query, use agentsearch_web_search instead; if the page is a JavaScript app whose content only appears after scripts run, use agentsearch_render.",
39
- "Requires AGENTSEARCH_BASE_URL (there is no default). POSTs {AGENTSEARCH_BASE_URL}/v1/extract.",
40
- "Read-only HTTP POST: not destructive, but it fetches through AgentSearch and can hit network or backend rate limits.",
41
- "When AGENTSEARCH_API_KEY is set it is sent as a Bearer token, and HTTP 401 is retried once without the key; any HTTP failure includes the status and a truncated body.",
42
- 'formats, when provided, is forwarded unchanged (for example "markdown" or "text") and is not limited to an enum; max_chars, when set, is a positive integer cap sent to the API rather than applied by this server.',
37
+ "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).",
38
+ "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.",
39
+ PAYMENT_SENTENCE,
40
+ "Read-only: not destructive, but it fetches over the network and can hit rate limits.",
43
41
  ].join(" ");
44
42
  export function registerSearchTools(server) {
45
43
  server.registerTool("agentsearch_web_search", {
@@ -57,25 +55,7 @@ export function registerSearchTools(server) {
57
55
  .describe("How many hits to request (1–5, default 5). Values outside that range are clamped."),
58
56
  },
59
57
  }, async ({ query, max_results }) => {
60
- try {
61
- const cfg = loadConfig();
62
- const clamped = clampMaxResults(max_results);
63
- const data = await webSearch(cfg, {
64
- query,
65
- max_results: clamped,
66
- });
67
- return {
68
- content: [
69
- {
70
- type: "text",
71
- text: formatResult(data),
72
- },
73
- ],
74
- };
75
- }
76
- catch (err) {
77
- return errorContent(err);
78
- }
58
+ return runOperation("search", { query, max_results: clampMaxResults(max_results) });
79
59
  });
80
60
  server.registerTool("agentsearch_extract", {
81
61
  title: "AgentSearch Extract",
@@ -83,32 +63,19 @@ export function registerSearchTools(server) {
83
63
  inputSchema: {
84
64
  url: z.string().url().describe("Absolute URL of the page to extract."),
85
65
  formats: z
86
- .array(z.string())
66
+ .array(z.enum(["markdown", "text"]))
87
67
  .optional()
88
- .describe('Optional format names to request, e.g. ["markdown","text"].'),
68
+ .describe('Renderings to return: "markdown" and/or "text" (default: the service\'s choice).'),
89
69
  max_chars: z
90
70
  .number()
91
71
  .int()
92
- .positive()
72
+ .min(1)
73
+ .max(100000)
93
74
  .optional()
94
- .describe("Optional positive limit on extracted characters."),
75
+ .describe("Cap on returned characters (1–100000, service default 50000)."),
95
76
  },
96
77
  }, async ({ url, formats, max_chars }) => {
97
- try {
98
- const cfg = loadConfig();
99
- const data = await extractPage(cfg, { url, formats, max_chars });
100
- return {
101
- content: [
102
- {
103
- type: "text",
104
- text: formatResult(data),
105
- },
106
- ],
107
- };
108
- }
109
- catch (err) {
110
- return errorContent(err);
111
- }
78
+ return runOperation("extract", { url, formats, max_chars });
112
79
  });
113
80
  }
114
81
  //# sourceMappingURL=search.js.map
@@ -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,EACL,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,SAAS,EACT,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,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,MA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,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,MAAM,CAAC;iBACX,QAAQ,EAAE;iBACV,QAAQ,CAAC,+DAA+D,CAAC;SAC7E;KACF,EACD,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;QACpC,OAAO,YAAY,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9D,CAAC,CACF,CAAC;AACJ,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const SERVER_NAME = "agentsearch-mcp";
2
2
  /** Keep in sync with package.json, manifest.json and server.json (checked by tests). */
3
- export declare const SERVER_VERSION = "1.1.1";
3
+ export declare const SERVER_VERSION = "1.3.0";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export const SERVER_NAME = "agentsearch-mcp";
2
2
  /** Keep in sync with package.json, manifest.json and server.json (checked by tests). */
3
- export const SERVER_VERSION = "1.1.1";
3
+ export const SERVER_VERSION = "1.3.0";
4
4
  //# sourceMappingURL=version.js.map
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.1.1",
6
- "description": "MCP server for a self-hosted AgentSearch API: web search, page extract, and JavaScript page rendering in headless Chromium.",
7
- "long_description": "Stdio MCP server for people running their own AgentSearch-compatible API. It calls web search, URL extract, and Web Render (headless Chromium for JavaScript-heavy pages, returning title plus rendered markdown, text, HTML, links, and an optional screenshot). AGENTSEARCH_BASE_URL is required. AGENTSEARCH_API_KEY is optional.",
5
+ "version": "1.3.0",
6
+ "description": "Web search, page extract and JS render, paid per call ($0.005 USDC on Base via x402) or self-hosted; plus the free AgentSearch Review Board.",
7
+ "long_description": "Stdio MCP server from AgentSearch. agentsearch_web_search, agentsearch_extract and agentsearch_render work out of the box with a wallet key: each call goes through the Pocket Network Agentic Portal and pays $0.005 in USDC on Base over x402 (gasless; no account or API key). The server never signs more than $0.005 per call or more than the session cap (default $1.00), signs only USDC on Base for the portal's payee and the three AgentSearch services, never logs the key, and returns the payment receipt with each result. Use a new wallet holding only a little USDC. Set AGENTSEARCH_BASE_URL instead 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"
@@ -23,7 +23,12 @@
23
23
  "web-search",
24
24
  "render",
25
25
  "headless-browser",
26
- "javascript-rendering"
26
+ "javascript-rendering",
27
+ "reviews",
28
+ "service-status",
29
+ "x402",
30
+ "usdc",
31
+ "base"
27
32
  ],
28
33
  "compatibility": {
29
34
  "platforms": [
@@ -45,30 +50,55 @@
45
50
  ],
46
51
  "env": {
47
52
  "AGENTSEARCH_BASE_URL": "${user_config.AGENTSEARCH_BASE_URL}",
48
- "AGENTSEARCH_API_KEY": "${user_config.AGENTSEARCH_API_KEY}"
53
+ "AGENTSEARCH_API_KEY": "${user_config.AGENTSEARCH_API_KEY}",
54
+ "AGENTSEARCH_REVIEW_KEY": "${user_config.AGENTSEARCH_REVIEW_KEY}",
55
+ "AGENTSEARCH_WALLET_PRIVATE_KEY": "${user_config.AGENTSEARCH_WALLET_PRIVATE_KEY}",
56
+ "AGENTSEARCH_MAX_TOTAL_ATOMIC": "${user_config.AGENTSEARCH_MAX_TOTAL_ATOMIC}"
49
57
  }
50
58
  }
51
59
  },
52
60
  "tools": [
53
61
  {
54
62
  "name": "agentsearch_web_search",
55
- "description": "Search the web via your self-hosted AgentSearch API and return JSON text. Use extract when you already have a URL. Read-only."
63
+ "description": "Search the web and return JSON text. Pays $0.005 in USDC on Base per call via the Pocket portal (x402) when a wallet key is set; uses your self-hosted API if AGENTSEARCH_BASE_URL is set. Use extract when you already have a URL. Read-only."
56
64
  },
57
65
  {
58
66
  "name": "agentsearch_extract",
59
- "description": "Extract one page from a URL. Use web search to find URLs. Read-only; returns JSON text."
67
+ "description": "Extract one page (markdown/text, title, links) from a URL. Pays $0.005 in USDC on Base per call via the Pocket portal (x402) when a wallet key is set; uses your self-hosted API if AGENTSEARCH_BASE_URL is set. Read-only; returns JSON text."
60
68
  },
61
69
  {
62
70
  "name": "agentsearch_render",
63
- "description": "Render one URL in headless Chromium and return title plus rendered markdown/text/HTML/links as JSON text. Use for JavaScript-heavy pages where extract comes back empty; prefer extract for static pages. Read-only."
71
+ "description": "Render one URL in headless Chromium and return title plus rendered markdown/text/HTML/links (optional screenshot) as JSON text. Pays $0.005 in USDC on Base per call via the Pocket portal (x402) when a wallet key is set; uses your self-hosted API if AGENTSEARCH_BASE_URL is set. Use for JavaScript-heavy pages. Read-only."
72
+ },
73
+ {
74
+ "name": "agentsearch_review_lookup",
75
+ "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."
76
+ },
77
+ {
78
+ "name": "agentsearch_review_submit",
79
+ "description": "After using a service, post a short structured review (success, latency, quality, price, optional payment proof) to the free AgentSearch Review Board."
64
80
  }
65
81
  ],
66
82
  "user_config": {
83
+ "AGENTSEARCH_WALLET_PRIVATE_KEY": {
84
+ "type": "string",
85
+ "title": "Wallet private key (pay per call)",
86
+ "description": "Optional. 64-hex private key of a NEW wallet holding a little USDC on Base. Enables search/extract/render at $0.005 per call via the Pocket Network Agentic Portal (x402). Never logged.",
87
+ "sensitive": true,
88
+ "required": false
89
+ },
90
+ "AGENTSEARCH_MAX_TOTAL_ATOMIC": {
91
+ "type": "string",
92
+ "title": "Session spend cap (USDC atomic units)",
93
+ "description": "Most this server will sign for per session; 1000000 = $1.00 (the default). Per-call payments are always capped at 5000 = $0.005.",
94
+ "required": false,
95
+ "default": "1000000"
96
+ },
67
97
  "AGENTSEARCH_BASE_URL": {
68
98
  "type": "string",
69
99
  "title": "AgentSearch base URL",
70
- "description": "Required base URL of your self-hosted AgentSearch API, without a trailing slash.",
71
- "required": true
100
+ "description": "Optional base URL of your self-hosted AgentSearch API, without a trailing slash. When set, search/extract/render use it instead of the paid portal.",
101
+ "required": false
72
102
  },
73
103
  "AGENTSEARCH_API_KEY": {
74
104
  "type": "string",
@@ -76,6 +106,13 @@
76
106
  "description": "Optional Bearer token. Leave blank if the API does not require a key.",
77
107
  "sensitive": true,
78
108
  "required": false
109
+ },
110
+ "AGENTSEARCH_REVIEW_KEY": {
111
+ "type": "string",
112
+ "title": "Review Board key (optional)",
113
+ "description": "Optional key (asrb_...) from the AgentSearch Review Board. Without it, reviews are posted anonymously with less weight.",
114
+ "sensitive": true,
115
+ "required": false
79
116
  }
80
117
  }
81
118
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@agentsearchhq/agentsearch-mcp",
3
- "version": "1.1.1",
3
+ "version": "1.3.0",
4
4
  "mcpName": "io.github.agentsearchhq-coder/agentsearch-mcp",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "description": "MCP server for a self-hosted AgentSearch API: web search, page extract, and JavaScript page rendering",
8
+ "description": "MCP server: web search, page extract and JS rendering, paid per call ($0.005 USDC on Base via x402) or self-hosted, plus the free AgentSearch Review Board",
9
9
  "type": "module",
10
10
  "main": "dist/index.js",
11
11
  "bin": {
@@ -28,7 +28,8 @@
28
28
  "mcpb:validate": "mcpb validate manifest.json",
29
29
  "mcpb:pack": "npm run build && node scripts/pack-mcpb.mjs",
30
30
  "smithery:publish": "node scripts/publish-smithery.mjs",
31
- "test": "npm run build && node --test \"test/*.mjs\""
31
+ "test": "npm run build && node --test test/*.mjs",
32
+ "smoke:live": "npm run build && node --test test/live/live-402.smoke.mjs"
32
33
  },
33
34
  "engines": {
34
35
  "node": ">=20"
@@ -40,11 +41,20 @@
40
41
  "web-search",
41
42
  "render",
42
43
  "headless-browser",
43
- "javascript-rendering"
44
+ "javascript-rendering",
45
+ "reviews",
46
+ "service-status",
47
+ "x402",
48
+ "usdc",
49
+ "base",
50
+ "pay-per-call"
44
51
  ],
45
52
  "license": "MIT",
46
53
  "dependencies": {
47
54
  "@modelcontextprotocol/sdk": "^1.18.0",
55
+ "@x402/core": "^2.26.0",
56
+ "@x402/evm": "^2.26.0",
57
+ "viem": "^2.57.4",
48
58
  "zod": "^3.24.0"
49
59
  },
50
60
  "devDependencies": {
package/server.json CHANGED
@@ -2,26 +2,46 @@
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.agentsearchhq-coder/agentsearch-mcp",
4
4
  "title": "AgentSearch (agentsearchhq.com)",
5
- "description": "AgentSearch web search, page extract and JS page render for agents. Self-hosted API via stdio.",
5
+ "description": "Web search, extract and JS render at $0.005/call (x402, USDC on Base), plus a free Review Board.",
6
6
  "websiteUrl": "https://agentsearchhq.com/?utm_source=mcp-registry&utm_medium=directory&utm_campaign=listing",
7
7
  "repository": {
8
8
  "url": "https://github.com/agentsearchhq-coder/agentsearch-mcp",
9
9
  "source": "github"
10
10
  },
11
- "version": "1.1.1",
11
+ "version": "1.3.0",
12
12
  "packages": [
13
13
  {
14
14
  "registryType": "npm",
15
15
  "identifier": "@agentsearchhq/agentsearch-mcp",
16
- "version": "1.1.1",
16
+ "version": "1.3.0",
17
17
  "transport": {
18
18
  "type": "stdio"
19
19
  },
20
20
  "environmentVariables": [
21
+ {
22
+ "name": "AGENTSEARCH_WALLET_PRIVATE_KEY",
23
+ "description": "Private key of a dedicated wallet with a little USDC on Base; pays $0.005/call via the Pocket portal (x402). Alias: POCKET_PRIVATE_KEY",
24
+ "isRequired": false,
25
+ "isSecret": true,
26
+ "format": "string"
27
+ },
28
+ {
29
+ "name": "AGENTSEARCH_MAX_TOTAL_ATOMIC",
30
+ "description": "Session spend cap in USDC atomic units (default 1000000 = $1.00). Alias: POCKET_MAX_TOTAL_ATOMIC",
31
+ "isRequired": false,
32
+ "format": "string",
33
+ "default": "1000000"
34
+ },
35
+ {
36
+ "name": "AGENTSEARCH_MAX_PER_CALL_ATOMIC",
37
+ "description": "Optional lower per-call cap (max and default 5000 = $0.005)",
38
+ "isRequired": false,
39
+ "format": "string"
40
+ },
21
41
  {
22
42
  "name": "AGENTSEARCH_BASE_URL",
23
- "description": "Base URL of your AgentSearch API deployment (no trailing slash)",
24
- "isRequired": true,
43
+ "description": "Optional self-hosted AgentSearch API base URL; when set, search/extract/render use it with no payment",
44
+ "isRequired": false,
25
45
  "format": "string"
26
46
  },
27
47
  {
@@ -30,6 +50,19 @@
30
50
  "isRequired": false,
31
51
  "isSecret": true,
32
52
  "format": "string"
53
+ },
54
+ {
55
+ "name": "AGENTSEARCH_REVIEWS_URL",
56
+ "description": "Optional Review Board URL (default https://reviews.agentsearchhq.com)",
57
+ "isRequired": false,
58
+ "format": "string"
59
+ },
60
+ {
61
+ "name": "AGENTSEARCH_REVIEW_KEY",
62
+ "description": "Optional Review Board key for weighted reviews",
63
+ "isRequired": false,
64
+ "isSecret": true,
65
+ "format": "string"
33
66
  }
34
67
  ]
35
68
  }
package/smithery.yaml CHANGED
@@ -1,23 +1,38 @@
1
- # Smithery start command for a self-hosted AgentSearch-compatible API.
1
+ # Smithery start command. Review tools work with no config. Search/extract/render pay $0.005 per call
2
+ # in USDC on Base via the Pocket Network Agentic Portal (x402) when a wallet key is set, or use your
3
+ # self-hosted API when a base URL is set.
2
4
  startCommand:
3
5
  type: stdio
4
6
  configSchema:
5
7
  type: object
6
- required:
7
- - agentsearchBaseUrl
8
8
  properties:
9
+ walletPrivateKey:
10
+ type: string
11
+ description: Optional 64-hex private key of a NEW wallet holding a little USDC on Base. Pays $0.005 per search/extract/render call via x402. Never logged.
12
+ maxTotalAtomic:
13
+ type: string
14
+ default: "1000000"
15
+ description: Session spend cap in USDC atomic units (1000000 = $1.00). Per-call payments are always capped at 5000 ($0.005).
9
16
  agentsearchBaseUrl:
10
17
  type: string
11
- description: Base URL of your self-hosted AgentSearch API (no trailing slash). Required.
18
+ description: Optional base URL of your self-hosted AgentSearch API (no trailing slash). When set, it is used instead of the paid portal.
12
19
  agentsearchApiKey:
13
20
  type: string
14
- description: Optional Bearer token for your AgentSearch API
21
+ description: Optional Bearer token for your self-hosted AgentSearch API
15
22
  commandFunction: |-
16
23
  (config) => ({
17
24
  command: 'node',
18
25
  args: ['dist/index.js'],
19
26
  env: {
20
- AGENTSEARCH_BASE_URL: config.agentsearchBaseUrl,
27
+ ...(config.walletPrivateKey
28
+ ? { AGENTSEARCH_WALLET_PRIVATE_KEY: config.walletPrivateKey }
29
+ : {}),
30
+ ...(config.maxTotalAtomic
31
+ ? { AGENTSEARCH_MAX_TOTAL_ATOMIC: config.maxTotalAtomic }
32
+ : {}),
33
+ ...(config.agentsearchBaseUrl
34
+ ? { AGENTSEARCH_BASE_URL: config.agentsearchBaseUrl }
35
+ : {}),
21
36
  ...(config.agentsearchApiKey
22
37
  ? { AGENTSEARCH_API_KEY: config.agentsearchApiKey }
23
38
  : {})