desearch-mcp-server 0.3.0 → 0.3.1
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 +5 -0
- package/build/server.d.ts +4 -4
- package/build/server.d.ts.map +1 -1
- package/build/server.js +12 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
- `x-search` filters `min_retweets`, `min_replies`, and `min_likes` are integers in the tool input schema. Each property has its own JSON Schema `type`.
|
|
6
|
+
- `extract` and `web-crawl` descriptions link to the Desearch API docs. Prefer `extract` for new integrations. `web-crawl` stays on the legacy `/web/crawl` route.
|
|
7
|
+
|
|
3
8
|
## 0.3.0
|
|
4
9
|
|
|
5
10
|
People Search `metadata` labels. Release this version only after the Desearch API release that brings `metadata` to `api.desearch.ai`. Until then the production API rejects a search that sends `metadata` (HTTP 422, extra fields are forbidden) and ignores `metadata.<key>` list filters, so a filtered `people-search-tasks` call would return every task.
|
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.3.
|
|
4
|
+
export declare const SERVER_VERSION = "0.3.1";
|
|
5
5
|
interface XSearchPayload {
|
|
6
6
|
query: string;
|
|
7
7
|
sort?: "Top" | "Latest";
|
|
@@ -15,9 +15,9 @@ interface XSearchPayload {
|
|
|
15
15
|
is_quote?: boolean;
|
|
16
16
|
is_video?: boolean;
|
|
17
17
|
is_image?: boolean;
|
|
18
|
-
min_retweets?: number
|
|
19
|
-
min_replies?: number
|
|
20
|
-
min_likes?: number
|
|
18
|
+
min_retweets?: number;
|
|
19
|
+
min_replies?: number;
|
|
20
|
+
min_likes?: number;
|
|
21
21
|
}
|
|
22
22
|
interface PageContentPayload {
|
|
23
23
|
url: string;
|
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;AASpE,OAAO,EAiBH,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,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE,OAAO,EAiBH,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,CA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AO,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3D;AAgKD;;;;;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,CA2yBX"}
|
package/build/server.js
CHANGED
|
@@ -5,7 +5,7 @@ import { z } from "zod";
|
|
|
5
5
|
import { PEOPLE_CONTROL_ACTIONS, PEOPLE_FILTER_CHANNELS, PEOPLE_METADATA_KEY_PATTERN, PEOPLE_METADATA_MAX_FILTERS, PEOPLE_METADATA_MAX_KEYS, PEOPLE_METADATA_VALUE_MAX, 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.3.
|
|
8
|
+
export const SERVER_VERSION = "0.3.1";
|
|
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;
|
|
@@ -118,9 +118,12 @@ function platformFilterList() {
|
|
|
118
118
|
.map(([platform, filters]) => `${platform}: ${filters.join(", ")}`)
|
|
119
119
|
.join(". ");
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
// A new schema per field. One shared instance serializes as a JSON Schema $ref,
|
|
122
|
+
// and a number|string union serializes as anyOf with no type. The API uses these
|
|
123
|
+
// counts as integers.
|
|
124
|
+
function engagementThreshold(description) {
|
|
125
|
+
return z.number().int().min(0).optional().describe(description);
|
|
126
|
+
}
|
|
124
127
|
function definedFields(fields) {
|
|
125
128
|
const out = {};
|
|
126
129
|
for (const key of Object.keys(fields)) {
|
|
@@ -401,9 +404,9 @@ export function createDesearchMcpServer(apiKey, client, peopleClient) {
|
|
|
401
404
|
is_quote: z.boolean().optional().describe("Include only posts that are quotes."),
|
|
402
405
|
is_video: z.boolean().optional().describe("Include only posts with video."),
|
|
403
406
|
is_image: z.boolean().optional().describe("Include only posts with images."),
|
|
404
|
-
min_retweets: engagementThreshold
|
|
405
|
-
min_replies: engagementThreshold
|
|
406
|
-
min_likes: engagementThreshold
|
|
407
|
+
min_retweets: engagementThreshold("Minimum number of retweets."),
|
|
408
|
+
min_replies: engagementThreshold("Minimum number of replies."),
|
|
409
|
+
min_likes: engagementThreshold("Minimum number of likes."),
|
|
407
410
|
}, async ({ query, count, user, start_date, end_date, lang, verified, blue_verified, is_quote, is_video, is_image, min_retweets, min_replies, min_likes, }) => {
|
|
408
411
|
try {
|
|
409
412
|
return ok(await desearch.xSearch({
|
|
@@ -566,7 +569,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient) {
|
|
|
566
569
|
return fail("X Post Replies error", error);
|
|
567
570
|
}
|
|
568
571
|
});
|
|
569
|
-
registerTool(server, apiKey, "extract", "Extract Page Content", "Extract a public URL and return its content as plain text or HTML using Desearch. Preferred over web-crawl for new integrations.", pageContentFields(), async ({ url, format, js, wait }) => {
|
|
572
|
+
registerTool(server, apiKey, "extract", "Extract Page Content", "Extract a public URL and return its content as plain text or HTML using Desearch. Preferred over web-crawl for new integrations. API docs: https://www.desearch.ai/docs/api-reference/get-web-extract", pageContentFields(), async ({ url, format, js, wait }) => {
|
|
570
573
|
try {
|
|
571
574
|
return ok(await desearch.extract({ url, format, js, wait }));
|
|
572
575
|
}
|
|
@@ -574,7 +577,7 @@ export function createDesearchMcpServer(apiKey, client, peopleClient) {
|
|
|
574
577
|
return fail("Extract error", error);
|
|
575
578
|
}
|
|
576
579
|
});
|
|
577
|
-
registerTool(server, apiKey, "web-crawl", "Crawl Web Page (Legacy)", "Crawl a public URL and return its content as plain text or HTML on the legacy Desearch /web/crawl route. The SDK marks webCrawl deprecated in favor of extract; this tool stays for parity with that route. Prefer extract for new integrations.", pageContentFields(), async ({ url, format, js, wait }) => {
|
|
580
|
+
registerTool(server, apiKey, "web-crawl", "Crawl Web Page (Legacy)", "Crawl a public URL and return its content as plain text or HTML on the legacy Desearch /web/crawl route. The SDK marks webCrawl deprecated in favor of extract; this tool stays for parity with that route. Prefer extract for new integrations. API docs: https://www.desearch.ai/docs/guide/apis/extract-api", pageContentFields(), async ({ url, format, js, wait }) => {
|
|
578
581
|
try {
|
|
579
582
|
return ok(await desearch.webCrawl({ url, format, js, wait }));
|
|
580
583
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "desearch-mcp-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
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",
|