desearch-mcp-server 0.2.2 → 0.2.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.4
4
+
5
+ `people-search` is marked destructive because it spends the user's Desearch balance.
6
+
7
+ `readOnlyHint` stays false and `openWorldHint` stays true. `destructiveHint` is now true. The tool description states that it starts a paid job billed to the user's Desearch balance. `people-search-control` stays `destructiveHint: true`. Lookup tools, including `search` and `fetch`, stay read-only.
8
+
9
+ ## 0.2.3
10
+
11
+ The sign-in form works in a browser.
12
+
13
+ The page used `no-referrer`, so a browser posted `Origin: null` and no `Referer`. The server treated that as a cross-site submit even when `Sec-Fetch-Site` was `same-origin`. The form also omitted `response_type`, so the post redirected with `unsupported_response_type`. `Content-Security-Policy: form-action 'self'` can block the redirect to the client callback.
14
+
15
+ The form now includes hidden `response_type=code` plus `client_id`, `redirect_uri`, `state`, `code_challenge`, `code_challenge_method`, `scope`, and `resource`. The referrer policy is `same-origin`. A post with `Sec-Fetch-Site: same-origin` is accepted when `Origin` is missing or `null`. `cross-site` and `same-site` posts, and foreign origins, are still rejected. A post with no origin signal is still rejected. The page `form-action` allows the validated callback origin.
16
+
3
17
  ## 0.2.2
4
18
 
5
19
  OAuth discovery and sign-in answer on the rewritten `/api/*` paths as well as the public paths.
package/README.md CHANGED
@@ -57,7 +57,7 @@ AI search, X search and web search for AI agents, plus page extraction, X data t
57
57
 
58
58
  The Desearch MCP server includes the following tools.
59
59
 
60
- Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destructiveHint: false`, and `openWorldHint: true`. `people-search` starts a billed background job, so `readOnlyHint` is false and `destructiveHint` is false. `people-search-control` can cancel a search, so `readOnlyHint` is false and `destructiveHint` is true. `openWorldHint` is true on every tool because the call reaches a live external source.
60
+ Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destructiveHint: false`, and `openWorldHint: true`. `people-search` starts a paid job billed to the user's Desearch balance, so `readOnlyHint` is false and `destructiveHint` is true. `people-search-control` can cancel a search, so `readOnlyHint` is false and `destructiveHint` is true. `openWorldHint` is true on every tool because the call reaches a live external source.
61
61
 
62
62
  - **AI Search** (`ai-search`): Performs AI Twitter and web searches with relevant links and summary. `tools` uses short source ids (`web`, `twitter`, `arxiv`, `wikipedia`, `hackernews`, `reddit`). Older labels such as `Web Search`, `ArXiv Search`, `Wikipedia Search`, `Hacker News Search`, and `Reddit Search` are still accepted and sent as the short id. `youtube` is not accepted. Default is `["web", "twitter"]`.
63
63
  - **X Search** (`x-search`): Tweet search on X. Arguments: `query` (required), `count` (optional, default 20). Sort stays Top. Optional filters: `user`, `start_date`, `end_date` (YYYY-MM-DD), `lang`, `verified`, `blue_verified`, `is_quote`, `is_video`, `is_image`, `min_retweets`, `min_replies`, `min_likes`.
@@ -76,7 +76,7 @@ Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destruc
76
76
  - **X User Replies** (`x-user-replies`): Posts and replies by a user. Arguments: `user` (required), `count` (optional, 1–100), `query` (optional).
77
77
  - **X Post Replies** (`x-post-replies`): Replies to a post. Arguments: `post_id` (required), `count` (optional, 1–100), `query` (optional).
78
78
  - **X Trends** (`x-trends`): Trending topics for a location. Arguments: `woeid` (required), `count` (optional, 30–100).
79
- - **People Search** (`people-search`): Start a search for people who match a plain-language description. **Billed.** Arguments: `platform` (required: `x`, `youtube`, `linkedin`, or `tiktok`), `query` (required, 3–1000 characters), `count` (optional, 5–200, API default 25), `min_score` (optional, 0–100), `exclude` (optional handles), `idempotency_key` (optional), and that platform's filters (below). Returns the `task_id`, status, and `reserved_cost_usd`.
79
+ - **People Search** (`people-search`): Start a paid job billed to the user's Desearch balance: a search for people who match a plain-language description. Arguments: `platform` (required: `x`, `youtube`, `linkedin`, or `tiktok`), `query` (required, 3–1000 characters), `count` (optional, 5–200, API default 25), `min_score` (optional, 0–100), `exclude` (optional handles), `idempotency_key` (optional), and that platform's filters (below). Returns the `task_id`, status, and `reserved_cost_usd`.
80
80
  - **People Search Status** (`people-search-status`): A task's status, progress, and cost, plus a page of the people found so far. Arguments: `task_id` (required), `cursor` (optional, `next_cursor` from the previous call), `limit` (optional, 1–100, default 25), `include_people` (optional, default `true`). Free.
81
81
  - **Control People Search** (`people-search-control`): Pause, resume, or cancel a task. Arguments: `task_id` (required), `action` (required: `pause`, `resume`, or `cancel`). Free.
82
82
  - **List People Search Tasks** (`people-search-tasks`): Your searches, newest first. Arguments: `platform` (optional), `status` (optional list, for example `["running", "paused"]`), `limit` (optional, 1–100), `cursor` (optional). Free.
@@ -90,7 +90,7 @@ People Search finds X profiles, YouTube creators, LinkedIn members, or TikTok cr
90
90
 
91
91
  A search is a background task:
92
92
 
93
- 1. `people-search` starts it and returns a `task_id` at once. It is the only billed People Search call. It reserves `count` people at the platform's per-person price (`reserved_cost_usd`). When the search ends you pay only for the people it delivered (a per-search minimum applies when it finds anyone; a search that finds no one is free), and the rest of the reservation is returned. Send the same `idempotency_key` to retry a call without starting, or paying for, a second search.
93
+ 1. `people-search` starts a paid job billed to the user's Desearch balance and returns a `task_id` at once. It is the only billed People Search call. It reserves `count` people at the platform's per-person price (`reserved_cost_usd`). When the search ends you pay only for the people it delivered (a per-search minimum applies when it finds anyone; a search that finds no one is free), and the rest of the reservation is returned. Send the same `idempotency_key` to retry a call without starting, or paying for, a second search.
94
94
  2. The search usually runs for 1 to 5 minutes. `people-search-status` returns its status, progress, cost, and the people found so far. People arrive while it runs: pass `next_cursor` back as `cursor` to get only the new ones. When `done` is `true` and `has_more` is `false`, you have everyone it found.
95
95
  3. `people-search-control` pauses, resumes, or cancels it. A cancelled search bills only the people it already delivered.
96
96
 
@@ -475,7 +475,7 @@ Environment variables for the host:
475
475
 
476
476
  The key check calls `GET /twitter/trends?woeid=1&count=1`. A real key is authenticated and then rejected as invalid input (HTTP 422), so the check does not run a full trends query. Only 422 counts as a valid key. `401` and `403` reject the key. Any other status, including a 2xx, is a verification error and is not treated as valid.
477
477
 
478
- `POST /register` allows 10 requests an hour per IP. The sign-in key check allows 20 requests every 10 minutes per IP. A request past the limit returns 429 with `Retry-After`. On Vercel the address is the first `X-Forwarded-For` hop. The sign-in form accepts a same-origin `Origin` or `Referer`, and rejects a POST that sends none of `Origin`, `Referer`, and `Sec-Fetch-Site`.
478
+ `POST /register` allows 10 requests an hour per IP. The sign-in key check allows 20 requests every 10 minutes per IP. A request past the limit returns 429 with `Retry-After`. On Vercel the address is the first `X-Forwarded-For` hop. The sign-in page uses `Referrer-Policy: same-origin` and posts `response_type=code` with the other authorize fields. The form accepts a same-origin `Origin` or `Referer`, and accepts `Sec-Fetch-Site: same-origin` when `Origin` is missing or `null`. It rejects `Sec-Fetch-Site` `cross-site` and `same-site`, a foreign `Origin`, and a POST that has no origin signal.
479
479
 
480
480
  ### Use with Claude (custom connector)
481
481
 
@@ -1,4 +1,4 @@
1
- export declare function htmlResponse(status: number, html: string): Response;
1
+ export declare function htmlResponse(status: number, html: string, redirectUri?: string): Response;
2
2
  export declare function oauthError(status: number, error: string, description: string): Response;
3
3
  export declare function registerClient(request: Request): Promise<Response>;
4
4
  export declare function showAuthorize(request: Request): Promise<Response>;
@@ -1 +1 @@
1
- {"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../oauth/flow.ts"],"names":[],"mappings":"AAqCA,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAEnE;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,QAAQ,CAQvF;AAyDD,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqFxE;AAwFD,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAOvE;AAgCD,wBAAsB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CA0DzE;AAgED,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAmBvE;AAoDD,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAUhG"}
1
+ {"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../oauth/flow.ts"],"names":[],"mappings":"AAuDA,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,QAAQ,CAQzF;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,QAAQ,CAQvF;AAyDD,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqFxE;AAwFD,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAOvE;AAmCD,wBAAsB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CA0DzE;AAgED,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAmBvE;AAoDD,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAUhG"}
@@ -9,12 +9,37 @@ const VERIFIER_PATTERN = /^[A-Za-z0-9\-._~]{43,128}$/;
9
9
  const HTML_HEADERS = {
10
10
  "Content-Type": "text/html; charset=utf-8",
11
11
  "Cache-Control": "no-store",
12
- "Referrer-Policy": "no-referrer",
12
+ "Referrer-Policy": "same-origin",
13
13
  "X-Frame-Options": "DENY",
14
- "Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; form-action 'self'; base-uri 'none'; frame-ancestors 'none'",
15
14
  };
16
- export function htmlResponse(status, html) {
17
- return new Response(html, { status, headers: HTML_HEADERS });
15
+ /**
16
+ * `form-action 'self'` blocks the 302 that follows a form POST in Chrome, so
17
+ * the sign-in page also allows the validated callback origin (claude.ai,
18
+ * chatgpt.com, or the loopback host and port).
19
+ */
20
+ function contentSecurityPolicy(redirectUri) {
21
+ const targets = ["'self'"];
22
+ if (redirectUri && isAllowedRedirectUri(redirectUri)) {
23
+ try {
24
+ const origin = new URL(redirectUri).origin;
25
+ if (/^https?:\/\/[A-Za-z0-9.\[\]:-]+$/.test(origin)) {
26
+ targets.push(origin);
27
+ }
28
+ }
29
+ catch {
30
+ // The redirect was already rejected before a page is rendered.
31
+ }
32
+ }
33
+ return `default-src 'none'; style-src 'unsafe-inline'; form-action ${targets.join(" ")}; base-uri 'none'; frame-ancestors 'none'`;
34
+ }
35
+ export function htmlResponse(status, html, redirectUri) {
36
+ return new Response(html, {
37
+ status,
38
+ headers: {
39
+ ...HTML_HEADERS,
40
+ "Content-Security-Policy": contentSecurityPolicy(redirectUri),
41
+ },
42
+ });
18
43
  }
19
44
  export function oauthError(status, error, description) {
20
45
  return new Response(JSON.stringify({ error, error_description: description }), {
@@ -209,16 +234,19 @@ export async function showAuthorize(request) {
209
234
  if (context instanceof Response) {
210
235
  return context;
211
236
  }
212
- return htmlResponse(200, authorizePage(context.fields));
237
+ return htmlResponse(200, authorizePage(context.fields), context.fields.redirectUri);
213
238
  }
214
239
  function authorizePostForbidden(request) {
215
240
  const fetchSite = request.headers.get("sec-fetch-site")?.trim().toLowerCase() ?? "";
216
- if (fetchSite === "cross-site") {
241
+ if (fetchSite === "cross-site" || fetchSite === "same-site") {
217
242
  return htmlResponse(400, messagePage("Connect Desearch", "This sign-in form was sent from another site."));
218
243
  }
219
244
  const expected = publicOrigin(request);
220
- const origin = request.headers.get("origin")?.trim();
221
- if (origin) {
245
+ const origin = request.headers.get("origin")?.trim() ?? "";
246
+ // `no-referrer` made browsers send the literal Origin "null". Treat that
247
+ // as a missing origin. A same-origin Sec-Fetch-Site is enough on its own.
248
+ const originMissing = origin.length === 0 || origin.toLowerCase() === "null";
249
+ if (!originMissing) {
222
250
  if (origin.replace(/\/+$/, "") !== expected) {
223
251
  return htmlResponse(400, messagePage("Connect Desearch", "This sign-in form was sent from another site."));
224
252
  }
@@ -236,10 +264,10 @@ function authorizePostForbidden(request) {
236
264
  }
237
265
  return null;
238
266
  }
239
- if (!fetchSite) {
240
- return htmlResponse(403, messagePage("Connect Desearch", "This sign-in form did not come from this site."));
267
+ if (fetchSite === "same-origin") {
268
+ return null;
241
269
  }
242
- return null;
270
+ return htmlResponse(403, messagePage("Connect Desearch", "This sign-in form did not come from this site."));
243
271
  }
244
272
  export async function submitAuthorize(request) {
245
273
  const forbidden = authorizePostForbidden(request);
@@ -274,7 +302,7 @@ export async function submitAuthorize(request) {
274
302
  const apiKey = (form.get("api_key") ?? "").trim();
275
303
  const checked = await checkDesearchApiKey(apiKey);
276
304
  if (!checked.ok) {
277
- return htmlResponse(400, authorizePage({ ...fields, error: checked.message }));
305
+ return htmlResponse(400, authorizePage({ ...fields, error: checked.message }), fields.redirectUri);
278
306
  }
279
307
  const code = randomToken(AUTH_CODE_PREFIX, 32);
280
308
  const store = await getOAuthStore();
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../oauth/page.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAkEjE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAqBlE"}
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../oauth/page.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAmEjE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAqBlE"}
@@ -13,6 +13,7 @@ export function authorizePage(fields) {
13
13
  ? `<p class="error" role="alert">${escapeHtml(fields.error)}</p>`
14
14
  : "";
15
15
  const hidden = [
16
+ ["response_type", "code"],
16
17
  ["client_id", fields.clientId],
17
18
  ["redirect_uri", fields.redirectUri],
18
19
  ["state", fields.state],
@@ -28,7 +29,7 @@ export function authorizePage(fields) {
28
29
  <head>
29
30
  <meta charset="utf-8">
30
31
  <meta name="viewport" content="width=device-width, initial-scale=1">
31
- <meta name="referrer" content="no-referrer">
32
+ <meta name="referrer" content="same-origin">
32
33
  <meta name="robots" content="noindex">
33
34
  <title>Connect Desearch</title>
34
35
  <style>
@@ -74,7 +75,7 @@ export function messagePage(title, message) {
74
75
  <head>
75
76
  <meta charset="utf-8">
76
77
  <meta name="viewport" content="width=device-width, initial-scale=1">
77
- <meta name="referrer" content="no-referrer">
78
+ <meta name="referrer" content="same-origin">
78
79
  <meta name="robots" content="noindex">
79
80
  <title>${escapeHtml(title)}</title>
80
81
  <style>
package/build/server.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { type PeopleClient } from "./people.js";
3
3
  export declare const SERVER_NAME = "Desearch";
4
- export declare const SERVER_VERSION = "0.2.2";
4
+ export declare const SERVER_VERSION = "0.2.4";
5
5
  interface XSearchPayload {
6
6
  query: string;
7
7
  sort?: "Top" | "Latest";
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE,OAAO,EAaH,KAAK,YAAY,EACpB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,UAAU,cAAc;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,SAAS,CAAC,E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E,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1F,YAAY,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7F,OAAO,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,OAAO,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3D;AAkID;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAuCvD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAYzD;AAgJD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,cAAc,EACvB,YAAY,CAAC,EAAE,YAAY,GAC5B,SAAS,CAiyBX"}
package/build/server.js CHANGED
@@ -5,7 +5,7 @@ import { z } from "zod";
5
5
  import { PEOPLE_CONTROL_ACTIONS, PEOPLE_FILTER_CHANNELS, PEOPLE_PLATFORMS, PEOPLE_PROFILE_SORTS, PEOPLE_SEARCH_FILTERS, PEOPLE_TASK_STATUSES, controlPeopleTask, createPeopleClient, listPeopleProfiles, listPeopleTasks, readPeopleStatus, startPeopleSearch, } from "./people.js";
6
6
  import { AI_SEARCH_TOOLS, WEB_LINK_TOOLS, toolIdSchema } from "./tool-sources.js";
7
7
  export const SERVER_NAME = "Desearch";
8
- export const SERVER_VERSION = "0.2.2";
8
+ export const SERVER_VERSION = "0.2.4";
9
9
  // desearch-js 1.5 publishes a default class. Node16 resolution types that package
10
10
  // as a module namespace, so the constructor is applied through a cast.
11
11
  const Desearch = DesearchImport;
@@ -21,12 +21,13 @@ const READ_ONLY_OPEN_WORLD = {
21
21
  openWorldHint: true,
22
22
  };
23
23
  /**
24
- * `people-search` creates a billed background task. Calling it again starts
25
- * (and reserves) another search unless the same idempotency_key is sent.
24
+ * `people-search` starts a paid job billed to the user's Desearch balance.
25
+ * Spending that balance is irreversible, so destructiveHint is true.
26
+ * Calling it again starts (and reserves) another search unless the same idempotency_key is sent.
26
27
  */
27
28
  const BILLED_TASK = {
28
29
  readOnlyHint: false,
29
- destructiveHint: false,
30
+ destructiveHint: true,
30
31
  idempotentHint: false,
31
32
  openWorldHint: true,
32
33
  };
@@ -285,7 +286,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient) {
285
286
  name: SERVER_NAME,
286
287
  version: SERVER_VERSION,
287
288
  }, {
288
- instructions: "Search the public web and X with Desearch. Use search for titles and links, then fetch with a result URL to read the page. Other tools cover AI search, X posts, and page extraction. People Search finds people and creators on X, YouTube, LinkedIn, and TikTok: people-search starts a billed search, people-search-status reads progress, and people-search-control can pause, resume, or cancel it. Calls need a Desearch API key.",
289
+ instructions: "Search the public web and X with Desearch. Use search for titles and links, then fetch with a result URL to read the page. Other tools cover AI search, X posts, and page extraction. People Search finds people and creators on X, YouTube, LinkedIn, and TikTok: people-search starts a paid job billed to the user's Desearch balance, people-search-status reads progress, and people-search-control can pause, resume, or cancel it. Calls need a Desearch API key.",
289
290
  });
290
291
  registerTool(server, apiKey, "ai-search", "AI Search", "AI search and analysis on web using Desearch AI", {
291
292
  prompt: z.string().describe("Question, example: 'What is the latest news on AI?'"),
@@ -619,7 +620,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient) {
619
620
  url: z.string(),
620
621
  metadata: z.record(z.string(), z.string()).optional(),
621
622
  });
622
- registerTool(server, apiKey, "people-search", "People Search", "Start a People Search: find people on X, YouTube, LinkedIn, or TikTok who match a plain-language description. Each person comes back with a fit score, why they matched, their audience, and public contacts and links. Billed and asynchronous: this call reserves count times the platform's per-person price (reserved_cost_usd) and returns a task_id at once. When the search ends you pay only for the people it delivered (a per-search minimum applies when it finds anyone; a search that finds no one is free) and the rest of the reservation is returned. The search runs in the background, usually for 1 to 5 minutes: poll people-search-status with the task_id to read progress and the people found so far, and use people-search-control to pause, resume, or cancel it. Do not start the same search twice; send idempotency_key so a retry returns the first task instead of charging again. Filters depend on the platform. " +
623
+ registerTool(server, apiKey, "people-search", "People Search", "Start a paid job billed to the user's Desearch balance: find people on X, YouTube, LinkedIn, or TikTok who match a plain-language description. Each person comes back with a fit score, why they matched, their audience, and public contacts and links. This call reserves count times the platform's per-person price (reserved_cost_usd) and returns a task_id at once. When the search ends you pay only for the people it delivered (a per-search minimum applies when it finds anyone; a search that finds no one is free) and the rest of the reservation is returned. The search runs in the background, usually for 1 to 5 minutes: poll people-search-status with the task_id to read progress and the people found so far, and use people-search-control to pause, resume, or cancel it. Do not start the same search twice; send idempotency_key so a retry returns the first task instead of charging again. Filters depend on the platform. " +
623
624
  platformFilterList() +
624
625
  ".", strictArgs({
625
626
  platform: peoplePlatform.describe("Where to look: 'x' (X profiles), 'youtube' (YouTube creators), 'linkedin' (LinkedIn members), or 'tiktok' (TikTok creators)."),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "desearch-mcp-server",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "mcpName": "io.github.Desearch-ai/mcp-desearch",
5
5
  "description": "AI search (web, Reddit, Hacker News, arXiv, Wikipedia, and Twitter), X (Twitter) search, web search, page extraction, X data, and People Search (find people and creators on X, YouTube, LinkedIn, and TikTok) tools for AI agents.",
6
6
  "license": "MIT",