@agentsearchhq/agentsearch-mcp 1.0.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/.env.example ADDED
@@ -0,0 +1,18 @@
1
+ # AgentSearch MCP configuration
2
+ # Copy to .env for local testing (never commit .env)
3
+
4
+ # Mode: "direct" (default) talks to a local/self-hosted AgentSearch API
5
+ # "portal" uses the Pocket Network agent portal (may require x402 payment)
6
+ AGENTSEARCH_MODE=direct
7
+
8
+ # Base URL for direct mode (no trailing slash)
9
+ # Default: http://127.0.0.1:8000
10
+ AGENTSEARCH_BASE_URL=http://127.0.0.1:8000
11
+
12
+ # Optional Bearer token for direct mode Authorization header
13
+ # If the server returns 401 with the key, the client retries once without it
14
+ AGENTSEARCH_API_KEY=
15
+
16
+ # Portal reference (used when AGENTSEARCH_MODE=portal):
17
+ # POST https://agent.pocket.network/v1/agentsearch-web-search-v1/v1/search
18
+ # body: {"query":"...","max_results":5}
package/.mcpbignore ADDED
@@ -0,0 +1,43 @@
1
+ # Extra exclusions for `mcpb pack` (combined with the CLI defaults:
2
+ # .git, *.map, node_modules/.cache, node_modules/.bin, logs, lockfiles).
3
+ # Leading / anchors a pattern to the repo root so it does not strip
4
+ # files inside bundled node_modules.
5
+
6
+ .git/
7
+ .github/
8
+ .cursor/
9
+ .vscode/
10
+ .idea/
11
+
12
+ # TypeScript sources; the Node entry is dist/index.js.
13
+ # Source maps (dist/*.js.map from tsc sourceMap) are excluded by default;
14
+ # listed here so they stay out if that default changes.
15
+ /src/
16
+ *.js.map
17
+ *.mjs.map
18
+ *.cjs.map
19
+ *.ts.map
20
+ *.tsbuildinfo
21
+
22
+ # Secrets and local env. .env.example has no secrets and may ship.
23
+ .env
24
+ .env.*
25
+ !.env.example
26
+
27
+ # Tests and coverage
28
+ /tests/
29
+ /test/
30
+ /coverage/
31
+ /__tests__/
32
+
33
+ # Dev-only trees if packing the repo root (the pack script installs
34
+ # production dependencies in a staging directory instead).
35
+ /node_modules/typescript/
36
+ /node_modules/@types/
37
+ /node_modules/@anthropic-ai/
38
+ /scripts/
39
+
40
+ # Pack output and npm tarballs
41
+ *.mcpb
42
+ *.tgz
43
+ *.log
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AgentSearch / Angel Mendez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,210 @@
1
+ # agentsearch-mcp
2
+
3
+ MCP (Model Context Protocol) server that exposes **AgentSearch** web search — and optional URL extract — to Cursor, Claude Desktop, and other MCP hosts over **stdio**.
4
+
5
+ [AgentSearch](https://agentsearchhq.com) is a web-search API aimed at agents. You can run it against a **local/self-hosted** AgentSearch instance (`direct` mode) or the **Pocket Network agent portal** (`portal` mode).
6
+
7
+ - Portal search endpoint (reference):
8
+ `POST https://agent.pocket.network/v1/agentsearch-web-search-v1/v1/search`
9
+ body: `{ "query": "...", "max_results": 5 }`
10
+ - Direct search: `POST {AGENTSEARCH_BASE_URL}/v1/search` with the same body
11
+ - Direct extract: `POST {AGENTSEARCH_BASE_URL}/v1/extract`
12
+
13
+ Pocket explorer: [agentsearch-web-search-v1](https://explorer.pocket.network/service/agentsearch-web-search-v1)
14
+
15
+ > **Discovery:** This package is free to list and use. There is no paid promotion channel — discovery comes from MCP Registry / Smithery / Glama listings and real usage.
16
+
17
+ ---
18
+
19
+ ## Tools
20
+
21
+ | Tool | Args | Description |
22
+ |------|------|-------------|
23
+ | `agentsearch_web_search` | `query` (string, required), `max_results` (number, optional, default 5, clamped 1–10) | Web search in direct or portal mode. Returns pretty-printed JSON. Use for a query; use extract when you already have a URL. Read-only HTTP. |
24
+ | `agentsearch_extract` | `url` (absolute URL, required), `formats` (string[], optional), `max_chars` (positive integer, optional) | Page extract via `POST /v1/extract`. **Direct mode only** — portal fails before any request. Use when you already have a URL. Read-only HTTP. |
25
+
26
+ On portal **HTTP 402**, the search tool returns a clear MCP error that **x402 payment is required** (or switch to `AGENTSEARCH_MODE=direct`). In portal mode, `agentsearch_extract` does not call the network; it returns an MCP error telling you to switch to direct mode or use search.
27
+
28
+ ---
29
+
30
+ ## Requirements
31
+
32
+ - Node.js **20+**
33
+ - An AgentSearch backend for `direct` mode (default `http://127.0.0.1:8000`), **or** portal access for `portal` mode
34
+
35
+ ---
36
+
37
+ ## Install & build
38
+
39
+ Published package:
40
+
41
+ ```bash
42
+ npx -y @agentsearchhq/agentsearch-mcp
43
+ # or install into a project
44
+ npm i @agentsearchhq/agentsearch-mcp
45
+ ```
46
+
47
+ From a local checkout:
48
+
49
+ ```bash
50
+ cd agentsearch-mcp
51
+ npm install
52
+ npm run build
53
+ ```
54
+
55
+ Scripts: `build` → `tsc`, `start` → `node dist/index.js`, `prepare` → runs build (for publish).
56
+
57
+ Binary: `agentsearch-mcp` → `dist/index.js`
58
+
59
+ ---
60
+
61
+ ## Environment variables
62
+
63
+ | Variable | Default | Notes |
64
+ |----------|---------|--------|
65
+ | `AGENTSEARCH_MODE` | `direct` | `direct` \| `portal` |
66
+ | `AGENTSEARCH_BASE_URL` | `http://127.0.0.1:8000` | Direct mode base URL (no trailing slash) |
67
+ | `AGENTSEARCH_API_KEY` | _(empty)_ | Optional `Authorization: Bearer …` for direct; on **401** the client retries once **without** the key |
68
+
69
+ See `.env.example`. Never commit a real `.env`.
70
+
71
+ ---
72
+
73
+ ## Cursor `mcp.json`
74
+
75
+ **Project** (`.cursor/mcp.json`) or **user** (`~/.cursor/mcp.json` / Cursor Settings → MCP):
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "agentsearch": {
81
+ "command": "node",
82
+ "args": [
83
+ "C:/Users/Holla/OneDrive/Desktop/AgentSearch/agentsearch-mcp/dist/index.js"
84
+ ],
85
+ "env": {
86
+ "AGENTSEARCH_MODE": "direct",
87
+ "AGENTSEARCH_BASE_URL": "http://127.0.0.1:8000"
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ After `npm install && npm run build`, optionally use the bin:
95
+
96
+ ```json
97
+ {
98
+ "mcpServers": {
99
+ "agentsearch": {
100
+ "command": "npx",
101
+ "args": ["-y", "@agentsearchhq/agentsearch-mcp"],
102
+ "env": {
103
+ "AGENTSEARCH_MODE": "direct",
104
+ "AGENTSEARCH_BASE_URL": "http://127.0.0.1:8000"
105
+ }
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ Use `npx -y @agentsearchhq/agentsearch-mcp` (or `npm i @agentsearchhq/agentsearch-mcp`) once the package is on npm. The local path form is for a checkout of this repo.
112
+
113
+ Optional API key (direct only):
114
+
115
+ ```json
116
+ "env": {
117
+ "AGENTSEARCH_MODE": "direct",
118
+ "AGENTSEARCH_BASE_URL": "http://127.0.0.1:8000",
119
+ "AGENTSEARCH_API_KEY": "your-key-here"
120
+ }
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Claude Desktop
126
+
127
+ Edit Claude Desktop config (`claude_desktop_config.json`):
128
+
129
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
130
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
131
+
132
+ ```json
133
+ {
134
+ "mcpServers": {
135
+ "agentsearch": {
136
+ "command": "node",
137
+ "args": [
138
+ "C:/Users/Holla/OneDrive/Desktop/AgentSearch/agentsearch-mcp/dist/index.js"
139
+ ],
140
+ "env": {
141
+ "AGENTSEARCH_MODE": "direct",
142
+ "AGENTSEARCH_BASE_URL": "http://127.0.0.1:8000"
143
+ }
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ Restart Claude Desktop after saving.
150
+
151
+ ---
152
+
153
+ ## Local run (smoke)
154
+
155
+ ```bash
156
+ npm run build
157
+ # MCP hosts spawn the process; for a quick boot check:
158
+ node dist/index.js
159
+ # (process waits on stdin — Ctrl+C to stop)
160
+ ```
161
+
162
+ ---
163
+
164
+ ## Publish (high level)
165
+
166
+ No paid promo — list the package so tools can discover it via registries and usage.
167
+
168
+ ### npm
169
+
170
+ 1. `npm login` (the `@agentsearchhq` org must allow the publisher)
171
+ 2. Confirm `name` is `@agentsearchhq/agentsearch-mcp` and `version` is `1.0.0` in `package.json` (`publishConfig.access` is `public`)
172
+ 3. `npm publish` (ensure `prepare`/`build` succeed; no secrets in the tarball)
173
+
174
+ ### MCP Registry
175
+
176
+ 1. Ensure `server.json` matches your npm package + stdio transport
177
+ 2. Follow the [MCP Registry](https://github.com/modelcontextprotocol/registry) publish flow (authenticate publisher, submit server metadata)
178
+ 3. Verify the listing resolves `@agentsearchhq/agentsearch-mcp` / stdio
179
+
180
+ ### Smithery
181
+
182
+ Publish with the durable helper (preferred):
183
+
184
+ ```bash
185
+ npm run smithery:publish
186
+ ```
187
+
188
+ That runs `scripts/publish-smithery.mjs`, which ensures `agentsearch-mcp.mcpb` exists (`npm run mcpb:pack` if missing), idempotently patches the global Smithery CLI so the deploy payload always includes a tool `inputSchema` object when the MCPB omitted it, then runs `smithery mcp publish ./agentsearch-mcp.mcpb -n agentsearchhq/agentsearch-mcp`.
189
+
190
+ **MCPB note:** `manifest.json` must **omit** tool `inputSchema` — `mcpb validate` rejects it. The publish helper patches the CLI payload side instead.
191
+
192
+ Manual equivalent (after CLI is patched):
193
+
194
+ ```bash
195
+ npm run mcpb:pack
196
+ smithery mcp publish ./agentsearch-mcp.mcpb -n agentsearchhq/agentsearch-mcp
197
+ ```
198
+
199
+ `npm run mcpb:pack` compiles TypeScript to `dist/index.js`, installs production dependencies, then writes `agentsearch-mcp.mcpb`. Check the manifest with `npm run mcpb:validate`. `manifest.json` (MCPB 0.3) launches `node ${__dirname}/dist/index.js` and maps optional `AGENTSEARCH_MODE` (default `direct`), `AGENTSEARCH_BASE_URL` (default `http://127.0.0.1:8000`), and sensitive `AGENTSEARCH_API_KEY`. `smithery.yaml` remains as start-command metadata. Dry-run patch detection only: `node scripts/publish-smithery.mjs --dry-patch`.
200
+
201
+ ### Glama
202
+
203
+ 1. Submit the GitHub (or npm) package to [Glama](https://glama.ai) MCP directory
204
+ 2. Link README + tools list; keep env docs in sync
205
+
206
+ ---
207
+
208
+ ## License
209
+
210
+ MIT
@@ -0,0 +1,29 @@
1
+ /**
2
+ * HTTP client for AgentSearch search + extract backends.
3
+ * Modes: direct (local/self-hosted) | portal (Pocket agent portal).
4
+ */
5
+ export type AgentSearchMode = "direct" | "portal";
6
+ export interface AgentSearchConfig {
7
+ mode: AgentSearchMode;
8
+ baseUrl: string;
9
+ apiKey?: string;
10
+ }
11
+ export interface SearchRequest {
12
+ query: string;
13
+ max_results: number;
14
+ }
15
+ export interface ExtractRequest {
16
+ url: string;
17
+ formats?: string[];
18
+ max_chars?: number;
19
+ }
20
+ export declare class AgentSearchHttpError extends Error {
21
+ readonly status: number;
22
+ readonly body: string;
23
+ readonly paymentRequired: boolean;
24
+ constructor(status: number, body: string);
25
+ }
26
+ export declare function loadConfig(): AgentSearchConfig;
27
+ export declare function webSearch(cfg: AgentSearchConfig, req: SearchRequest): Promise<unknown>;
28
+ export declare function extractPage(cfg: AgentSearchConfig, req: ExtractRequest): Promise<unknown>;
29
+ export declare function clampMaxResults(n: number | undefined, fallback?: number): number;
package/dist/client.js ADDED
@@ -0,0 +1,93 @@
1
+ /**
2
+ * HTTP client for AgentSearch search + extract backends.
3
+ * Modes: direct (local/self-hosted) | portal (Pocket agent portal).
4
+ */
5
+ export class AgentSearchHttpError extends Error {
6
+ status;
7
+ body;
8
+ paymentRequired;
9
+ constructor(status, body) {
10
+ const paymentRequired = status === 402;
11
+ super(paymentRequired
12
+ ? `AgentSearch portal returned 402 Payment Required (x402). Use AGENTSEARCH_MODE=direct with a local/self-hosted AgentSearch API, or complete portal payment.`
13
+ : `AgentSearch HTTP ${status}: ${body.slice(0, 500)}`);
14
+ this.name = "AgentSearchHttpError";
15
+ this.status = status;
16
+ this.body = body;
17
+ this.paymentRequired = paymentRequired;
18
+ }
19
+ }
20
+ const PORTAL_SEARCH_URL = "https://agent.pocket.network/v1/agentsearch-web-search-v1/v1/search";
21
+ export function loadConfig() {
22
+ const rawMode = (process.env.AGENTSEARCH_MODE ?? "direct").trim().toLowerCase();
23
+ const mode = rawMode === "portal" ? "portal" : "direct";
24
+ const baseUrl = (process.env.AGENTSEARCH_BASE_URL ?? "http://127.0.0.1:8000").replace(/\/+$/, "");
25
+ const apiKey = process.env.AGENTSEARCH_API_KEY?.trim() || undefined;
26
+ return { mode, baseUrl, apiKey };
27
+ }
28
+ function searchUrl(cfg) {
29
+ if (cfg.mode === "portal")
30
+ return PORTAL_SEARCH_URL;
31
+ return `${cfg.baseUrl}/v1/search`;
32
+ }
33
+ function extractUrl(cfg) {
34
+ // Extract is only defined for direct in this package; portal extract may differ.
35
+ return `${cfg.baseUrl}/v1/extract`;
36
+ }
37
+ async function postJson(url, body, apiKey, opts) {
38
+ const headers = {
39
+ "content-type": "application/json",
40
+ accept: "application/json",
41
+ };
42
+ if (apiKey) {
43
+ headers.authorization = `Bearer ${apiKey}`;
44
+ }
45
+ const res = await fetch(url, {
46
+ method: "POST",
47
+ headers,
48
+ body: JSON.stringify(body),
49
+ });
50
+ const text = await res.text();
51
+ if (res.status === 401 &&
52
+ apiKey &&
53
+ opts?.retryWithoutKeyOn401 !== false) {
54
+ // Direct mode: some deployments reject a present key; retry once without it.
55
+ return postJson(url, body, undefined, { retryWithoutKeyOn401: false });
56
+ }
57
+ if (res.status === 402) {
58
+ throw new AgentSearchHttpError(402, text);
59
+ }
60
+ if (!res.ok) {
61
+ throw new AgentSearchHttpError(res.status, text || res.statusText);
62
+ }
63
+ if (!text)
64
+ return null;
65
+ try {
66
+ return JSON.parse(text);
67
+ }
68
+ catch {
69
+ return { raw: text };
70
+ }
71
+ }
72
+ export async function webSearch(cfg, req) {
73
+ const url = searchUrl(cfg);
74
+ const key = cfg.mode === "direct" ? cfg.apiKey : undefined;
75
+ return postJson(url, { query: req.query, max_results: req.max_results }, key, { retryWithoutKeyOn401: cfg.mode === "direct" });
76
+ }
77
+ export async function extractPage(cfg, req) {
78
+ if (cfg.mode === "portal") {
79
+ throw new Error("agentsearch_extract is only supported in AGENTSEARCH_MODE=direct (POST {BASE}/v1/extract). Switch to direct mode or call search only.");
80
+ }
81
+ const url = extractUrl(cfg);
82
+ const body = { url: req.url };
83
+ if (req.formats)
84
+ body.formats = req.formats;
85
+ if (req.max_chars !== undefined)
86
+ body.max_chars = req.max_chars;
87
+ return postJson(url, body, cfg.apiKey, { retryWithoutKeyOn401: true });
88
+ }
89
+ export function clampMaxResults(n, fallback = 5) {
90
+ const v = typeof n === "number" && Number.isFinite(n) ? Math.trunc(n) : fallback;
91
+ return Math.min(10, Math.max(1, v));
92
+ }
93
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,MAAM,CAAS;IACf,IAAI,CAAS;IACb,eAAe,CAAU;IAElC,YAAY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AAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACjF,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * AgentSearch MCP server — stdio transport.
4
+ * Tools: agentsearch_web_search, agentsearch_extract
5
+ */
6
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * AgentSearch MCP server — stdio transport.
4
+ * Tools: agentsearch_web_search, agentsearch_extract
5
+ */
6
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
8
+ import { registerSearchTools } from "./tools/search.js";
9
+ import { loadConfig } from "./client.js";
10
+ async function main() {
11
+ const cfg = loadConfig();
12
+ const server = new McpServer({
13
+ name: "agentsearch-mcp",
14
+ version: "1.0.0",
15
+ });
16
+ registerSearchTools(server);
17
+ const transport = new StdioServerTransport();
18
+ await server.connect(transport);
19
+ // stdout is reserved for MCP JSON-RPC; log to stderr only
20
+ console.error(`agentsearch-mcp listening on stdio (mode=${cfg.mode}, base=${cfg.baseUrl})`);
21
+ }
22
+ main().catch((err) => {
23
+ console.error("agentsearch-mcp failed to start:", err);
24
+ process.exit(1);
25
+ });
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,KAAK,UAAU,IAAI;IACjB,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAE5B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,0DAA0D;IAC1D,OAAO,CAAC,KAAK,CACX,4CAA4C,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,OAAO,GAAG,CAC7E,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;IACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerSearchTools(server: McpServer): void;
@@ -0,0 +1,114 @@
1
+ import { z } from "zod";
2
+ import { AgentSearchHttpError, clampMaxResults, loadConfig, webSearch, extractPage, } from "../client.js";
3
+ function formatResult(data) {
4
+ try {
5
+ return JSON.stringify(data, null, 2);
6
+ }
7
+ catch {
8
+ return String(data);
9
+ }
10
+ }
11
+ function errorContent(err) {
12
+ let text;
13
+ if (err instanceof AgentSearchHttpError) {
14
+ text = err.message;
15
+ }
16
+ else if (err instanceof Error) {
17
+ text = err.message;
18
+ }
19
+ else {
20
+ text = String(err);
21
+ }
22
+ return {
23
+ content: [{ type: "text", text }],
24
+ isError: true,
25
+ };
26
+ }
27
+ const WEB_SEARCH_DESCRIPTION = [
28
+ "Search the web through AgentSearch and return the backend response as pretty-printed JSON text (a non-JSON body is wrapped as {raw: text}).",
29
+ "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.",
30
+ "Works in AGENTSEARCH_MODE=direct (default; POST {AGENTSEARCH_BASE_URL}/v1/search) or portal (Pocket).",
31
+ "Read-only HTTP POST: not destructive, but it uses the network and can hit backend rate limits.",
32
+ "Direct mode sends a Bearer token from AGENTSEARCH_API_KEY when that variable is set, and retries once without the key on HTTP 401; portal ignores the key, and HTTP 402 is an MCP error that x402 payment is required (or switch to direct).",
33
+ "Other HTTP failures are MCP errors with the status and a truncated body.",
34
+ "Integers for max_results outside 1–10 are clamped (default 5), not rejected.",
35
+ ].join(" ");
36
+ const EXTRACT_DESCRIPTION = [
37
+ "Extract the content of one absolute URL through AgentSearch 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.",
39
+ "Direct mode only: AGENTSEARCH_MODE=portal fails immediately with an MCP error telling you to switch to direct or call search, and no HTTP request is sent; direct mode 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; HTTP 402 is an MCP error that x402 payment is required (or switch to direct), and any other 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.',
43
+ ].join(" ");
44
+ export function registerSearchTools(server) {
45
+ server.registerTool("agentsearch_web_search", {
46
+ title: "AgentSearch Web Search",
47
+ description: WEB_SEARCH_DESCRIPTION,
48
+ inputSchema: {
49
+ query: z
50
+ .string()
51
+ .min(1)
52
+ .describe("Keywords or a natural-language question to search for."),
53
+ max_results: z
54
+ .number()
55
+ .int()
56
+ .optional()
57
+ .describe("How many hits to request (1–10, default 5)."),
58
+ },
59
+ }, 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
+ }
79
+ });
80
+ server.registerTool("agentsearch_extract", {
81
+ title: "AgentSearch Extract",
82
+ description: EXTRACT_DESCRIPTION,
83
+ inputSchema: {
84
+ url: z.string().url().describe("Absolute URL of the page to extract."),
85
+ formats: z
86
+ .array(z.string())
87
+ .optional()
88
+ .describe('Optional format names to request, e.g. ["markdown","text"].'),
89
+ max_chars: z
90
+ .number()
91
+ .int()
92
+ .positive()
93
+ .optional()
94
+ .describe("Optional positive limit on extracted characters."),
95
+ },
96
+ }, 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
+ }
112
+ });
113
+ }
114
+ //# sourceMappingURL=search.js.map
@@ -0,0 +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,SAAS,YAAY,CAAC,IAAa;IACjC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC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AAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC;qBACzB;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
package/manifest.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "manifest_version": "0.3",
3
+ "name": "agentsearch-mcp",
4
+ "display_name": "AgentSearch MCP",
5
+ "version": "1.0.0",
6
+ "description": "MCP server for AgentSearch web search and optional page extract (direct API or Pocket portal).",
7
+ "long_description": "Stdio MCP server that calls AgentSearch web search and, in direct mode, URL extract. Configure AGENTSEARCH_MODE (direct or portal), AGENTSEARCH_BASE_URL, and an optional AGENTSEARCH_API_KEY.",
8
+ "author": {
9
+ "name": "AgentSearch",
10
+ "url": "https://github.com/agentsearchhq-coder"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/agentsearchhq-coder/agentsearch-mcp"
15
+ },
16
+ "homepage": "https://agentsearchhq.com",
17
+ "documentation": "https://github.com/agentsearchhq-coder/agentsearch-mcp#readme",
18
+ "support": "https://github.com/agentsearchhq-coder/agentsearch-mcp/issues",
19
+ "license": "MIT",
20
+ "keywords": [
21
+ "mcp",
22
+ "agentsearch",
23
+ "web-search",
24
+ "pocket-network"
25
+ ],
26
+ "compatibility": {
27
+ "platforms": ["darwin", "win32", "linux"],
28
+ "runtimes": {
29
+ "node": ">=20"
30
+ }
31
+ },
32
+ "server": {
33
+ "type": "node",
34
+ "entry_point": "dist/index.js",
35
+ "mcp_config": {
36
+ "command": "node",
37
+ "args": ["${__dirname}/dist/index.js"],
38
+ "env": {
39
+ "AGENTSEARCH_MODE": "${user_config.AGENTSEARCH_MODE}",
40
+ "AGENTSEARCH_BASE_URL": "${user_config.AGENTSEARCH_BASE_URL}",
41
+ "AGENTSEARCH_API_KEY": "${user_config.AGENTSEARCH_API_KEY}"
42
+ }
43
+ }
44
+ },
45
+ "tools": [
46
+ {
47
+ "name": "agentsearch_web_search",
48
+ "description": "Search the web via AgentSearch (direct or Pocket portal) and return JSON text. Use extract when you already have a URL. Read-only."
49
+ },
50
+ {
51
+ "name": "agentsearch_extract",
52
+ "description": "Extract one page from a URL (direct mode only). Use web search to find URLs. Read-only; returns JSON text."
53
+ }
54
+ ],
55
+ "user_config": {
56
+ "AGENTSEARCH_MODE": {
57
+ "type": "string",
58
+ "title": "AgentSearch mode",
59
+ "description": "direct (local or self-hosted API) or portal (Pocket Network). Default direct.",
60
+ "default": "direct",
61
+ "required": false
62
+ },
63
+ "AGENTSEARCH_BASE_URL": {
64
+ "type": "string",
65
+ "title": "AgentSearch base URL",
66
+ "description": "Base URL for direct mode, without a trailing slash.",
67
+ "default": "http://127.0.0.1:8000",
68
+ "required": false
69
+ },
70
+ "AGENTSEARCH_API_KEY": {
71
+ "type": "string",
72
+ "title": "AgentSearch API key",
73
+ "description": "Optional Bearer token for direct mode. Leave blank if the API does not require a key.",
74
+ "sensitive": true,
75
+ "required": false
76
+ }
77
+ }
78
+ }
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@agentsearchhq/agentsearch-mcp",
3
+ "version": "1.0.0",
4
+ "mcpName": "io.github.agentsearchhq-coder/agentsearch-mcp",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "description": "MCP server for AgentSearch web search (and optional extract) — direct or Pocket portal",
9
+ "type": "module",
10
+ "main": "dist/index.js",
11
+ "bin": {
12
+ "agentsearch-mcp": "dist/index.js"
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ ".env.example",
18
+ "server.json",
19
+ "smithery.yaml",
20
+ "manifest.json",
21
+ ".mcpbignore"
22
+ ],
23
+ "scripts": {
24
+ "build": "tsc -p tsconfig.json",
25
+ "start": "node dist/index.js",
26
+ "prepare": "npm run build",
27
+ "typecheck": "tsc -p tsconfig.json --noEmit",
28
+ "mcpb:validate": "mcpb validate manifest.json",
29
+ "mcpb:pack": "npm run build && node scripts/pack-mcpb.mjs",
30
+ "smithery:publish": "node scripts/publish-smithery.mjs"
31
+ },
32
+ "engines": {
33
+ "node": ">=20"
34
+ },
35
+ "keywords": [
36
+ "mcp",
37
+ "model-context-protocol",
38
+ "agentsearch",
39
+ "web-search",
40
+ "pocket-network"
41
+ ],
42
+ "license": "MIT",
43
+ "dependencies": {
44
+ "@modelcontextprotocol/sdk": "^1.18.0",
45
+ "zod": "^3.24.0"
46
+ },
47
+ "devDependencies": {
48
+ "@anthropic-ai/mcpb": "^2.1.2",
49
+ "@types/node": "^22.10.0",
50
+ "typescript": "^5.7.0"
51
+ }
52
+ }
package/server.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.agentsearchhq-coder/agentsearch-mcp",
4
+ "description": "AgentSearch web search (and optional page extract) via MCP stdio. Direct local API or Pocket portal.",
5
+ "repository": {
6
+ "url": "https://github.com/agentsearchhq-coder/agentsearch-mcp",
7
+ "source": "github"
8
+ },
9
+ "version": "1.0.0",
10
+ "packages": [
11
+ {
12
+ "registryType": "npm",
13
+ "identifier": "@agentsearchhq/agentsearch-mcp",
14
+ "version": "1.0.0",
15
+ "transport": {
16
+ "type": "stdio"
17
+ },
18
+ "environmentVariables": [
19
+ {
20
+ "name": "AGENTSEARCH_MODE",
21
+ "description": "direct | portal (default direct)",
22
+ "isRequired": false,
23
+ "format": "string"
24
+ },
25
+ {
26
+ "name": "AGENTSEARCH_BASE_URL",
27
+ "description": "Base URL for direct mode (default http://127.0.0.1:8000)",
28
+ "isRequired": false,
29
+ "format": "string"
30
+ },
31
+ {
32
+ "name": "AGENTSEARCH_API_KEY",
33
+ "description": "Optional Bearer token for direct mode",
34
+ "isRequired": false,
35
+ "isSecret": true,
36
+ "format": "string"
37
+ }
38
+ ]
39
+ }
40
+ ]
41
+ }
package/smithery.yaml ADDED
@@ -0,0 +1,30 @@
1
+ # Smithery.ai publish metadata for agentsearch-mcp
2
+ startCommand:
3
+ type: stdio
4
+ configSchema:
5
+ type: object
6
+ properties:
7
+ agentsearchMode:
8
+ type: string
9
+ enum: [direct, portal]
10
+ default: direct
11
+ description: direct local API or Pocket portal
12
+ agentsearchBaseUrl:
13
+ type: string
14
+ default: http://127.0.0.1:8000
15
+ description: Base URL for direct mode
16
+ agentsearchApiKey:
17
+ type: string
18
+ description: Optional Bearer token for direct mode
19
+ commandFunction: |-
20
+ (config) => ({
21
+ command: 'node',
22
+ args: ['dist/index.js'],
23
+ env: {
24
+ AGENTSEARCH_MODE: config.agentsearchMode ?? 'direct',
25
+ AGENTSEARCH_BASE_URL: config.agentsearchBaseUrl ?? 'http://127.0.0.1:8000',
26
+ ...(config.agentsearchApiKey
27
+ ? { AGENTSEARCH_API_KEY: config.agentsearchApiKey }
28
+ : {})
29
+ }
30
+ })