desearch-mcp-server 0.12.0 → 0.13.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/CHANGELOG.md +13 -0
- package/README.md +5 -2
- package/build/desearch-api.d.ts +1 -1
- package/build/desearch-api.js +1 -1
- package/build/http.d.ts.map +1 -1
- package/build/http.js +21 -5
- package/build/oauth/redirects.d.ts.map +1 -1
- package/build/oauth/redirects.js +8 -0
- package/build/server.d.ts +2 -2
- package/build/server.d.ts.map +1 -1
- package/build/server.js +11 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.0
|
|
4
|
+
|
|
5
|
+
Balance: one new tool (52 in total) for `GET /desearch/balance` (desearch-public-api `docs/balance.md`).
|
|
6
|
+
|
|
7
|
+
| Tool | Route | Billed |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `balance` | `GET /desearch/balance` | Free. |
|
|
10
|
+
|
|
11
|
+
- `balance` takes no arguments (unknown ones are refused) and returns `{ balance_usd, currency }` as the API sent it: what the account behind the key can still spend, with charges from about the last minute already subtracted and top-ups (card, TAO, Gamma) shown as soon as they are credited. It is a read-only lookup (`readOnlyHint: true`, `destructiveHint: false`).
|
|
12
|
+
- The route is not in `desearch-js` 1.5, so the tool calls it directly through `desearch-api.ts`, like Monitors. API errors read `Get Balance error: HTTP <status>: <detail>` (503 when the API cannot read the balance).
|
|
13
|
+
- Every version (package, `server.json`, the Gemini extension, the plugin manifests, and `SERVER_VERSION`) is 0.13.0, and the docs and manifest descriptions say the server exposes 52 tools.
|
|
14
|
+
- Publish after `GET /desearch/balance` is live on `api.desearch.ai`.
|
|
15
|
+
|
|
3
16
|
## 0.12.0
|
|
4
17
|
|
|
5
18
|
Monitors: twelve new tools (51 in total) for the `/desearch/monitors` routes (desearch-public-api `docs/monitors.md`). A monitor reruns a search over `web`, `x`, `reddit`, `youtube`, and `threads` on a schedule (`1h` to `7d`), drops everything it has already seen, screens the new items (relevant, new information, and one question per criterion; kept at `min_score`), and keeps the ones that pass, readable through the API and sent to a signed webhook. Monitors are not in `desearch-js` 1.5, so `monitors.ts` calls the routes directly through `desearch-api.ts`, which now also sends `PATCH` and `DELETE`.
|
package/README.md
CHANGED
|
@@ -52,13 +52,13 @@ Example output:
|
|
|
52
52
|
|
|
53
53
|
The tool returns that JSON as pretty-printed text: `{ "content": [{ "type": "text", "text": "<json above>" }] }`.
|
|
54
54
|
|
|
55
|
-
AI search, X search and web search for AI agents, plus the Search API (ranked pages with the best-matching passage), page extraction, X data tools, public TikTok, Facebook, Instagram, YouTube (videos, transcripts, comments, channels), Reddit, and Threads data, People Search (find people and creators on X, YouTube, LinkedIn, and TikTok), Company Search (find companies on the web, or enrich domains you have, with their public contacts and leaders),
|
|
55
|
+
AI search, X search and web search for AI agents, plus the Search API (ranked pages with the best-matching passage), page extraction, X data tools, public TikTok, Facebook, Instagram, YouTube (videos, transcripts, comments, channels), Reddit, and Threads data, People Search (find people and creators on X, YouTube, LinkedIn, and TikTok), Company Search (find companies on the web, or enrich domains you have, with their public contacts and leaders), Monitors (searches that rerun on a schedule over web, X, Reddit, YouTube, Threads, and TikTok, or watch chosen accounts there, and keep only new, relevant items, with a signed webhook), and your account balance. Bring your own Desearch API key. Version 0.13.0 exposes 52 tools.
|
|
56
56
|
|
|
57
57
|
## Tools
|
|
58
58
|
|
|
59
59
|
The Desearch MCP server includes the following tools.
|
|
60
60
|
|
|
61
|
-
Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destructiveHint: false`, and `openWorldHint: true`. `search-api`, `tiktok`, `facebook`, `instagram`, `youtube`, `reddit`, `threads`, `people-search-status`, `people-search-tasks`, `people-profiles`,
|
|
61
|
+
Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destructiveHint: false`, and `openWorldHint: true`. `search-api`, `tiktok`, `facebook`, `instagram`, `youtube`, `reddit`, `threads`, `people-search-status`, `people-search-tasks`, `people-profiles`, `people-search-export`, and `balance` are lookups too. `people-search` starts a paid job billed to the user's Desearch balance, so `readOnlyHint` is false; it creates a new task and does not delete or overwrite anything, so `destructiveHint` is false. `people-search-pause` and `people-search-resume` change a task's state and undo each other, so `readOnlyHint` and `destructiveHint` are false and `idempotentHint` is true. Pausing loses no data (people found so far stay readable and the search keeps its progress) and changes no billing (nothing is charged or refunded; the reservation stays until the search ends), and resume continues from where the search stopped with no new charge. The caveat: the API cancels a search paused for more than 7 days, and a cancelled search cannot be resumed, so a pause is reversible only within those 7 days. `people-search-cancel` cannot be undone, so `readOnlyHint` is false and `destructiveHint` and `idempotentHint` are true. The Company Search tools follow the same rules: `company-search` and `company-enrich` start paid jobs (`readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: false`), `company-search-status` and `company-search-tasks` are lookups, `company-search-pause` and `company-search-resume` set `destructiveHint: false` and `idempotentHint: true` (with the same 7-day caveat), and `company-search-cancel` sets `destructiveHint: true` and `idempotentHint: true`. Among the Monitors tools, `monitor-estimate`, `monitor-list`, `monitor-get`, `monitor-runs`, `monitor-run`, and `monitor-items` are lookups. `monitor-create` and `monitor-trigger` queue billed runs and delete nothing (`readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: false`). `monitor-update` overwrites settings and `monitor-delete` removes a monitor for good, so both set `destructiveHint: true` and `idempotentHint: true`. `monitor-webhook-rotate-secret` replaces the signing secret (`destructiveHint: true`, `idempotentHint: false`), and `monitor-webhook-test` sends one more delivery to your endpoint (`readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: false`). `openWorldHint` is true on every tool because the call reaches a live external source.
|
|
62
62
|
|
|
63
63
|
- **AI Search** (`ai-search`): X (Twitter) posts and web (from the Desearch index) with relevant links and an optional AI summary. Web results are capped at 20 per request; for web only, use `search-api`. `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"]`.
|
|
64
64
|
- **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`.
|
|
@@ -111,6 +111,7 @@ Lookup tools, including `search` and `fetch`, set `readOnlyHint: true`, `destruc
|
|
|
111
111
|
- **List Monitor Items** (`monitor-items`): Everything a monitor kept, newest first. Arguments: `monitor_id` (required), `source` (optional, including `tiktok`, `instagram`, `facebook`, and `meta_ads`), `limit` (optional, 1–200), `cursor` (optional). Returns `{ items, next_cursor }`. Free.
|
|
112
112
|
- **Test Monitor Webhook** (`monitor-webhook-test`): Send a signed `monitor.test` event to the monitor's webhook and report what it answered (`delivered`, `status_code`, `error`, `duration_ms`); it does not change `webhook.last_delivery`. Argument: `monitor_id` (required). Free.
|
|
113
113
|
- **Rotate Monitor Webhook Secret** (`monitor-webhook-rotate-secret`): Replace the signing secret and return the new `webhook_secret` once. Argument: `monitor_id` (required). Free.
|
|
114
|
+
- **Get Balance** (`balance`): What the Desearch account behind your API key can still spend: `{ balance_usd, currency }`. No arguments. Free, and not counted as usage. It already subtracts charges from the last minute and shows top-ups (card, TAO, Gamma) as soon as they are credited. A paid tool the balance cannot cover fails with `HTTP 402: Insufficient balance`. To keep an account funded automatically, read it on a schedule and top up below a threshold.
|
|
114
115
|
|
|
115
116
|
### Cost of each call
|
|
116
117
|
|
|
@@ -767,6 +768,8 @@ Allowed callback URLs:
|
|
|
767
768
|
- `https://claude.com/api/mcp/auth_callback`
|
|
768
769
|
- `https://chatgpt.com/connector_platform_oauth_redirect`
|
|
769
770
|
- `https://chatgpt.com/connector/oauth/{callback_id}`
|
|
771
|
+
- `https://script.google.com/macros/d/1q3nQZY0VanjPTREexH3qUWIKQd4Ghd7_yFb5ElZ8YXiWolagOSlk2j-1/usercallback` (Desearch Google Workspace add-on; this script ID only)
|
|
772
|
+
- `https://api.mcpbundles.com/oauth/callback/desearch-60432bc8` (MCPBundles Studio Connect; this callback id only)
|
|
770
773
|
- Loopback `http://localhost`, `http://127.0.0.1`, and `http://[::1]` on any port (host and path must match the registered callback)
|
|
771
774
|
|
|
772
775
|
The connector URL is `https://mcp.desearch.ai/mcp`. On the sign-in page, paste a key from [console.desearch.ai/api-keys](https://console.desearch.ai/api-keys). Leave a client id blank when the client can register itself.
|
package/build/desearch-api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Direct calls to the Desearch API for routes desearch-js 1.5 does not cover
|
|
3
3
|
* (People Search, Company Search, Monitors, the TikTok, Facebook, Instagram, YouTube,
|
|
4
|
-
* Reddit and Threads routes, `POST /search`).
|
|
4
|
+
* Reddit and Threads routes, `POST /search`, `GET /desearch/balance`).
|
|
5
5
|
*
|
|
6
6
|
* Same base URL, `Authorization: <key>` header, and `HTTP <status>: <detail>`
|
|
7
7
|
* error text that desearch-js uses, so every tool reports API errors the same way.
|
package/build/desearch-api.js
CHANGED
|
@@ -3,7 +3,7 @@ import { recordCostHeaders } from "./cost-meta.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Direct calls to the Desearch API for routes desearch-js 1.5 does not cover
|
|
5
5
|
* (People Search, Company Search, Monitors, the TikTok, Facebook, Instagram, YouTube,
|
|
6
|
-
* Reddit and Threads routes, `POST /search`).
|
|
6
|
+
* Reddit and Threads routes, `POST /search`, `GET /desearch/balance`).
|
|
7
7
|
*
|
|
8
8
|
* Same base URL, `Authorization: <key>` header, and `HTTP <status>: <detail>`
|
|
9
9
|
* error text that desearch-js uses, so every tool reports API errors the same way.
|
package/build/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../http.ts"],"names":[],"mappings":"AAYA,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OAAO,CAAC,iBAAiB,CAAC,CAiD3F"}
|
package/build/http.js
CHANGED
|
@@ -104,20 +104,36 @@ const LOGIN_CHALLENGE = {
|
|
|
104
104
|
/** Public docs page that browsers and crawlers land on when they open /mcp without a key. */
|
|
105
105
|
export const MCP_DOCS_URL = "https://www.desearch.ai/docs/guide/sdk/mcp";
|
|
106
106
|
/**
|
|
107
|
-
* A plain page view of /mcp: GET or HEAD
|
|
108
|
-
* marks it as an MCP client
|
|
109
|
-
*
|
|
107
|
+
* A plain page view of /mcp: GET or HEAD from a browser or a crawler, with
|
|
108
|
+
* nothing that marks it as an MCP client. Accept either asks for HTML, or is
|
|
109
|
+
* missing, or is only the wildcard `*\/*` (link checkers and SEO crawlers).
|
|
110
|
+
* MCP clients send `Accept: text/event-stream` on GET (and `application/json`
|
|
111
|
+
* on POST), plus MCP session or protocol headers, so they keep the 401
|
|
110
112
|
* challenge that drives their OAuth or key prompt.
|
|
111
113
|
*/
|
|
112
114
|
function isBrowserPageView(request) {
|
|
113
115
|
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
114
116
|
return false;
|
|
115
117
|
}
|
|
118
|
+
// Any credential header, even an empty, unsupported or malformed one, keeps the 401 challenge.
|
|
119
|
+
if (request.headers.has("authorization") || request.headers.has("x-api-key")) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
if (request.headers.has("mcp-session-id") || request.headers.has("mcp-protocol-version")) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
116
125
|
const accept = (request.headers.get("accept") ?? "").toLowerCase();
|
|
117
|
-
if (
|
|
126
|
+
if (accept.includes("text/event-stream") || accept.includes("application/json")) {
|
|
118
127
|
return false;
|
|
119
128
|
}
|
|
120
|
-
|
|
129
|
+
if (accept.includes("text/html")) {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
const types = accept
|
|
133
|
+
.split(",")
|
|
134
|
+
.map((part) => part.split(";")[0].trim())
|
|
135
|
+
.filter(Boolean);
|
|
136
|
+
return types.every((type) => type === "*/*");
|
|
121
137
|
}
|
|
122
138
|
function docsRedirect() {
|
|
123
139
|
return new Response(null, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirects.d.ts","sourceRoot":"","sources":["../../oauth/redirects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"redirects.d.ts","sourceRoot":"","sources":["../../oauth/redirects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6BH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAiC3D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAqB7E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMtD"}
|
package/build/oauth/redirects.js
CHANGED
|
@@ -14,6 +14,14 @@ const EXACT_REDIRECTS = new Set([
|
|
|
14
14
|
"https://www.perplexity.ai/rest/connections/oauth_callback",
|
|
15
15
|
"https://enterprise.perplexity.ai/rest/connections/oauth_callback",
|
|
16
16
|
"https://teams.microsoft.com/api/platform/v1.0/oAuthRedirect",
|
|
17
|
+
// Desearch Google Workspace add-on (OAuth2 for Apps Script). Exact script ID
|
|
18
|
+
// only: a pattern over script.google.com would let any Apps Script project
|
|
19
|
+
// register as a Desearch client.
|
|
20
|
+
"https://script.google.com/macros/d/1q3nQZY0VanjPTREexH3qUWIKQd4Ghd7_yFb5ElZ8YXiWolagOSlk2j-1/usercallback",
|
|
21
|
+
// MCPBundles Studio "Connect Desearch" (DCR from api.mcpbundles.com). Exact
|
|
22
|
+
// callback seen on 2026-11-30 in our /register reject log; any other
|
|
23
|
+
// MCPBundles callback id stays rejected.
|
|
24
|
+
"https://api.mcpbundles.com/oauth/callback/desearch-60432bc8",
|
|
17
25
|
]);
|
|
18
26
|
const CHATGPT_CALLBACK_ID = /^\/connector\/oauth\/[A-Za-z0-9._~-]{1,200}$/;
|
|
19
27
|
function isLoopbackHost(hostname) {
|
package/build/server.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { type PeopleClient } from "./people.js";
|
|
|
4
4
|
import { type CompanyClient } from "./companies.js";
|
|
5
5
|
import { type MonitorClient } from "./monitors.js";
|
|
6
6
|
export declare const SERVER_NAME = "Desearch";
|
|
7
|
-
export declare const SERVER_VERSION = "0.
|
|
7
|
+
export declare const SERVER_VERSION = "0.13.0";
|
|
8
8
|
export declare const SERVER_TITLE = "Desearch";
|
|
9
9
|
export declare const SERVER_WEBSITE_URL = "https://www.desearch.ai";
|
|
10
10
|
export declare const MCP_PUBLIC_BASE_URL: string;
|
|
@@ -109,7 +109,7 @@ export declare function presentSearchBody(value: unknown): unknown;
|
|
|
109
109
|
* (people.ts), a Company Search client (companies.ts), and a Monitors client (monitors.ts)
|
|
110
110
|
* from `apiKey`.
|
|
111
111
|
* The routes desearch-js 1.5 does not cover (People Search, Company Search, Monitors, TikTok,
|
|
112
|
-
* Facebook, Instagram, YouTube, Reddit, Threads, `POST /search`) share one direct API caller (desearch-api.ts)
|
|
112
|
+
* Facebook, Instagram, YouTube, Reddit, Threads, `POST /search`, `GET /desearch/balance`) share one direct API caller (desearch-api.ts)
|
|
113
113
|
* for that key.
|
|
114
114
|
*/
|
|
115
115
|
export declare function createDesearchMcpServer(apiKey: string, client?: DesearchClient, peopleClient?: PeopleClient, companyClient?: CompanyClient, monitorClient?: MonitorClient): McpServer;
|
package/build/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAKH,KAAK,IAAI,EAEZ,MAAM,oCAAoC,CAAC;AAK5C,OAAO,EAqBH,KAAK,YAAY,EACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAeH,KAAK,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AO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,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;AAyoBD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAuCvD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAYzD;AA4JD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,cAAc,EACvB,YAAY,CAAC,EAAE,YAAY,EAC3B,aAAa,CAAC,EAAE,aAAa,EAC7B,aAAa,CAAC,EAAE,aAAa,GAC9B,SAAS,CA0wDX"}
|
package/build/server.js
CHANGED
|
@@ -10,7 +10,7 @@ import { MONITOR_ACCOUNTS_MAX, MONITOR_CRITERIA_MAX, MONITOR_CRITERION_MAX, MONI
|
|
|
10
10
|
import { FACEBOOK_SEARCH_SORTS, runSocialAction, socialActionNames } from "./social.js";
|
|
11
11
|
import { AI_SEARCH_TOOLS, WEB_LINK_TOOLS, toolIdSchema } from "./tool-sources.js";
|
|
12
12
|
export const SERVER_NAME = "Desearch";
|
|
13
|
-
export const SERVER_VERSION = "0.
|
|
13
|
+
export const SERVER_VERSION = "0.13.0";
|
|
14
14
|
export const SERVER_TITLE = "Desearch";
|
|
15
15
|
export const SERVER_WEBSITE_URL = "https://www.desearch.ai";
|
|
16
16
|
// Public origin of the hosted server, which serves the icons below.
|
|
@@ -713,7 +713,7 @@ function registerTool(server, apiKey, name, title, description, inputSchema, han
|
|
|
713
713
|
* (people.ts), a Company Search client (companies.ts), and a Monitors client (monitors.ts)
|
|
714
714
|
* from `apiKey`.
|
|
715
715
|
* The routes desearch-js 1.5 does not cover (People Search, Company Search, Monitors, TikTok,
|
|
716
|
-
* Facebook, Instagram, YouTube, Reddit, Threads, `POST /search`) share one direct API caller (desearch-api.ts)
|
|
716
|
+
* Facebook, Instagram, YouTube, Reddit, Threads, `POST /search`, `GET /desearch/balance`) share one direct API caller (desearch-api.ts)
|
|
717
717
|
* for that key.
|
|
718
718
|
*/
|
|
719
719
|
export function createDesearchMcpServer(apiKey, client, peopleClient, companyClient, monitorClient) {
|
|
@@ -730,7 +730,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient, companyCli
|
|
|
730
730
|
icons: SERVER_ICONS,
|
|
731
731
|
};
|
|
732
732
|
const server = new McpServer(serverInfo, {
|
|
733
|
-
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. search-api is web search on the Desearch index: ranked pages with the passage that best matches the query, and with summary: true a short answer with numbered citations. ai-search covers X posts and web with an optional AI summary. Other tools cover X posts and page extraction. tiktok, facebook, instagram, youtube, reddit, and threads read public social data (posts, profiles, comments, hashtags, YouTube transcripts and channels, subreddits); list actions return next_cursor for the next page where the platform has one. 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, people-search-pause, people-search-resume, and people-search-cancel pause, resume, or cancel it, and people-search-export returns the people found as CSV or JSON Lines. Company Search finds companies on the web from a description and Company Enrich reads the domains you send; both collect public emails, phones, social profiles, and leaders (CEO, founders, CTO, CFO): company-search and company-enrich start paid jobs billed to the user's Desearch balance, company-search-status reads progress and the companies, and company-search-pause, company-search-resume, and company-search-cancel pause, resume, or cancel a task. Set company-search's max_cost_usd only when the user agreed to that budget: it bills search effort even when few companies are found. Monitors rerun a search over web, X, Reddit, YouTube, Threads, TikTok, and Meta Ad Library ads (or watch chosen accounts there and on Instagram and Facebook) on a schedule and keep only new, relevant items: monitor-create sets one up (free; each run is billed to the user's Desearch balance), monitor-items and monitor-runs read what it found, monitor-update changes or pauses it, monitor-trigger runs it now, and monitor-delete removes it. Calls need a Desearch API key.",
|
|
733
|
+
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. search-api is web search on the Desearch index: ranked pages with the passage that best matches the query, and with summary: true a short answer with numbered citations. ai-search covers X posts and web with an optional AI summary. Other tools cover X posts and page extraction. tiktok, facebook, instagram, youtube, reddit, and threads read public social data (posts, profiles, comments, hashtags, YouTube transcripts and channels, subreddits); list actions return next_cursor for the next page where the platform has one. 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, people-search-pause, people-search-resume, and people-search-cancel pause, resume, or cancel it, and people-search-export returns the people found as CSV or JSON Lines. Company Search finds companies on the web from a description and Company Enrich reads the domains you send; both collect public emails, phones, social profiles, and leaders (CEO, founders, CTO, CFO): company-search and company-enrich start paid jobs billed to the user's Desearch balance, company-search-status reads progress and the companies, and company-search-pause, company-search-resume, and company-search-cancel pause, resume, or cancel a task. Set company-search's max_cost_usd only when the user agreed to that budget: it bills search effort even when few companies are found. Monitors rerun a search over web, X, Reddit, YouTube, Threads, TikTok, and Meta Ad Library ads (or watch chosen accounts there and on Instagram and Facebook) on a schedule and keep only new, relevant items: monitor-create sets one up (free; each run is billed to the user's Desearch balance), monitor-items and monitor-runs read what it found, monitor-update changes or pauses it, monitor-trigger runs it now, and monitor-delete removes it. balance returns what the account can still spend in USD (free). Calls need a Desearch API key.",
|
|
734
734
|
});
|
|
735
735
|
registerTool(server, apiKey, "ai-search", "AI Search", "AI Search over X (Twitter) posts and web (from the Desearch index), with an optional AI summary. Web results are capped at 20 per request. For web-only search, use search-api.", {
|
|
736
736
|
prompt: z.string().describe("Question, example: 'What is the latest news on AI?'"),
|
|
@@ -1889,6 +1889,14 @@ export function createDesearchMcpServer(apiKey, client, peopleClient, companyCli
|
|
|
1889
1889
|
return fail("Rotate Monitor Webhook Secret error", error);
|
|
1890
1890
|
}
|
|
1891
1891
|
}, undefined, MONITOR_SECRET_ROTATE);
|
|
1892
|
+
registerTool(server, apiKey, "balance", "Get Balance", "What the Desearch account behind this API key can still spend, in US dollars: { balance_usd, currency }. Free, and not counted as usage. It already subtracts charges from the last minute and shows top-ups (card, TAO, Gamma) as soon as they are credited. A paid tool the balance cannot cover fails with 'HTTP 402: Insufficient balance'. Check it before starting a large People Search, Company Search, or monitor.", strictArgs({}), async () => {
|
|
1893
|
+
try {
|
|
1894
|
+
return ok((await api("GET", "/desearch/balance")).data);
|
|
1895
|
+
}
|
|
1896
|
+
catch (error) {
|
|
1897
|
+
return fail("Get Balance error", error);
|
|
1898
|
+
}
|
|
1899
|
+
}, undefined, READ_ONLY_OPEN_WORLD);
|
|
1892
1900
|
// Scanners ask for these lists during discovery. There is nothing to return,
|
|
1893
1901
|
// but an empty list is a successful response. Method-not-found looks like a
|
|
1894
1902
|
// broken server to some directory crawlers.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "desearch-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"mcpName": "io.github.Desearch-ai/mcp-desearch",
|
|
5
|
-
"description": "AI search (web, Reddit, Hacker News, arXiv, Wikipedia, and Twitter), X (Twitter) search, web search, the Search API, public TikTok, Facebook, Instagram, YouTube (including transcripts), Reddit, and Threads data, People Search exports, page extraction, X data, People Search (find people and creators on X, YouTube, LinkedIn, and TikTok), Company Search (find companies and their public contacts and leaders, or enrich domains you send), and Monitors (searches that rerun on a schedule and keep only new, relevant items) tools for AI agents. Includes
|
|
5
|
+
"description": "AI search (web, Reddit, Hacker News, arXiv, Wikipedia, and Twitter), X (Twitter) search, web search, the Search API, public TikTok, Facebook, Instagram, YouTube (including transcripts), Reddit, and Threads data, People Search exports, page extraction, X data, People Search (find people and creators on X, YouTube, LinkedIn, and TikTok), Company Search (find companies and their public contacts and leaders, or enrich domains you send), and Monitors (searches that rerun on a schedule and keep only new, relevant items) tools for AI agents. Includes 52 tools.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://desearch.ai",
|
|
8
8
|
"type": "module",
|