@kadaliao/dsh-bots 0.0.0-stage → 0.3.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/README.md +142 -2
- package/README.zh-CN.md +123 -0
- package/client.js +5506 -0
- package/cordis.patch.yml +7 -0
- package/icon.svg +1 -0
- package/index.js +1286 -0
- package/lib/abilities.mjs +87 -0
- package/lib/apps.mjs +474 -0
- package/lib/mcp-import.mjs +137 -0
- package/lib/prompt.mjs +174 -0
- package/lib/skills.mjs +146 -0
- package/lib/store.mjs +376 -0
- package/lib/teams.mjs +300 -0
- package/lib/unfurl.mjs +394 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +49 -4
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a bot can already do inside DeepSeek Harness, grouped the way a user
|
|
3
|
+
* thinks about it ("browse the web", "write code") instead of tool names.
|
|
4
|
+
* Turning an ability off denies its tools to that bot only. Tools a running
|
|
5
|
+
* Harness does not have are simply skipped.
|
|
6
|
+
*
|
|
7
|
+
* @module @kadaliao/dsh-bots/lib/abilities
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const L = (en, zh) => ({ en, zh });
|
|
11
|
+
|
|
12
|
+
export const ABILITIES = [
|
|
13
|
+
{
|
|
14
|
+
id: 'web',
|
|
15
|
+
name: L('Web search & reading', '联网搜索与阅读'),
|
|
16
|
+
description: L('Search the web and read pages.', '搜索网络、阅读网页。'),
|
|
17
|
+
tools: ['web_search', 'web_fetch'],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'files',
|
|
21
|
+
name: L('Files', '读写文件'),
|
|
22
|
+
description: L('Read, write, edit and search files in its workspace.', '在工作目录里读、写、改、搜文件。'),
|
|
23
|
+
tools: ['read', 'write', 'edit', 'glob', 'grep', 'read_image', 'working_directory'],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'code',
|
|
27
|
+
name: L('Run commands & code', '运行命令与代码'),
|
|
28
|
+
description: L('Run shell commands, scripts and background jobs: build, test, deploy, call CLIs.', '执行终端命令、脚本与后台任务:构建、测试、部署、调用命令行工具。'),
|
|
29
|
+
tools: ['bash', 'job_list', 'job_output', 'job_kill', 'load_workspace_dependencies'],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'office',
|
|
33
|
+
name: L('Office documents', 'Office 文档'),
|
|
34
|
+
description: L('Make and check Word, Excel, PowerPoint and PDF files.', '生成并检查 Word、Excel、PPT 和 PDF。'),
|
|
35
|
+
tools: ['office_render', 'office_convert', 'office_recalculate'],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'images',
|
|
39
|
+
name: L('Image generation', 'AI 作图'),
|
|
40
|
+
description: L('Draw pictures, posters and GIFs (Images plugin).', '画图、海报、动图(图片插件)。'),
|
|
41
|
+
tools: ['generate_image'],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'delegate',
|
|
45
|
+
name: L('Sub-agents & workflows', '子代理与工作流'),
|
|
46
|
+
description: L('Split big jobs across helper agents inside its own conversation.', '在自己的会话里把大任务拆给子代理并行完成。'),
|
|
47
|
+
tools: ['subagent', 'subagent_fork', 'workflow', 'send_message', 'wait_agent', 'list_agents', 'list_subagent_models', 'interrupt_agent', 'spawn_teammate', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'schedule',
|
|
51
|
+
name: L('Own reminders', '自建提醒'),
|
|
52
|
+
description: L('Create Harness scheduled tasks directly (bot_schedule stays available).', '直接创建 Harness 定时任务(bot_schedule 始终可用)。'),
|
|
53
|
+
tools: ['schedule_create', 'schedule_edit', 'schedule_list', 'schedule_view'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'ask',
|
|
57
|
+
name: L('Ask you questions', '向你提问'),
|
|
58
|
+
description: L('Pause and ask you to choose or confirm.', '暂停下来请你选择或确认。'),
|
|
59
|
+
tools: ['ask_user_question'],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'deliver',
|
|
63
|
+
name: L('Hand over files', '交付文件'),
|
|
64
|
+
description: L('Present finished files as cards you can open.', '把做好的文件以卡片形式交给你。'),
|
|
65
|
+
tools: ['present'],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'plugins',
|
|
69
|
+
name: L('Manage Harness plugins', '管理 Harness 插件'),
|
|
70
|
+
description: L('Install or change Harness plugins. Rarely needed by a bot.', '安装或修改 Harness 插件,bot 一般不需要。'),
|
|
71
|
+
tools: ['plugin_manager'],
|
|
72
|
+
risky: true,
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
/** Ability ids whose tools are all in `deny`. */
|
|
77
|
+
export function disabledAbilities(deny) {
|
|
78
|
+
const set = new Set(deny);
|
|
79
|
+
return ABILITIES.filter((a) => a.tools.every((t) => set.has(t))).map((a) => a.id);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** The deny list for a set of disabled abilities, plus any extra tool names. */
|
|
83
|
+
export function denyFor(disabledIds, extra = []) {
|
|
84
|
+
const out = new Set(extra);
|
|
85
|
+
for (const a of ABILITIES) if (disabledIds.includes(a.id)) for (const t of a.tools) out.add(t);
|
|
86
|
+
return [...out];
|
|
87
|
+
}
|
package/lib/apps.mjs
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app catalog: MCP servers a bot can connect, each described well enough
|
|
3
|
+
* that the panel shows a form (keys, paths) instead of a command line.
|
|
4
|
+
*
|
|
5
|
+
* Every entry is checked against its registry (npm / PyPI) or vendor docs;
|
|
6
|
+
* the command runs through `npx` / `uvx`, so nothing is installed up front.
|
|
7
|
+
*
|
|
8
|
+
* @module @kadaliao/dsh-bots/lib/apps
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { homedir } from 'node:os';
|
|
12
|
+
import { join } from 'node:path';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {{key: string, label: {en: string, zh: string}, kind: 'secret'|'text'|'path', env?: string, header?: string, prefix?: string, arg?: boolean, required?: boolean, placeholder?: string, help?: {en: string, zh: string}, default?: string}} AppField
|
|
16
|
+
* @typedef {{id: string, name: {en: string, zh: string}, description: {en: string, zh: string}, category: string, icon: string, color: string, transport: 'stdio'|'streamable-http', serverName: string, command?: string, args?: string[], url?: string, fields?: AppField[], runtime?: 'node'|'uv'|'binary', homepage: string, keyUrl?: string, region?: 'cn'|'global', featured?: boolean, tags?: string[]}} AppEntry
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export const CATEGORIES = [
|
|
20
|
+
{ id: 'business', en: 'Sales & payments', zh: '销售与收款' },
|
|
21
|
+
{ id: 'work', en: 'Team & office', zh: '团队与办公' },
|
|
22
|
+
{ id: 'dev', en: 'Build & ship', zh: '研发与交付' },
|
|
23
|
+
{ id: 'research', en: 'Research & content', zh: '调研与内容' },
|
|
24
|
+
{ id: 'computer', en: 'Computer & browser', zh: '电脑与浏览器' },
|
|
25
|
+
{ id: 'data', en: 'Data', zh: '数据' },
|
|
26
|
+
{ id: 'life', en: 'Maps & local', zh: '地图与本地' },
|
|
27
|
+
{ id: 'custom', en: 'Custom', zh: '自定义' },
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
const L = (en, zh) => ({ en, zh });
|
|
31
|
+
const key = (env, label, keyUrl, extra = {}) => ({ key: env, env, label, kind: 'secret', required: true, ...extra, ...(keyUrl ? {} : {}) });
|
|
32
|
+
|
|
33
|
+
/** @returns {AppEntry[]} */
|
|
34
|
+
export function catalog(ocuPath = '') {
|
|
35
|
+
const home = homedir();
|
|
36
|
+
return [
|
|
37
|
+
{
|
|
38
|
+
id: 'open-computer-use',
|
|
39
|
+
name: L('Open Computer Use', 'Open Computer Use 电脑操控'),
|
|
40
|
+
description: L(
|
|
41
|
+
'See and operate macOS apps through the accessibility tree: observe windows, click, type, batch actions, screenshots.',
|
|
42
|
+
'通过无障碍树查看并操作 macOS 应用:读取窗口、点击、输入、批量动作、截图。',
|
|
43
|
+
),
|
|
44
|
+
category: 'computer',
|
|
45
|
+
icon: 'OC',
|
|
46
|
+
color: '#111827',
|
|
47
|
+
transport: 'stdio',
|
|
48
|
+
serverName: 'ocu',
|
|
49
|
+
command: ocuPath || join(home, '.local', 'share', 'ocu', 'ocu'),
|
|
50
|
+
args: ['mcp'],
|
|
51
|
+
runtime: 'binary',
|
|
52
|
+
homepage: 'https://github.com/kadaliao/open-computer-use',
|
|
53
|
+
featured: true,
|
|
54
|
+
fields: [
|
|
55
|
+
{ key: 'OCU_API_KEY', env: 'OCU_API_KEY', kind: 'secret', label: L('Planner API key (optional)', '规划模型 API Key(可选)'), help: L('Only for run_task / click_visual / read_visual.', '仅 run_task / click_visual / read_visual 需要。') },
|
|
56
|
+
{ key: 'OCU_BASE_URL', env: 'OCU_BASE_URL', kind: 'text', label: L('Planner base URL (optional)', '规划模型 Base URL(可选)'), placeholder: 'https://api.deepseek.com' },
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'playwright',
|
|
61
|
+
name: L('Playwright Browser', 'Playwright 浏览器'),
|
|
62
|
+
description: L('Drive a real browser: open pages, click, fill forms, read the accessibility snapshot, take screenshots.', '驱动真实浏览器:打开网页、点击、填表、读取页面结构、截图。'),
|
|
63
|
+
category: 'computer',
|
|
64
|
+
icon: 'PW',
|
|
65
|
+
color: '#2ead33',
|
|
66
|
+
transport: 'stdio',
|
|
67
|
+
serverName: 'playwright',
|
|
68
|
+
command: 'npx',
|
|
69
|
+
args: ['-y', '@playwright/mcp@latest'],
|
|
70
|
+
runtime: 'node',
|
|
71
|
+
homepage: 'https://github.com/microsoft/playwright-mcp',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'exa',
|
|
75
|
+
name: L('Exa Search', 'Exa 搜索'),
|
|
76
|
+
description: L('Neural web search, code search and page contents (hosted server; works without a key at a low rate).', '语义化网页搜索、代码搜索与正文提取(托管服务,无 Key 也可低频使用)。'),
|
|
77
|
+
category: 'research',
|
|
78
|
+
icon: 'EX',
|
|
79
|
+
color: '#1f40ed',
|
|
80
|
+
transport: 'streamable-http',
|
|
81
|
+
serverName: 'exa',
|
|
82
|
+
url: 'https://mcp.exa.ai/mcp',
|
|
83
|
+
homepage: 'https://docs.exa.ai/reference/exa-mcp',
|
|
84
|
+
keyUrl: 'https://dashboard.exa.ai/api-keys',
|
|
85
|
+
fields: [{ key: 'exaApiKey', kind: 'secret', query: 'exaApiKey', label: L('API key (optional)', 'API Key(可选)') }],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'tavily',
|
|
89
|
+
name: L('Tavily Search', 'Tavily 搜索'),
|
|
90
|
+
description: L('Search, extract, crawl and map websites; built for agents.', '为 Agent 设计的搜索、正文提取、站点爬取与地图。'),
|
|
91
|
+
category: 'research',
|
|
92
|
+
icon: 'TV',
|
|
93
|
+
color: '#7c3aed',
|
|
94
|
+
transport: 'stdio',
|
|
95
|
+
serverName: 'tavily',
|
|
96
|
+
command: 'npx',
|
|
97
|
+
args: ['-y', 'tavily-mcp@latest'],
|
|
98
|
+
runtime: 'node',
|
|
99
|
+
homepage: 'https://github.com/tavily-ai/tavily-mcp',
|
|
100
|
+
keyUrl: 'https://app.tavily.com',
|
|
101
|
+
fields: [key('TAVILY_API_KEY', L('API key', 'API Key'))],
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'brave-search',
|
|
105
|
+
name: L('Brave Search', 'Brave 搜索'),
|
|
106
|
+
description: L('Web, news, image and local search through the Brave Search API.', '通过 Brave Search API 搜索网页、新闻、图片和本地信息。'),
|
|
107
|
+
category: 'research',
|
|
108
|
+
icon: 'BR',
|
|
109
|
+
color: '#fb542b',
|
|
110
|
+
transport: 'stdio',
|
|
111
|
+
serverName: 'brave',
|
|
112
|
+
command: 'npx',
|
|
113
|
+
args: ['-y', '@brave/brave-search-mcp-server'],
|
|
114
|
+
runtime: 'node',
|
|
115
|
+
homepage: 'https://github.com/brave/brave-search-mcp-server',
|
|
116
|
+
keyUrl: 'https://api-dashboard.search.brave.com',
|
|
117
|
+
fields: [key('BRAVE_API_KEY', L('API key', 'API Key'))],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 'firecrawl',
|
|
121
|
+
name: L('Firecrawl', 'Firecrawl 网页爬取'),
|
|
122
|
+
description: L('Scrape, crawl and extract structured data from websites, JavaScript pages included.', '抓取、爬取网站并提取结构化数据,支持 JS 渲染页面。'),
|
|
123
|
+
category: 'research',
|
|
124
|
+
icon: 'FC',
|
|
125
|
+
color: '#f97316',
|
|
126
|
+
transport: 'stdio',
|
|
127
|
+
serverName: 'firecrawl',
|
|
128
|
+
command: 'npx',
|
|
129
|
+
args: ['-y', 'firecrawl-mcp'],
|
|
130
|
+
runtime: 'node',
|
|
131
|
+
homepage: 'https://github.com/mendableai/firecrawl-mcp-server',
|
|
132
|
+
keyUrl: 'https://www.firecrawl.dev/app/api-keys',
|
|
133
|
+
fields: [key('FIRECRAWL_API_KEY', L('API key', 'API Key'))],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'github',
|
|
137
|
+
name: L('GitHub', 'GitHub'),
|
|
138
|
+
description: L("GitHub's official remote server: repositories, issues, pull requests, Actions and code search.", 'GitHub 官方远程服务:仓库、Issue、PR、Actions 与代码搜索。'),
|
|
139
|
+
category: 'dev',
|
|
140
|
+
icon: 'GH',
|
|
141
|
+
color: '#24292f',
|
|
142
|
+
transport: 'streamable-http',
|
|
143
|
+
serverName: 'github',
|
|
144
|
+
url: 'https://api.githubcopilot.com/mcp/',
|
|
145
|
+
homepage: 'https://github.com/github/github-mcp-server',
|
|
146
|
+
keyUrl: 'https://github.com/settings/personal-access-tokens/new',
|
|
147
|
+
featured: true,
|
|
148
|
+
fields: [{ key: 'GITHUB_TOKEN', kind: 'secret', header: 'Authorization', prefix: 'Bearer ', required: true, label: L('Personal access token', '个人访问令牌(PAT)') }],
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 'git',
|
|
152
|
+
name: L('Git', 'Git 仓库'),
|
|
153
|
+
description: L('Read and change a local Git repository: status, diff, log, commit, branches.', '读写本地 Git 仓库:状态、差异、日志、提交、分支。'),
|
|
154
|
+
category: 'dev',
|
|
155
|
+
icon: 'GI',
|
|
156
|
+
color: '#f05032',
|
|
157
|
+
transport: 'stdio',
|
|
158
|
+
serverName: 'git',
|
|
159
|
+
command: 'uvx',
|
|
160
|
+
args: ['mcp-server-git'],
|
|
161
|
+
runtime: 'uv',
|
|
162
|
+
homepage: 'https://github.com/modelcontextprotocol/servers/tree/main/src/git',
|
|
163
|
+
fields: [{ key: 'repository', kind: 'path', arg: true, flag: '--repository', required: true, label: L('Repository path', '仓库路径'), placeholder: join(home, 'code', 'my-repo') }],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: 'context7',
|
|
167
|
+
name: L('Context7 Docs', 'Context7 文档'),
|
|
168
|
+
description: L('Up-to-date, version-specific documentation and code examples for libraries.', '各类库最新、按版本的文档与示例代码。'),
|
|
169
|
+
category: 'dev',
|
|
170
|
+
icon: 'C7',
|
|
171
|
+
color: '#10b981',
|
|
172
|
+
transport: 'stdio',
|
|
173
|
+
serverName: 'context7',
|
|
174
|
+
command: 'npx',
|
|
175
|
+
args: ['-y', '@upstash/context7-mcp'],
|
|
176
|
+
runtime: 'node',
|
|
177
|
+
homepage: 'https://github.com/upstash/context7',
|
|
178
|
+
fields: [{ key: 'CONTEXT7_API_KEY', env: 'CONTEXT7_API_KEY', kind: 'secret', label: L('API key (optional, higher limits)', 'API Key(可选,提高额度)') }],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: 'sentry',
|
|
182
|
+
name: L('Sentry', 'Sentry 错误监控'),
|
|
183
|
+
description: L('Look up issues, errors and releases in Sentry.', '查询 Sentry 中的问题、报错与发布。'),
|
|
184
|
+
category: 'dev',
|
|
185
|
+
icon: 'SE',
|
|
186
|
+
color: '#362d59',
|
|
187
|
+
transport: 'stdio',
|
|
188
|
+
serverName: 'sentry',
|
|
189
|
+
command: 'npx',
|
|
190
|
+
args: ['-y', '@sentry/mcp-server@latest'],
|
|
191
|
+
runtime: 'node',
|
|
192
|
+
homepage: 'https://github.com/getsentry/sentry-mcp',
|
|
193
|
+
keyUrl: 'https://sentry.io/settings/account/api/auth-tokens/',
|
|
194
|
+
fields: [key('SENTRY_ACCESS_TOKEN', L('Auth token', '访问令牌')), { key: 'SENTRY_HOST', env: 'SENTRY_HOST', kind: 'text', label: L('Host (self-hosted only)', '主机(仅自建)'), placeholder: 'sentry.example.com' }],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: 'notion',
|
|
198
|
+
name: L('Notion', 'Notion'),
|
|
199
|
+
description: L('Search, read and edit Notion pages and databases shared with your integration.', '搜索、读取、编辑已共享给集成的 Notion 页面和数据库。'),
|
|
200
|
+
category: 'work',
|
|
201
|
+
icon: 'N',
|
|
202
|
+
color: '#000000',
|
|
203
|
+
transport: 'stdio',
|
|
204
|
+
serverName: 'notion',
|
|
205
|
+
command: 'npx',
|
|
206
|
+
args: ['-y', '@notionhq/notion-mcp-server'],
|
|
207
|
+
runtime: 'node',
|
|
208
|
+
homepage: 'https://github.com/makenotion/notion-mcp-server',
|
|
209
|
+
keyUrl: 'https://www.notion.so/profile/integrations',
|
|
210
|
+
featured: true,
|
|
211
|
+
fields: [key('NOTION_TOKEN', L('Integration token', '集成令牌'), null, { placeholder: 'ntn_…' })],
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: 'memory',
|
|
215
|
+
name: L('Memory', '长期记忆'),
|
|
216
|
+
description: L('A local knowledge graph the bot keeps across conversations: people, projects, facts.', '本地知识图谱,让 Bot 跨会话记住人、项目与事实。'),
|
|
217
|
+
category: 'work',
|
|
218
|
+
icon: 'ME',
|
|
219
|
+
color: '#db2777',
|
|
220
|
+
transport: 'stdio',
|
|
221
|
+
serverName: 'memory',
|
|
222
|
+
command: 'npx',
|
|
223
|
+
args: ['-y', '@modelcontextprotocol/server-memory'],
|
|
224
|
+
runtime: 'node',
|
|
225
|
+
homepage: 'https://github.com/modelcontextprotocol/servers/tree/main/src/memory',
|
|
226
|
+
featured: true,
|
|
227
|
+
fields: [{ key: 'MEMORY_FILE_PATH', env: 'MEMORY_FILE_PATH', kind: 'path', label: L('Memory file', '记忆文件'), default: join(home, '.dsh', 'bots', 'memory', '{bot}.jsonl') }],
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
id: 'sqlite',
|
|
231
|
+
name: L('SQLite', 'SQLite 数据库'),
|
|
232
|
+
description: L('Query and analyse a local SQLite database.', '查询和分析本地 SQLite 数据库。'),
|
|
233
|
+
category: 'data',
|
|
234
|
+
icon: 'SQ',
|
|
235
|
+
color: '#003b57',
|
|
236
|
+
transport: 'stdio',
|
|
237
|
+
serverName: 'sqlite',
|
|
238
|
+
command: 'uvx',
|
|
239
|
+
args: ['--with', 'mcp<2', 'mcp-server-sqlite'], // mcp-server-sqlite breaks on mcp 2.x
|
|
240
|
+
runtime: 'uv',
|
|
241
|
+
homepage: 'https://github.com/modelcontextprotocol/servers-archived/tree/main/src/sqlite',
|
|
242
|
+
fields: [{ key: 'db', kind: 'path', arg: true, flag: '--db-path', required: true, label: L('Database file', '数据库文件'), placeholder: join(home, 'data.db') }],
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: 'postgres',
|
|
246
|
+
name: L('PostgreSQL', 'PostgreSQL 数据库'),
|
|
247
|
+
description: L('Explore schemas, run queries and check health of a PostgreSQL database (read-only).', '浏览表结构、执行查询、检查 PostgreSQL 健康状况(只读)。'),
|
|
248
|
+
category: 'data',
|
|
249
|
+
icon: 'PG',
|
|
250
|
+
color: '#336791',
|
|
251
|
+
transport: 'stdio',
|
|
252
|
+
serverName: 'postgres',
|
|
253
|
+
command: 'uvx',
|
|
254
|
+
args: ['--with', 'mcp<2', 'postgres-mcp'], // postgres-mcp breaks on mcp 2.x
|
|
255
|
+
runtime: 'uv',
|
|
256
|
+
homepage: 'https://github.com/crystaldba/postgres-mcp',
|
|
257
|
+
fields: [{ key: 'DATABASE_URI', kind: 'secret', arg: true, required: true, label: L('Connection URI', '连接串'), placeholder: 'postgresql://user:pass@localhost:5432/db' }],
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: 'amap',
|
|
261
|
+
name: L('Amap', '高德地图'),
|
|
262
|
+
description: L('Geocoding, POI search, routes, travel times and weather in China (Amap).', '高德地图:地理编码、周边搜索、路线规划、出行时间与天气。'),
|
|
263
|
+
category: 'life',
|
|
264
|
+
icon: '高',
|
|
265
|
+
color: '#2f6bff',
|
|
266
|
+
transport: 'stdio',
|
|
267
|
+
serverName: 'amap',
|
|
268
|
+
command: 'npx',
|
|
269
|
+
args: ['-y', '@amap/amap-maps-mcp-server'],
|
|
270
|
+
runtime: 'node',
|
|
271
|
+
region: 'cn',
|
|
272
|
+
homepage: 'https://lbs.amap.com/api/mcp-server/summary',
|
|
273
|
+
keyUrl: 'https://console.amap.com/dev/key/app',
|
|
274
|
+
fields: [key('AMAP_MAPS_API_KEY', L('Web service key', 'Web 服务 Key'))],
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: 'baidu-map',
|
|
278
|
+
name: L('Baidu Maps', '百度地图'),
|
|
279
|
+
description: L('Places, geocoding, routes, traffic and weather from Baidu Maps.', '百度地图:地点检索、地理编码、路线、路况与天气。'),
|
|
280
|
+
category: 'life',
|
|
281
|
+
icon: '百',
|
|
282
|
+
color: '#3385ff',
|
|
283
|
+
transport: 'stdio',
|
|
284
|
+
serverName: 'baidumap',
|
|
285
|
+
command: 'npx',
|
|
286
|
+
args: ['-y', '@baidumap/mcp-server-baidu-map'],
|
|
287
|
+
runtime: 'node',
|
|
288
|
+
region: 'cn',
|
|
289
|
+
homepage: 'https://lbsyun.baidu.com/faq/api?title=mcpserver/base',
|
|
290
|
+
keyUrl: 'https://lbsyun.baidu.com/apiconsole/key',
|
|
291
|
+
fields: [key('BAIDU_MAP_API_KEY', L('Server AK', '服务端 AK'))],
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
id: 'slack',
|
|
295
|
+
name: L('Slack', 'Slack'),
|
|
296
|
+
description: L('Read channels and threads, post messages and reactions in a Slack workspace.', '读取 Slack 频道与讨论串,发消息、加表情。'),
|
|
297
|
+
category: 'work',
|
|
298
|
+
icon: 'SL',
|
|
299
|
+
color: '#4a154b',
|
|
300
|
+
transport: 'stdio',
|
|
301
|
+
serverName: 'slack',
|
|
302
|
+
command: 'npx',
|
|
303
|
+
args: ['-y', '@modelcontextprotocol/server-slack'],
|
|
304
|
+
runtime: 'node',
|
|
305
|
+
homepage: 'https://github.com/modelcontextprotocol/servers-archived/tree/main/src/slack',
|
|
306
|
+
keyUrl: 'https://api.slack.com/apps',
|
|
307
|
+
fields: [key('SLACK_BOT_TOKEN', L('Bot token', 'Bot 令牌'), null, { placeholder: 'xoxb-…' }), { key: 'SLACK_TEAM_ID', env: 'SLACK_TEAM_ID', kind: 'text', required: true, label: L('Team ID', 'Team ID'), placeholder: 'T01234567' }],
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: 'stripe',
|
|
311
|
+
name: L('Stripe', 'Stripe 收款'),
|
|
312
|
+
description: L('Customers, payment links, invoices, subscriptions, refunds and balance (official remote server).', '客户、收款链接、发票、订阅、退款与余额(官方远程服务)。'),
|
|
313
|
+
category: 'business',
|
|
314
|
+
icon: 'S',
|
|
315
|
+
color: '#635bff',
|
|
316
|
+
transport: 'streamable-http',
|
|
317
|
+
serverName: 'stripe',
|
|
318
|
+
url: 'https://mcp.stripe.com',
|
|
319
|
+
homepage: 'https://docs.stripe.com/mcp',
|
|
320
|
+
keyUrl: 'https://dashboard.stripe.com/apikeys',
|
|
321
|
+
featured: true,
|
|
322
|
+
fields: [{ key: 'STRIPE_KEY', kind: 'secret', header: 'Authorization', prefix: 'Bearer ', required: true, label: L('Secret or restricted key', 'Secret / 受限 Key'), placeholder: 'rk_live_… / sk_test_…', help: L('A restricted key with only the permissions the bot needs is safest.', '建议用只开必要权限的受限 Key(rk_)。') }],
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
id: 'hubspot',
|
|
326
|
+
name: L('HubSpot CRM', 'HubSpot 客户管理'),
|
|
327
|
+
description: L('Contacts, companies, deals, tickets and notes in your HubSpot CRM.', 'HubSpot CRM 里的联系人、公司、商机、工单与备注。'),
|
|
328
|
+
category: 'business',
|
|
329
|
+
icon: 'HS',
|
|
330
|
+
color: '#ff7a59',
|
|
331
|
+
transport: 'stdio',
|
|
332
|
+
serverName: 'hubspot',
|
|
333
|
+
command: 'npx',
|
|
334
|
+
args: ['-y', '@hubspot/mcp-server'],
|
|
335
|
+
runtime: 'node',
|
|
336
|
+
homepage: 'https://developers.hubspot.com/mcp',
|
|
337
|
+
keyUrl: 'https://app.hubspot.com/private-apps',
|
|
338
|
+
fields: [key('PRIVATE_APP_ACCESS_TOKEN', L('Private app token', '私有应用令牌'), null, { placeholder: 'pat-…' })],
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: 'feishu',
|
|
342
|
+
name: L('Feishu / Lark', '飞书'),
|
|
343
|
+
description: L('Feishu docs, Bitable, messages, calendars and contacts through the official Open Platform server.', '官方开放平台服务:飞书文档、多维表格、消息、日历与通讯录。'),
|
|
344
|
+
category: 'work',
|
|
345
|
+
icon: '飞',
|
|
346
|
+
color: '#3370ff',
|
|
347
|
+
transport: 'stdio',
|
|
348
|
+
serverName: 'feishu',
|
|
349
|
+
command: 'npx',
|
|
350
|
+
args: ['-y', '@larksuiteoapi/lark-mcp', 'mcp', '-l', 'zh'],
|
|
351
|
+
runtime: 'node',
|
|
352
|
+
region: 'cn',
|
|
353
|
+
homepage: 'https://github.com/larksuite/lark-openapi-mcp',
|
|
354
|
+
keyUrl: 'https://open.feishu.cn/app',
|
|
355
|
+
featured: true,
|
|
356
|
+
fields: [
|
|
357
|
+
{ key: 'appId', kind: 'text', arg: true, flag: '-a', required: true, label: L('App ID', 'App ID'), placeholder: 'cli_…' },
|
|
358
|
+
{ key: 'appSecret', kind: 'secret', arg: true, flag: '-s', required: true, label: L('App secret', 'App Secret') },
|
|
359
|
+
],
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
id: 'supabase',
|
|
363
|
+
name: L('Supabase', 'Supabase'),
|
|
364
|
+
description: L('Your product backend: tables, SQL, migrations, logs, edge functions (read-only by default).', '产品后端:表、SQL、迁移、日志、Edge Functions(默认只读)。'),
|
|
365
|
+
category: 'dev',
|
|
366
|
+
icon: 'SB',
|
|
367
|
+
color: '#3ecf8e',
|
|
368
|
+
transport: 'stdio',
|
|
369
|
+
serverName: 'supabase',
|
|
370
|
+
command: 'npx',
|
|
371
|
+
args: ['-y', '@supabase/mcp-server-supabase@latest', '--read-only'],
|
|
372
|
+
runtime: 'node',
|
|
373
|
+
homepage: 'https://supabase.com/docs/guides/getting-started/mcp',
|
|
374
|
+
keyUrl: 'https://supabase.com/dashboard/account/tokens',
|
|
375
|
+
fields: [key('SUPABASE_ACCESS_TOKEN', L('Personal access token', '个人访问令牌'), null, { placeholder: 'sbp_…' }), { key: 'projectRef', kind: 'text', arg: true, flag: '--project-ref', label: L('Project ref (optional)', '项目 ref(可选)') }],
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
id: 'mcp-stdio',
|
|
379
|
+
name: L('Custom local server', '自定义本地服务'),
|
|
380
|
+
description: L('Any MCP server started as a local program.', '任意以本地程序启动的 MCP 服务。'),
|
|
381
|
+
category: 'custom',
|
|
382
|
+
icon: '{ }',
|
|
383
|
+
color: '#475569',
|
|
384
|
+
transport: 'stdio',
|
|
385
|
+
serverName: 'tools',
|
|
386
|
+
command: 'npx',
|
|
387
|
+
args: ['-y', 'your-mcp-server'],
|
|
388
|
+
homepage: 'https://modelcontextprotocol.io',
|
|
389
|
+
custom: true,
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
id: 'mcp-http',
|
|
393
|
+
name: L('Custom remote server', '自定义远程服务'),
|
|
394
|
+
description: L('Any MCP server reached over Streamable HTTP.', '任意通过 Streamable HTTP 访问的 MCP 服务。'),
|
|
395
|
+
category: 'custom',
|
|
396
|
+
icon: 'URL',
|
|
397
|
+
color: '#475569',
|
|
398
|
+
transport: 'streamable-http',
|
|
399
|
+
serverName: 'remote',
|
|
400
|
+
url: 'https://example.com/mcp',
|
|
401
|
+
homepage: 'https://modelcontextprotocol.io',
|
|
402
|
+
custom: true,
|
|
403
|
+
},
|
|
404
|
+
];
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* The mcp-client row of one app: the template's command, with the app's field
|
|
409
|
+
* values placed as environment variables, headers, query params or arguments.
|
|
410
|
+
* Custom apps (and old rows) use their own `config` as written.
|
|
411
|
+
* @param {object} app - `{template, serverName, values?, config?}`
|
|
412
|
+
* @param {AppEntry[]} entries
|
|
413
|
+
* @param {{bot?: string}} [ctx]
|
|
414
|
+
*/
|
|
415
|
+
export function mcpConfigFor(app, entries, ctx = {}) {
|
|
416
|
+
const t = entries.find((e) => e.id === app.template);
|
|
417
|
+
const values = app.values && typeof app.values === 'object' ? app.values : {};
|
|
418
|
+
const reconnect = { maxAttempts: 3 };
|
|
419
|
+
const fill = (v) => String(v ?? '').replaceAll('{bot}', ctx.bot ?? 'bot');
|
|
420
|
+
const valueOf = (f) => {
|
|
421
|
+
const raw = values[f.key];
|
|
422
|
+
return raw === undefined || raw === null || String(raw).trim() === '' ? (f.default ? fill(f.default) : '') : String(raw).trim();
|
|
423
|
+
};
|
|
424
|
+
if (!t || t.custom) {
|
|
425
|
+
const c = app.config ?? {};
|
|
426
|
+
if (app.template === 'mcp-http' || (t && t.transport === 'streamable-http')) return { serverName: app.serverName, transport: 'streamable-http', url: c.url, headers: c.headers ?? {}, reconnect };
|
|
427
|
+
return { serverName: app.serverName, transport: 'stdio', command: c.command, args: c.args ?? [], env: c.env ?? {}, reconnect };
|
|
428
|
+
}
|
|
429
|
+
const missing = (t.fields ?? []).filter((f) => f.required && valueOf(f) === '').map((f) => f.label.en);
|
|
430
|
+
if (missing.length > 0) {
|
|
431
|
+
const error = new Error(`${t.name.en} needs: ${missing.join(', ')}`);
|
|
432
|
+
error.code = 'APP_INCOMPLETE';
|
|
433
|
+
throw error;
|
|
434
|
+
}
|
|
435
|
+
if (t.transport === 'streamable-http') {
|
|
436
|
+
const url = new URL(t.url);
|
|
437
|
+
const headers = {};
|
|
438
|
+
for (const f of t.fields ?? []) {
|
|
439
|
+
const v = valueOf(f);
|
|
440
|
+
if (v === '') continue;
|
|
441
|
+
if (f.header) headers[f.header] = `${f.prefix ?? ''}${v}`;
|
|
442
|
+
if (f.query) url.searchParams.set(f.query, v);
|
|
443
|
+
}
|
|
444
|
+
return { serverName: app.serverName, transport: 'streamable-http', url: url.toString(), headers, reconnect };
|
|
445
|
+
}
|
|
446
|
+
const env = {};
|
|
447
|
+
const args = [...(t.args ?? [])];
|
|
448
|
+
for (const f of t.fields ?? []) {
|
|
449
|
+
const v = valueOf(f);
|
|
450
|
+
if (v === '') continue;
|
|
451
|
+
if (f.env) env[f.env] = v;
|
|
452
|
+
if (f.arg) {
|
|
453
|
+
const parts = f.multi ? v.split(/\r?\n/).map((s) => s.trim()).filter(Boolean) : [v];
|
|
454
|
+
for (const p of parts) {
|
|
455
|
+
if (f.flag) args.push(f.flag, p);
|
|
456
|
+
else args.push(p);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return {
|
|
461
|
+
serverName: app.serverName,
|
|
462
|
+
transport: 'stdio',
|
|
463
|
+
command: app.template === 'open-computer-use' && app.config?.command ? app.config.command : t.command,
|
|
464
|
+
args,
|
|
465
|
+
env,
|
|
466
|
+
reconnect,
|
|
467
|
+
...(app.template === 'open-computer-use' ? { toolCallTimeoutMs: 180_000 } : {}),
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/** The catalog as the page sees it: no host-only functions, labels in both languages. */
|
|
472
|
+
export function publicCatalog(entries) {
|
|
473
|
+
return entries.map((e) => ({ ...e, fields: (e.fields ?? []).map((f) => ({ ...f })) }));
|
|
474
|
+
}
|