@ada-mcp/mcp-server 0.1.13 → 0.1.15

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.
Files changed (3) hide show
  1. package/README.md +139 -139
  2. package/dist/cli.cjs +500 -176
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,139 +1,139 @@
1
- # @ada-mcp/mcp-server
2
-
3
- ADA MCP server package that supports:
4
-
5
- - Local stdio mode (default) for MCP hosts
6
- - Remote HTTP mode (`server`) with API key authentication
7
- - MCP **Streamable HTTP** on `POST|GET|DELETE /mcp` (same port as legacy REST), with optional SSE per MCP spec (`@modelcontextprotocol/sdk` transport)
8
-
9
- ## 标准安装(Cursor / MCP)
10
-
11
- 请使用 **`@ada-mcp/launcher@0.1.7`** 拉起本包(见 [launcher README](../ada-mcp-launcher/README.md)):
12
-
13
- ```json
14
- {
15
- "mcpServers": {
16
- "ada-mcp": {
17
- "command": "pnpm",
18
- "args": ["dlx", "@ada-mcp/launcher@0.1.7"]
19
- }
20
- }
21
- }
22
- ```
23
-
24
- 本包版本:**`@ada-mcp/mcp-server@0.1.10`**(由 launcher 默认拉取;依赖锁定 `playwright@1.59.1`)。
25
-
26
- 直接调试本包(无 launcher 拉包前测速):
27
-
28
- ```bash
29
- pnpm dlx @ada-mcp/mcp-server@0.1.10
30
- # npx 等价:
31
- npx -y @ada-mcp/mcp-server@0.1.10
32
- ```
33
-
34
- ## 启动时自动安装依赖(默认仅 Playwright)
35
-
36
- 进程启动前会按配置自动执行 `install-deps`(日志在 stderr):
37
-
38
- | 配置 | 含义 |
39
- |------|------|
40
- | (未配置) | 仅安装 **Playwright + 浏览器** |
41
- | `playwright` | 仅 Playwright(显式写法,与默认相同) |
42
- | `selenium` | **仅** Selenium 原生驱动(GeckoDriver/ChromeDriver) |
43
- | `appium` | **仅** Appium 包 + 移动端驱动 |
44
- | `playwright,selenium` | 组合(逗号连接多类) |
45
- | `all` | 上述全部 |
46
- | `none` / `skip` | 不自动安装 |
47
-
48
- **环境变量**
49
-
50
- - `ADA_MCP_INSTALL_DEPS`:范围,如 `playwright`、`playwright,selenium`、`all`、`none`
51
- - `ADA_MCP_SKIP_INSTALL_DEPS=1`:跳过自动安装
52
- - `ADA_MCP_INSTALL_DEPS_FORCE=1`:强制重装
53
- - `ADA_MCP_GECKODRIVER_VERSION` / `ADA_MCP_CHROMEDRIVER_VERSION`:Selenium 驱动版本
54
- - `ADA_PLAYWRIGHT_INSTALL_TIMEOUT_MS`:浏览器下载超时(默认 15 分钟)
55
- - `ADA_INSTALL_STRATEGY_TIMEOUT_MS`:npm 装包超时(默认 2 分钟)
56
-
57
- ## 代理与镜像(`0.1.10+` 推荐)
58
-
59
- | 阶段 | 自动探测最快镜像 |
60
- |------|------------------|
61
- | `pnpm dlx @ada-mcp/launcher` | **是** — 拉包前测速(推荐) |
62
- | `pnpm dlx @ada-mcp/mcp-server` | tarball 仍走本机源;**同次安装的依赖**由 `preinstall` 测速(仅写入官方 Playwright CDN,`0.1.9+`) |
63
- | 启动后 `install-deps` | 是 — 内置国内镜像测速(**无需配置**) |
64
-
65
- 默认 npm 探测候选(按优先级,延迟相同取靠前):阿里云 npmmirror → 腾讯云 → 华为云 → npm 官方。
66
-
67
- | 变量 | 说明 |
68
- |------|------|
69
- | `npm_config_registry` | 可选;仅加速 **dlx** 拉包(推荐 `https://registry.npmmirror.com`) |
70
- | `ADA_REGISTRY_CANDIDATES` | 可选;在默认五镜像**之外**追加候选 |
71
- | `ADA_NPM_PROXY_REGISTRY` / `ADA_PNPM_PROXY_REGISTRY` | 可选;覆盖探测主候选(默认 npmmirror) |
72
- | `PLAYWRIGHT_DOWNLOAD_HOST` | 可选;Playwright 浏览器 CDN |
73
-
74
- 详见 [ADA-MCP-接入手册 §3.9.2](../../docs/ADA-MCP-接入手册.md#392-代理与镜像配置)。
75
-
76
- **CLI 参数**(写在 MCP `args` 末尾)
77
-
78
- - `--install-deps=playwright,selenium`
79
- - `--skip-install-deps`
80
- - `--install-deps-force`
81
- - `--geckodriver-version=latest` `--chromedriver-version=match-chrome`
82
-
83
- 在标准 `args` 后追加,例如安装全部依赖:
84
-
85
- ```json
86
- "args": ["dlx", "@ada-mcp/launcher@0.1.7", "--install-deps=all"]
87
- ```
88
-
89
- ## Cursor MCP 配置
90
-
91
- **pnpm(推荐)**:`pnpm` + `dlx @ada-mcp/launcher@0.1.7`
92
-
93
- **npx 等价**(`launcher@0.1.7+`):`npx` + `-y @ada-mcp/launcher@0.1.7`(内层同样 `npx -y` mcp-server,测速逻辑与 pnpm 一致)
94
-
95
- ```json
96
- {
97
- "mcpServers": {
98
- "ada-mcp": {
99
- "command": "npx",
100
- "args": ["-y", "@ada-mcp/launcher@0.1.7"]
101
- }
102
- }
103
- }
104
- ```
105
-
106
- Windows 若找不到 `pnpm`,可将 `command` 改为 `pnpm.cmd` 绝对路径;无 pnpm 时只能直接 `npx -y @ada-mcp/mcp-server@0.1.10`(无 launcher 拉包测速)。
107
-
108
- ## Remote mode
109
-
110
- Set API key in environment variable first:
111
-
112
- ```bash
113
- export ADA_MCP_REMOTE_API_KEY=your_token
114
- ```
115
-
116
- Windows PowerShell:
117
-
118
- ```powershell
119
- $env:ADA_MCP_REMOTE_API_KEY="your_token"
120
- ```
121
-
122
- Then run:
123
-
124
- ```bash
125
- pnpm dlx @ada-mcp/mcp-server server --host=127.0.0.1 --port=8787 --allow-risky=true --risky-mode=whitelist --risky-commands=custom
126
- ```
127
-
128
- ### Streamable HTTP (`/mcp`)
129
-
130
- - Endpoint: `http://<host>:<port>/mcp` — same API key headers as below (`x-api-key` or `Authorization: Bearer`).
131
- - First request: `POST /mcp` with JSON-RPC `initialize` (no `Mcp-Session-Id`); server returns a session id in `Mcp-Session-Id` response header.
132
- - Follow-up: `POST /mcp` with body + `Mcp-Session-Id`; for server-initiated streaming, open `GET /mcp` with `Accept: text/event-stream` and the same session header.
133
- - Session teardown: `DELETE /mcp` with `Mcp-Session-Id`.
134
-
135
- When listening on all interfaces (e.g. `--host=0.0.0.0`), set allowed Host headers to satisfy DNS rebinding checks:
136
-
137
- ```bash
138
- pnpm dlx @ada-mcp/mcp-server server --host=0.0.0.0 --port=8787 --api-key=your_token --allowed-hosts=localhost,127.0.0.1
139
- ```
1
+ # @ada-mcp/mcp-server
2
+
3
+ ADA MCP server package that supports:
4
+
5
+ - Local stdio mode (default) for MCP hosts
6
+ - Remote HTTP mode (`server`) with API key authentication
7
+ - MCP **Streamable HTTP** on `POST|GET|DELETE /mcp` (same port as legacy REST), with optional SSE per MCP spec (`@modelcontextprotocol/sdk` transport)
8
+
9
+ ## 标准安装(Cursor / MCP)
10
+
11
+ 请使用 **`@ada-mcp/launcher@0.1.12`** 拉起本包(见 [launcher README](../ada-mcp-launcher/README.md)):
12
+
13
+ ```json
14
+ {
15
+ "mcpServers": {
16
+ "ada-mcp": {
17
+ "command": "pnpm",
18
+ "args": ["dlx", "@ada-mcp/launcher@0.1.12"]
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ 本包版本:**`@ada-mcp/mcp-server@0.1.15`**(由 launcher 默认拉取;依赖锁定 `playwright@1.59.1`)。
25
+
26
+ 直接调试本包(无 launcher 拉包前测速):
27
+
28
+ ```bash
29
+ pnpm dlx @ada-mcp/mcp-server@0.1.15
30
+ # npx 等价:
31
+ npx -y @ada-mcp/mcp-server@0.1.15
32
+ ```
33
+
34
+ ## 启动时自动安装依赖(默认仅 Playwright)
35
+
36
+ 进程启动前会按配置自动执行 `install-deps`(日志在 stderr):
37
+
38
+ | 配置 | 含义 |
39
+ |------|------|
40
+ | (未配置) | 仅安装 **Playwright + 浏览器** |
41
+ | `playwright` | 仅 Playwright(显式写法,与默认相同) |
42
+ | `selenium` | **仅** Selenium 原生驱动(GeckoDriver/ChromeDriver) |
43
+ | `appium` | **仅** Appium 包 + 移动端驱动 |
44
+ | `playwright,selenium` | 组合(逗号连接多类) |
45
+ | `all` | 上述全部 |
46
+ | `none` / `skip` | 不自动安装 |
47
+
48
+ **环境变量**
49
+
50
+ - `ADA_MCP_INSTALL_DEPS`:范围,如 `playwright`、`playwright,selenium`、`all`、`none`
51
+ - `ADA_MCP_SKIP_INSTALL_DEPS=1`:跳过自动安装
52
+ - `ADA_MCP_INSTALL_DEPS_FORCE=1`:强制重装
53
+ - `ADA_MCP_GECKODRIVER_VERSION` / `ADA_MCP_CHROMEDRIVER_VERSION`:Selenium 驱动版本
54
+ - `ADA_PLAYWRIGHT_INSTALL_TIMEOUT_MS`:浏览器下载超时(默认 15 分钟)
55
+ - `ADA_INSTALL_STRATEGY_TIMEOUT_MS`:npm 装包超时(默认 2 分钟)
56
+
57
+ ## 代理与镜像(`0.1.10+` 推荐)
58
+
59
+ | 阶段 | 自动探测最快镜像 |
60
+ |------|------------------|
61
+ | `pnpm dlx @ada-mcp/launcher` | **是** — 拉包前测速(推荐) |
62
+ | `pnpm dlx @ada-mcp/mcp-server` | tarball 仍走本机源;**同次安装的依赖**由 `preinstall` 测速(仅写入官方 Playwright CDN,`0.1.9+`) |
63
+ | 启动后 `install-deps` | 是 — 内置国内镜像测速(**无需配置**) |
64
+
65
+ 默认 npm 探测候选(按优先级,延迟相同取靠前):阿里云 npmmirror → 腾讯云 → 华为云 → npm 官方。
66
+
67
+ | 变量 | 说明 |
68
+ |------|------|
69
+ | `npm_config_registry` | 可选;仅加速 **dlx** 拉包(推荐 `https://registry.npmmirror.com`) |
70
+ | `ADA_REGISTRY_CANDIDATES` | 可选;在默认五镜像**之外**追加候选 |
71
+ | `ADA_NPM_PROXY_REGISTRY` / `ADA_PNPM_PROXY_REGISTRY` | 可选;覆盖探测主候选(默认 npmmirror) |
72
+ | `PLAYWRIGHT_DOWNLOAD_HOST` | 可选;Playwright 浏览器 CDN |
73
+
74
+ 详见 [ADA-MCP-接入手册 §3.9.2](../../docs/ADA-MCP-接入手册.md#392-代理与镜像配置)。
75
+
76
+ **CLI 参数**(写在 MCP `args` 末尾)
77
+
78
+ - `--install-deps=playwright,selenium`
79
+ - `--skip-install-deps`
80
+ - `--install-deps-force`
81
+ - `--geckodriver-version=latest` `--chromedriver-version=match-chrome`
82
+
83
+ 在标准 `args` 后追加,例如安装全部依赖:
84
+
85
+ ```json
86
+ "args": ["dlx", "@ada-mcp/launcher@0.1.12", "--install-deps=all"]
87
+ ```
88
+
89
+ ## Cursor MCP 配置
90
+
91
+ **pnpm(推荐)**:`pnpm` + `dlx @ada-mcp/launcher@0.1.12`
92
+
93
+ **npx 等价**(`launcher@0.1.7+`):`npx` + `-y @ada-mcp/launcher@0.1.12`(内层同样 `npx -y` mcp-server,测速逻辑与 pnpm 一致)
94
+
95
+ ```json
96
+ {
97
+ "mcpServers": {
98
+ "ada-mcp": {
99
+ "command": "npx",
100
+ "args": ["-y", "@ada-mcp/launcher@0.1.12"]
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ Windows 若找不到 `pnpm`,可将 `command` 改为 `pnpm.cmd` 绝对路径;无 pnpm 时只能直接 `npx -y @ada-mcp/mcp-server@0.1.15`(无 launcher 拉包测速)。
107
+
108
+ ## Remote mode
109
+
110
+ Set API key in environment variable first:
111
+
112
+ ```bash
113
+ export ADA_MCP_REMOTE_API_KEY=your_token
114
+ ```
115
+
116
+ Windows PowerShell:
117
+
118
+ ```powershell
119
+ $env:ADA_MCP_REMOTE_API_KEY="your_token"
120
+ ```
121
+
122
+ Then run:
123
+
124
+ ```bash
125
+ pnpm dlx @ada-mcp/mcp-server server --host=127.0.0.1 --port=8787 --allow-risky=true --risky-mode=whitelist --risky-commands=custom
126
+ ```
127
+
128
+ ### Streamable HTTP (`/mcp`)
129
+
130
+ - Endpoint: `http://<host>:<port>/mcp` — same API key headers as below (`x-api-key` or `Authorization: Bearer`).
131
+ - First request: `POST /mcp` with JSON-RPC `initialize` (no `Mcp-Session-Id`); server returns a session id in `Mcp-Session-Id` response header.
132
+ - Follow-up: `POST /mcp` with body + `Mcp-Session-Id`; for server-initiated streaming, open `GET /mcp` with `Accept: text/event-stream` and the same session header.
133
+ - Session teardown: `DELETE /mcp` with `Mcp-Session-Id`.
134
+
135
+ When listening on all interfaces (e.g. `--host=0.0.0.0`), set allowed Host headers to satisfy DNS rebinding checks:
136
+
137
+ ```bash
138
+ pnpm dlx @ada-mcp/mcp-server server --host=0.0.0.0 --port=8787 --api-key=your_token --allowed-hosts=localhost,127.0.0.1
139
+ ```