deepseek-websearch-mcp 1.0.0 → 1.0.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/README.md +65 -20
- package/package.json +1 -1
- package/server.mjs +2 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## 工具说明
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
#### `webSearch(query, count?, freshness?, ori_question?, localization?, need_content?)`
|
|
13
13
|
|
|
14
14
|
| 参数 | 说明 |
|
|
15
15
|
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -20,56 +20,101 @@
|
|
|
20
20
|
| `localization` | 可选,用于优先返回本地化结果的 IP 地址(官方字段) |
|
|
21
21
|
| `need_content` | 是否返回页面全文,默认 `false` 只返回摘要 |
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
输出示例:
|
|
24
24
|
|
|
25
25
|
```
|
|
26
|
-
|
|
26
|
+
Input:
|
|
27
|
+
webSearch("DeepSeek Search API 上线", count=3, freshness="pw")
|
|
28
|
+
|
|
29
|
+
Output:
|
|
30
|
+
details: 共 3 条结果, 耗时 0.34s
|
|
27
31
|
Title: Change Log | DeepSeek API Docs
|
|
28
|
-
Meta: 发布于 2026-10-16 | 权威度=3/4 | 相关性=2.
|
|
32
|
+
Meta: 发布于 2026-10-16 | 站点=DeepSeek | 权威度=3/4 | 相关性=2.61
|
|
29
33
|
Content: Improved Chinese Search Capabilities
|
|
30
34
|
URL: https://api-docs.deepseek.com/updates
|
|
31
35
|
|
|
36
|
+
Title: DeepSeek新版本上线
|
|
37
|
+
Meta: 发布于 2026-10-16 | 站点=jingjiribao.cn | 权威度=4/4 | 相关性=2.34
|
|
38
|
+
Content: # DeepSeek新版本上线
|
|
39
|
+
…(长摘要,此处截略)
|
|
40
|
+
URL: http://www.jingjiribao.cn/static/detail.jsp?id=690604
|
|
41
|
+
|
|
32
42
|
Title: DeepSeek上线搜索抓取API,V4.1快照短暂出现
|
|
33
|
-
Meta: 发布于 2026-10-16 | 权威度=3/4 | 相关性=2.
|
|
43
|
+
Meta: 发布于 2026-10-16 | 站点=驱动中国 | 权威度=3/4 | 相关性=2.33
|
|
34
44
|
Content: # DeepSeek上线搜索抓取API,V4.1快照短暂出现
|
|
35
45
|
…(长摘要,此处截略)
|
|
36
46
|
URL: https://app.qudong.com/article/526406.html
|
|
37
|
-
|
|
38
|
-
Title: 新版本上线,DeepSeek新接口定价公布
|
|
39
|
-
Meta: 发布于 2026-10-16 | 权威度=2/4 | 相关性=2.29
|
|
40
|
-
Content: # 新版本上线,DeepSeek新接口定价公布
|
|
41
|
-
…(长摘要,此处截略)
|
|
42
|
-
URL: https://news.qq.com/rain/a/20261017A0CEWI00
|
|
43
47
|
```
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
#### `webFetch(url)`
|
|
46
50
|
|
|
47
51
|
抓取 `http/https` 网页(≤8192 字符),返回 Markdown 正文(超过 60000 字符自动截断保护)。
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
输出示例:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
Input:
|
|
57
|
+
webFetch("https://example.com/")
|
|
58
|
+
|
|
59
|
+
Output:
|
|
60
|
+
已抓取 0.47s | Example Domain
|
|
61
|
+
|
|
62
|
+
该域名仅用于文档示例,无需获得许可。这并非一项服务,请勿将其用于测试和监控目的。
|
|
63
|
+
|
|
64
|
+
This domain is for use in documentation examples without needing permission\. This is not a service\; avoid relying on it for testing and monitoring purposes\.
|
|
65
|
+
…(多语言正文,此处截略)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 开始
|
|
69
|
+
|
|
70
|
+
首先在 [platform.deepseek.com](https://platform.deepseek.com/api_keys) 申请 API Key。
|
|
71
|
+
|
|
72
|
+
### Linux / macOS
|
|
73
|
+
|
|
74
|
+
在 MCP 客户端配置中加入:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"mcpServers": {
|
|
79
|
+
"DeepSeek_Search": {
|
|
80
|
+
"command": "npx",
|
|
81
|
+
"args": ["-y", "deepseek-websearch-mcp"],
|
|
82
|
+
"env": {
|
|
83
|
+
"DEEPSEEK_API_KEY": "你的API Key"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Windows
|
|
91
|
+
|
|
92
|
+
Windows 首先进行全局安装:
|
|
93
|
+
|
|
94
|
+
```shell
|
|
95
|
+
npm install -g deepseek-websearch-mcp
|
|
96
|
+
```
|
|
50
97
|
|
|
51
|
-
|
|
52
|
-
2. 本地运行(当前推荐方式):
|
|
98
|
+
再在 MCP 客户端配置中加入:
|
|
53
99
|
|
|
54
100
|
```json
|
|
55
101
|
{
|
|
56
102
|
"mcpServers": {
|
|
57
103
|
"DeepSeek_Search": {
|
|
58
|
-
"command": "
|
|
59
|
-
"args": ["
|
|
104
|
+
"command": "cmd",
|
|
105
|
+
"args": ["/c", "deepseek-websearch-mcp"],
|
|
60
106
|
"env": {
|
|
61
|
-
"DEEPSEEK_API_KEY": "
|
|
107
|
+
"DEEPSEEK_API_KEY": "你的API Key"
|
|
62
108
|
}
|
|
63
109
|
}
|
|
64
110
|
}
|
|
65
111
|
}
|
|
66
112
|
```
|
|
67
113
|
|
|
68
|
-
发布 npm 包后可用 `npx -y deepseek-websearch-mcp` 或 `npm install -g deepseek-websearch-mcp` 免路径运行(待发布)。
|
|
69
114
|
|
|
70
115
|
## 计费与限流
|
|
71
116
|
|
|
72
|
-
- Search / Fetch
|
|
117
|
+
- Search / Fetch 定价以[官方文档](https://api-docs.deepseek.com/zh-cn/guides/search)为准;失败、空结果、超时**不计费**,结果条数不影响单价
|
|
73
118
|
- 每账号 Search / Fetch 各限 **5 QPS**(独立计数),Fetch 另有按域名限流,超限返回 429
|
|
74
119
|
- 本 server 对 401(Key 无效)/ 402(余额不足)/ 403(安全策略)/ 404(无内容)/ 429(限流)返回中文错误说明,便于 Agent 自行判断是否重试
|
|
75
120
|
|
package/package.json
CHANGED
package/server.mjs
CHANGED
|
@@ -102,11 +102,12 @@ function formatSearchResults(results, ms, note) {
|
|
|
102
102
|
lines.push("Title: " + (r.title || "(无标题)"));
|
|
103
103
|
const meta = [];
|
|
104
104
|
if (r.date) meta.push("发布于 " + String(r.date).slice(0, 10));
|
|
105
|
+
if (r.site_name) meta.push("站点=" + r.site_name);
|
|
105
106
|
if (r.authority != null && r.authority !== -1) meta.push(`权威度=${r.authority}/4`);
|
|
106
107
|
if (r.rerank_score != null) meta.push(`相关性=${Number(r.rerank_score).toFixed(2)}`);
|
|
107
108
|
if (meta.length) lines.push("Meta: " + meta.join(" | "));
|
|
108
109
|
let body = r.summary || r.snippet || "";
|
|
109
|
-
if (r.content) body = r.content.slice(0,
|
|
110
|
+
if (r.content) body = r.content.slice(0, 6000); // need_content 开启时展示正文前段,全量仍在 structuredContent
|
|
110
111
|
lines.push("Content: " + clean(body));
|
|
111
112
|
lines.push("URL: " + r.url);
|
|
112
113
|
lines.push("");
|