google-trends-for-agent 0.2.41 → 0.2.42
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/AGENTS.md +16 -15
- package/CHANGELOG.md +11 -0
- package/README.md +16 -14
- package/README.zh-CN.md +16 -14
- package/dist/dsh-client.js +1 -1
- package/docs/clients/claude.md +3 -3
- package/docs/clients/codex.md +3 -3
- package/docs/clients/cursor-vscode.md +1 -1
- package/docs/clients/dots.md +3 -3
- package/docs/clients/openclaw.md +11 -5
- package/docs/reference.md +8 -4
- package/docs/releasing.md +9 -3
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -19,19 +19,21 @@ Prefer **Apify on-demand execution** for cloud/hosted clients (`meka.im/google-t
|
|
|
19
19
|
|
|
20
20
|
Local CLI/stdio is an explicit direct-access or development option. An Apify route can still be blocked or rate-limited; stop that path and report the result rather than switching deployments to get around it.
|
|
21
21
|
|
|
22
|
-
## Install from
|
|
22
|
+
## Install from npm
|
|
23
23
|
|
|
24
|
-
The CLI
|
|
24
|
+
The CLI and MCP server are published on npm as `google-trends-for-agent` and require Node.js 20+.
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
|
-
npx -y -p
|
|
27
|
+
npx -y -p google-trends-for-agent gtfa --help
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
The
|
|
30
|
+
The package installs two commands: `gtfa` (CLI) and `gtfa-mcp` (MCP server; stdio by default, or local Streamable HTTP with `--http --port 4321`). For frequent use, install globally from npm:
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
```sh
|
|
33
|
+
npm install -g google-trends-for-agent
|
|
34
|
+
```
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
Or build from source if installing from a local git checkout:
|
|
35
37
|
|
|
36
38
|
```sh
|
|
37
39
|
git clone https://github.com/meka-im/google-trends-for-agent.git
|
|
@@ -40,14 +42,13 @@ npm ci
|
|
|
40
42
|
npm install -g "$(npm pack | tail -1)"
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
Pin a published npm version or git commit when a review process requires an immutable revision.
|
|
44
46
|
|
|
45
|
-
The
|
|
47
|
+
The published tarball bundles the audited `apify` dependency subtree from the root lock. Scoped npm `overrides` are not inherited when this package is installed as a dependency, so the bundle—not the root override alone—protects consumer installs from re-resolving older Apify transitives. The root pins `@crawlee/core` → `minimatch` to `11.0.8`, outside Crawlee's declared `^9` range; the exact override keeps clean installs aligned with the audited lock when newer releases appear. Consumer `npm ls` may show a range warning even though the override is intentional. Audits cover both the root tree and a clean consumer install of the packed artifact. The bundled tree materially increases package size.
|
|
46
48
|
|
|
47
49
|
## MCP client config
|
|
48
50
|
|
|
49
|
-
For explicitly selected local access, use this generic stdio configuration,
|
|
50
|
-
which follows the repository's `main` branch. Muse, GrokBot and Dots should start
|
|
51
|
+
For explicitly selected local access, use this generic stdio configuration. Muse, GrokBot and Dots should start
|
|
51
52
|
with the [Apify setup](docs/clients.md).
|
|
52
53
|
|
|
53
54
|
```json
|
|
@@ -55,13 +56,13 @@ with the [Apify setup](docs/clients.md).
|
|
|
55
56
|
"mcpServers": {
|
|
56
57
|
"google-trends": {
|
|
57
58
|
"command": "npx",
|
|
58
|
-
"args": ["-y", "-p", "
|
|
59
|
+
"args": ["-y", "-p", "google-trends-for-agent", "gtfa-mcp"]
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
```
|
|
63
64
|
|
|
64
|
-
After
|
|
65
|
+
After a global install (`npm install -g google-trends-for-agent`), use this config (or an absolute path to `gtfa-mcp`) directly without invoking `npx` on every start:
|
|
65
66
|
|
|
66
67
|
```json
|
|
67
68
|
{
|
|
@@ -114,8 +115,8 @@ For explicitly selected local CLI/MCP access, run doctor after install or when
|
|
|
114
115
|
a call fails unexpectedly. It checks that machine's route, not the Apify Actor:
|
|
115
116
|
|
|
116
117
|
```sh
|
|
117
|
-
npx -y -p
|
|
118
|
-
npx -y -p
|
|
118
|
+
npx -y -p google-trends-for-agent gtfa doctor
|
|
119
|
+
npx -y -p google-trends-for-agent gtfa doctor --json
|
|
119
120
|
```
|
|
120
121
|
|
|
121
122
|
It prints PASS/FAIL for Node >= 20, Google Trends reachability, proxy mode, and one live `gpts` US 24h fetch. Exit code 0 means all checks passed.
|
|
@@ -129,7 +130,7 @@ Local CLI/MCP networking is direct by default. If this machine needs a proxy, se
|
|
|
129
130
|
Choose the execution route before querying:
|
|
130
131
|
|
|
131
132
|
1. **Apify Actor (recommended for Muse, GrokBot and Dots).** Choose the public Actor or the user's own deployment, with on-demand execution. Remote MCP connects to Apify's managed gateway; a connector/API, dsh, or `gtfa` / `gtfa-mcp --egress actor-public|actor-own` (with `APIFY_TOKEN`) starts the Actor through the platform API. Runs use the on-platform residential proxy and exit after completing the result. Successful local dsh snapshot-cache hits start no cloud run. Keep Server / Standby disabled. Compute, proxy and storage usage apply; there is no fixed per-call price. A call is capped at 300 seconds of Actor runtime. Caller cancellation should abort its owned run, with the platform timeout as a final bound.
|
|
132
|
-
2. **Your own machine IP (explicit direct access or development).** Run the stdio server locally, or run `npx -y -p
|
|
133
|
+
2. **Your own machine IP (explicit direct access or development).** Run the stdio server locally, or run `npx -y -p google-trends-for-agent gtfa-mcp --http --port 4321` and keep it bound to `127.0.0.1`.
|
|
133
134
|
3. **The platform cloud VM (explicit direct access).** Run the client and server on that VM only when deliberately selected and outbound HTTPS is available. Installing `gtfa-mcp` with default `--egress local` does not route traffic through Apify; pass `--egress actor-public` (or `GTFA_EGRESS=actor-public`) with `APIFY_TOKEN` when routing through Apify from a local stdio/CLI process.
|
|
134
135
|
|
|
135
136
|
| Client capability | Connection |
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.42 — 2026-11-26
|
|
4
|
+
|
|
5
|
+
### npm release & documentation alignment
|
|
6
|
+
- Publish [`google-trends-for-agent`](https://www.npmjs.com/package/google-trends-for-agent) on npm with GitHub Actions provenance (`--provenance --access public` via `.github/workflows/publish-npm.yml`) and add the npm version badge to `README.md` / `README.zh-CN.md`.
|
|
7
|
+
- Update `README.md`, `README.zh-CN.md`, `AGENTS.md`, `docs/reference.md`, and client setup guides (`openclaw.md`, `codex.md`, `claude.md`, `cursor-vscode.md`, `dots.md`) to use `npm install -g google-trends-for-agent` and `npx -y -p google-trends-for-agent`, replacing stale pre-npm instructions.
|
|
8
|
+
- Document the standard `GitHub Release → npm publish → Apify Actor rebuild & health probe` release workflow in `docs/releasing.md`.
|
|
9
|
+
|
|
10
|
+
### Apify Actor resilience (included since 0.2.41)
|
|
11
|
+
- Add automatic Apify proxy session fallback (`RESIDENTIAL` → default Apify Proxy → direct) and bounded transient retries on rotating proxy runs (`src/actor-proxy.ts`, `src/actor.ts`, `src/client.ts`).
|
|
12
|
+
- Add twice-daily and on-demand Apify Actor health check & `UNDER_MAINTENANCE` auto-recovery workflow (`scripts/apify-health.mjs`, `.github/workflows/apify-health.yml`).
|
|
13
|
+
|
|
3
14
|
## 0.2.41 — 2026-11-22
|
|
4
15
|
|
|
5
16
|
### Per-Actor-run billing ledger & dual-view history (dsh)
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">English | <a href="README.zh-CN.md">简体中文</a></p>
|
|
12
12
|
|
|
13
|
-
<p align="center"><a href="https://apify.com/meka.im/google-trends-for-agent"><img src="https://img.shields.io/badge/Apify%20Store-google--trends--for--agent-97D700?style=flat-square" alt="Apify Store"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license"></a> <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen?style=flat-square&logo=node.js&logoColor=white" alt="Node.js >= 20"></a> <img src="https://img.shields.io/badge/TypeScript-strict-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript strict"> <img src="https://img.shields.io/badge/status-unofficial-orange?style=flat-square" alt="Unofficial"></p>
|
|
13
|
+
<p align="center"><a href="https://www.npmjs.com/package/google-trends-for-agent"><img src="https://img.shields.io/npm/v/google-trends-for-agent?style=flat-square&logo=npm&logoColor=white&color=CB3837" alt="npm version"></a> <a href="https://apify.com/meka.im/google-trends-for-agent"><img src="https://img.shields.io/badge/Apify%20Store-google--trends--for--agent-97D700?style=flat-square" alt="Apify Store"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license"></a> <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen?style=flat-square&logo=node.js&logoColor=white" alt="Node.js >= 20"></a> <img src="https://img.shields.io/badge/TypeScript-strict-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript strict"> <img src="https://img.shields.io/badge/status-unofficial-orange?style=flat-square" alt="Unofficial"></p>
|
|
14
14
|
|
|
15
15
|
<p align="center"><a href="https://apify.com/meka.im/google-trends-for-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/store-button-en-dark.png"><img src="docs/assets/store-button-en.png" alt="Open in Apify Store" width="231" height="44"></picture></a></p>
|
|
16
16
|
|
|
@@ -74,17 +74,19 @@ Apify's `full_api_access` OAuth scope grants account-wide API access. Clients wi
|
|
|
74
74
|
|
|
75
75
|
## Install & quick start
|
|
76
76
|
|
|
77
|
-
The CLI
|
|
77
|
+
The CLI and MCP server are published on npm as [`google-trends-for-agent`](https://www.npmjs.com/package/google-trends-for-agent) and require Node.js 20+. Run immediately with `npx`:
|
|
78
78
|
|
|
79
79
|
```sh
|
|
80
|
-
npx -y -p
|
|
80
|
+
npx -y -p google-trends-for-agent gtfa snapshot Sora --geo US --json --pretty
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
For frequent use, install globally from npm:
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
```sh
|
|
86
|
+
npm install -g google-trends-for-agent
|
|
87
|
+
```
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
Or build from source if you prefer a local git checkout:
|
|
88
90
|
|
|
89
91
|
```sh
|
|
90
92
|
git clone https://github.com/meka-im/google-trends-for-agent.git
|
|
@@ -93,9 +95,9 @@ npm ci
|
|
|
93
95
|
npm install -g "$(npm pack | tail -1)"
|
|
94
96
|
```
|
|
95
97
|
|
|
96
|
-
The
|
|
98
|
+
The source checkout tracks the repository's default `main` branch. If your review process requires an immutable source revision, pin a published npm version or git commit rather than relying on a moving branch.
|
|
97
99
|
|
|
98
|
-
The
|
|
100
|
+
The published tarball bundles the audited `apify` dependency tree so a consumer install does not re-resolve older vulnerable Apify transitives. Root npm `overrides` do not propagate into consumers, so this bundle is part of the consumer protection. The root also applies an explicit `@crawlee/core` → `minimatch` `^11.0.1` security override (lock: `11.0.8`); Crawlee declares `^9`, so consumer `npm ls` may show a range warning even though the explicit override is intentional. Audits cover both the root tree and a clean install of the packed artifact. Bundling materially increases package size.
|
|
99
101
|
|
|
100
102
|
The CLI is `gtfa`; `gtfa-mcp` runs the local MCP server. Both default to `local` egress (this machine's network) and also support Apify on-demand cloud egress (`--egress actor-public` or `--egress actor-own --actor <id>`, or `GTFA_EGRESS` / `GTFA_APIFY_ACTOR` with `APIFY_TOKEN`), giving direct access to the four `trends_*` tools through Apify's residential proxy. For managed remote MCP without a local Node process, Muse, GrokBot and Dots should start with the [Apify setup](docs/clients.md):
|
|
101
103
|
|
|
@@ -104,7 +106,7 @@ The CLI is `gtfa`; `gtfa-mcp` runs the local MCP server. Both default to `local`
|
|
|
104
106
|
"mcpServers": {
|
|
105
107
|
"google-trends": {
|
|
106
108
|
"command": "npx",
|
|
107
|
-
"args": ["-y", "-p", "
|
|
109
|
+
"args": ["-y", "-p", "google-trends-for-agent", "gtfa-mcp"]
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
112
|
}
|
|
@@ -117,14 +119,14 @@ To route local stdio MCP or CLI calls through Apify's public Actor with `APIFY_T
|
|
|
117
119
|
"mcpServers": {
|
|
118
120
|
"google-trends": {
|
|
119
121
|
"command": "npx",
|
|
120
|
-
"args": ["-y", "-p", "
|
|
122
|
+
"args": ["-y", "-p", "google-trends-for-agent", "gtfa-mcp", "--egress", "actor-public"],
|
|
121
123
|
"env": { "APIFY_TOKEN": "<your-apify-token>" }
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
```
|
|
126
128
|
|
|
127
|
-
After
|
|
129
|
+
After a global install (`npm install -g google-trends-for-agent`), use this config (or an absolute path to `gtfa-mcp`) directly without invoking `npx` on every start:
|
|
128
130
|
|
|
129
131
|
```json
|
|
130
132
|
{
|
|
@@ -135,17 +137,17 @@ After the persistent install, use this config (or an absolute path to `gtfa-mcp`
|
|
|
135
137
|
For a local **Streamable HTTP** endpoint (bound to `127.0.0.1`):
|
|
136
138
|
|
|
137
139
|
```sh
|
|
138
|
-
npx -y -p
|
|
140
|
+
npx -y -p google-trends-for-agent gtfa-mcp --http --port 4321 # http://127.0.0.1:4321/mcp
|
|
139
141
|
```
|
|
140
142
|
|
|
141
143
|
Check both package-download and data-fetch connectivity:
|
|
142
144
|
|
|
143
145
|
```sh
|
|
144
|
-
curl -I https://
|
|
146
|
+
curl -I https://registry.npmjs.org
|
|
145
147
|
curl -I https://trends.google.com
|
|
146
148
|
```
|
|
147
149
|
|
|
148
|
-
If `npx …` exits
|
|
150
|
+
If `npx …` exits non-zero with empty stdout/stderr, the npm package fetch failed before gtfa started; inspect the npm debug log (typically `~/.npm/_logs/`). **MCP fails to start** means npx/npm errors or EOF before the handshake. **MCP started but a tool fetch failed** means the handshake and `tools/list` succeed, but the tool returns `NETWORK_ERROR`, `RATE_LIMITED`, or another upstream error. Use `gtfa doctor --json` for the latter.
|
|
149
151
|
|
|
150
152
|
## dsh plugin
|
|
151
153
|
|
package/README.zh-CN.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center"><a href="README.md">English</a> | 简体中文</p>
|
|
12
12
|
|
|
13
|
-
<p align="center"><a href="https://apify.com/meka.im/google-trends-for-agent"><img src="https://img.shields.io/badge/Apify%20Store-google--trends--for--agent-97D700?style=flat-square" alt="Apify Store"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license"></a> <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen?style=flat-square&logo=node.js&logoColor=white" alt="Node.js >= 20"></a> <img src="https://img.shields.io/badge/TypeScript-strict-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript strict"> <img src="https://img.shields.io/badge/status-unofficial-orange?style=flat-square" alt="Unofficial"></p>
|
|
13
|
+
<p align="center"><a href="https://www.npmjs.com/package/google-trends-for-agent"><img src="https://img.shields.io/npm/v/google-trends-for-agent?style=flat-square&logo=npm&logoColor=white&color=CB3837" alt="npm version"></a> <a href="https://apify.com/meka.im/google-trends-for-agent"><img src="https://img.shields.io/badge/Apify%20Store-google--trends--for--agent-97D700?style=flat-square" alt="Apify Store"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license"></a> <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen?style=flat-square&logo=node.js&logoColor=white" alt="Node.js >= 20"></a> <img src="https://img.shields.io/badge/TypeScript-strict-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript strict"> <img src="https://img.shields.io/badge/status-unofficial-orange?style=flat-square" alt="Unofficial"></p>
|
|
14
14
|
|
|
15
15
|
<p align="center"><a href="https://apify.com/meka.im/google-trends-for-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/store-button-zh-dark.png"><img src="docs/assets/store-button-zh.png" alt="在 Apify Store 打开" width="224" height="44"></picture></a></p>
|
|
16
16
|
|
|
@@ -72,17 +72,19 @@ Apify OAuth 的 `full_api_access` 是完整账号 API 权限。没有 MCP OAuth
|
|
|
72
72
|
|
|
73
73
|
## 安装与快速开始
|
|
74
74
|
|
|
75
|
-
CLI
|
|
75
|
+
CLI 与 MCP 服务器已发布至 npm(包名 [`google-trends-for-agent`](https://www.npmjs.com/package/google-trends-for-agent)),需要 Node.js 20+。可直接通过 `npx` 运行:
|
|
76
76
|
|
|
77
77
|
```sh
|
|
78
|
-
npx -y -p
|
|
78
|
+
npx -y -p google-trends-for-agent gtfa snapshot Sora --geo US --json --pretty
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
频繁使用建议直接从 npm 全局安装:
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
```sh
|
|
84
|
+
npm install -g google-trends-for-agent
|
|
85
|
+
```
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
也可以从源码仓库自行构建安装:
|
|
86
88
|
|
|
87
89
|
```sh
|
|
88
90
|
git clone https://github.com/meka-im/google-trends-for-agent.git
|
|
@@ -91,9 +93,9 @@ npm ci
|
|
|
91
93
|
npm install -g "$(npm pack | tail -1)"
|
|
92
94
|
```
|
|
93
95
|
|
|
94
|
-
clone 默认跟随仓库的 `main`
|
|
96
|
+
源码 clone 默认跟随仓库的 `main` 分支。如果审查流程需要不可变源码版本,请固定 npm 版本号或 git commit,不要依赖移动的分支。
|
|
95
97
|
|
|
96
|
-
|
|
98
|
+
发布的 tarball 会内置经审计的 `apify` 依赖树,避免 consumer 重新解析较旧的 Apify 漏洞传递依赖。根 npm `overrides` 不会传播给 consumer,因此内置依赖树是 consumer 防护的一部分。根包还显式将 `@crawlee/core` 的 `minimatch` 覆盖为 `^11.0.1`(lock 为 `11.0.8`);Crawlee 声明的是 `^9`,因此 consumer 的 `npm ls` 可能显示范围警告,但这是有意设置的安全 override。审计同时覆盖根依赖树和打包产物在干净 consumer 中的安装;内置依赖会使包体积明显增大。
|
|
97
99
|
|
|
98
100
|
CLI 命令是 `gtfa`,本地 MCP 服务器由 `gtfa-mcp` 启动。两者默认走 `local` 本机网络,也支持 Apify 按需云端出口(`--egress actor-public` 或 `--egress actor-own --actor <id>`,或通过环境变量 `GTFA_EGRESS` / `GTFA_APIFY_ACTOR` 配合 `APIFY_TOKEN`),可在直接暴露四个 `trends_*` 工具的同时走 Apify 住宅代理。若客户端支持免本地进程的远程托管 MCP,Muse、GrokBot、Dots 优先按[Apify 接入指南](docs/clients.md)配置:
|
|
99
101
|
|
|
@@ -102,7 +104,7 @@ CLI 命令是 `gtfa`,本地 MCP 服务器由 `gtfa-mcp` 启动。两者默认
|
|
|
102
104
|
"mcpServers": {
|
|
103
105
|
"google-trends": {
|
|
104
106
|
"command": "npx",
|
|
105
|
-
"args": ["-y", "-p", "
|
|
107
|
+
"args": ["-y", "-p", "google-trends-for-agent", "gtfa-mcp"]
|
|
106
108
|
}
|
|
107
109
|
}
|
|
108
110
|
}
|
|
@@ -115,14 +117,14 @@ CLI 命令是 `gtfa`,本地 MCP 服务器由 `gtfa-mcp` 启动。两者默认
|
|
|
115
117
|
"mcpServers": {
|
|
116
118
|
"google-trends": {
|
|
117
119
|
"command": "npx",
|
|
118
|
-
"args": ["-y", "-p", "
|
|
120
|
+
"args": ["-y", "-p", "google-trends-for-agent", "gtfa-mcp", "--egress", "actor-public"],
|
|
119
121
|
"env": { "APIFY_TOKEN": "<your-apify-token>" }
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
125
|
```
|
|
124
126
|
|
|
125
|
-
|
|
127
|
+
全局安装(`npm install -g google-trends-for-agent`)后可直接使用下面的配置(或 `gtfa-mcp` 的绝对路径),无需每次启动都由 `npx` 解析:
|
|
126
128
|
|
|
127
129
|
```json
|
|
128
130
|
{
|
|
@@ -133,17 +135,17 @@ CLI 命令是 `gtfa`,本地 MCP 服务器由 `gtfa-mcp` 启动。两者默认
|
|
|
133
135
|
本地 **Streamable HTTP** 端点(仅绑定 `127.0.0.1`):
|
|
134
136
|
|
|
135
137
|
```sh
|
|
136
|
-
npx -y -p
|
|
138
|
+
npx -y -p google-trends-for-agent gtfa-mcp --http --port 4321 # http://127.0.0.1:4321/mcp
|
|
137
139
|
```
|
|
138
140
|
|
|
139
141
|
检查包下载和数据抓取两段连通性:
|
|
140
142
|
|
|
141
143
|
```sh
|
|
142
|
-
curl -I https://
|
|
144
|
+
curl -I https://registry.npmjs.org
|
|
143
145
|
curl -I https://trends.google.com
|
|
144
146
|
```
|
|
145
147
|
|
|
146
|
-
若 `npx …`
|
|
148
|
+
若 `npx …` 非零退出且 stdout/stderr 为空,说明 gtfa 启动前 npm 包获取失败;查看 npm debug 日志(通常在 `~/.npm/_logs/`)。**MCP 无法启动**表现为 npx/npm 错误、握手前 EOF;**MCP 已启动但工具取数失败**则握手和 `tools/list` 成功,工具返回 `NETWORK_ERROR`、`RATE_LIMITED` 等上游错误。后者可用 `gtfa doctor --json` 排查。
|
|
147
149
|
|
|
148
150
|
## dsh 插件
|
|
149
151
|
|
package/dist/dsh-client.js
CHANGED
|
@@ -2141,7 +2141,7 @@ function parseVersionStatus(value) {
|
|
|
2141
2141
|
|
|
2142
2142
|
// src/client/update-banner.tsx
|
|
2143
2143
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
2144
|
-
var CLIENT_VERSION = "0.2.
|
|
2144
|
+
var CLIENT_VERSION = "0.2.42" ? "0.2.42" : null;
|
|
2145
2145
|
var VERSION_URL = "api/gtfa.version";
|
|
2146
2146
|
var DISMISS_STORAGE_KEY = "gtfa.update.dismissed.1";
|
|
2147
2147
|
function template2(text2, values) {
|
package/docs/clients/claude.md
CHANGED
|
@@ -27,7 +27,7 @@ Requires **Node.js >= 20**. Add to Claude Desktop's `claude_desktop_config.json`
|
|
|
27
27
|
"mcpServers": {
|
|
28
28
|
"google-trends": {
|
|
29
29
|
"command": "npx",
|
|
30
|
-
"args": ["-y", "-p", "
|
|
30
|
+
"args": ["-y", "-p", "google-trends-for-agent", "gtfa-mcp", "--egress", "actor-public"],
|
|
31
31
|
"env": {
|
|
32
32
|
"APIFY_TOKEN": "<your-apify-token>"
|
|
33
33
|
}
|
|
@@ -43,7 +43,7 @@ Requires **Node.js >= 20**. Add to Claude Desktop's `claude_desktop_config.json`
|
|
|
43
43
|
"mcpServers": {
|
|
44
44
|
"google-trends": {
|
|
45
45
|
"command": "npx",
|
|
46
|
-
"args": ["-y", "-p", "
|
|
46
|
+
"args": ["-y", "-p", "google-trends-for-agent", "gtfa-mcp"]
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -51,4 +51,4 @@ Requires **Node.js >= 20**. Add to Claude Desktop's `claude_desktop_config.json`
|
|
|
51
51
|
|
|
52
52
|
Restart Claude Desktop after saving. This exposes `trends_ask`, `trends_snapshot`, `trends_compare` (with `calibrate: true`), and `trends_now` directly, defaulting to `US` / `now 7-d` with MEKA v1 baselines.
|
|
53
53
|
|
|
54
|
-
>
|
|
54
|
+
> For instant startup without `npx`, install globally (`npm install -g google-trends-for-agent`) as shown in the [OpenClaw & CLI guide](openclaw.md#persistent-install-recommended-for-frequent-use) and set `"command": "gtfa-mcp"`.
|
package/docs/clients/codex.md
CHANGED
|
@@ -23,12 +23,12 @@ Requires **Node.js >= 20**. Add a local stdio server with optional Apify cloud e
|
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
25
|
# Direct from this machine:
|
|
26
|
-
codex mcp add google-trends -- npx -y -p
|
|
26
|
+
codex mcp add google-trends -- npx -y -p google-trends-for-agent gtfa-mcp
|
|
27
27
|
|
|
28
28
|
# Or route through Apify's public Actor residential proxy (set APIFY_TOKEN in env):
|
|
29
|
-
codex mcp add google-trends --env APIFY_TOKEN -- npx -y -p
|
|
29
|
+
codex mcp add google-trends --env APIFY_TOKEN -- npx -y -p google-trends-for-agent gtfa-mcp --egress actor-public
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Local stdio exposes `trends_ask`, `trends_snapshot`, `trends_compare` (with `calibrate: true`), and `trends_now` directly, defaulting to `US` / `now 7-d` with MEKA v1 baselines.
|
|
33
33
|
|
|
34
|
-
>
|
|
34
|
+
> For instant startup without `npx`, install globally (`npm install -g google-trends-for-agent`) as shown in the [OpenClaw & CLI guide](openclaw.md#persistent-install-recommended-for-frequent-use) and register `gtfa-mcp` directly.
|
|
@@ -51,7 +51,7 @@ Requires **Node.js >= 20**. Gives direct access to `trends_ask`, `trends_snapsho
|
|
|
51
51
|
"mcpServers": {
|
|
52
52
|
"google-trends": {
|
|
53
53
|
"command": "npx",
|
|
54
|
-
"args": ["-y", "-p", "
|
|
54
|
+
"args": ["-y", "-p", "google-trends-for-agent", "gtfa-mcp", "--egress", "actor-public"],
|
|
55
55
|
"env": {
|
|
56
56
|
"APIFY_TOKEN": "<your-apify-token>"
|
|
57
57
|
}
|
package/docs/clients/dots.md
CHANGED
|
@@ -24,7 +24,7 @@ If your Dots environment exposes local MCP configuration or Codex CLI, follow th
|
|
|
24
24
|
"mcpServers": {
|
|
25
25
|
"google-trends": {
|
|
26
26
|
"command": "npx",
|
|
27
|
-
"args": ["-y", "-p", "
|
|
27
|
+
"args": ["-y", "-p", "google-trends-for-agent", "gtfa-mcp", "--egress", "actor-public"],
|
|
28
28
|
"env": { "APIFY_TOKEN": "<your-apify-token>" }
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -39,7 +39,7 @@ If the host has **no** remote MCP UI and **no** OAuth capability, do not loop on
|
|
|
39
39
|
|
|
40
40
|
- **If `APIFY_TOKEN` is available in the sandbox's secret environment:** run the CLI with cloud egress:
|
|
41
41
|
```sh
|
|
42
|
-
npx -y -p
|
|
43
|
-
npx -y -p
|
|
42
|
+
npx -y -p google-trends-for-agent gtfa snapshot Sora --geo US --egress actor-public --json --pretty
|
|
43
|
+
npx -y -p google-trends-for-agent gtfa compare ChatGPT Claude Gemini --geo US --calibrate --egress actor-public --json --pretty
|
|
44
44
|
```
|
|
45
45
|
- **If no `APIFY_TOKEN` is configured:** inform the user that remote OAuth cannot be initiated inside this chat turn and ask them to either connect `https://mcp.apify.com?tools=meka.im/google-trends-for-agent` in host settings or explicitly authorize a direct local test (`--egress local`, noting cloud VM IPs may hit Google Trends `RATE_LIMITED` / `BLOCKED`).
|
package/docs/clients/openclaw.md
CHANGED
|
@@ -8,18 +8,24 @@ Use this guide for **OpenClaw**, custom agent frameworks, shell-driven bots, and
|
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
10
|
# Direct from this machine (default: US, now 7-d, MEKA v1 baselines):
|
|
11
|
-
npx -y -p
|
|
11
|
+
npx -y -p google-trends-for-agent gtfa snapshot Sora --geo US --json --pretty
|
|
12
12
|
|
|
13
13
|
# Compare 1–5 keywords with multi-tier MEKA search-volume estimation:
|
|
14
|
-
npx -y -p
|
|
14
|
+
npx -y -p google-trends-for-agent gtfa compare ChatGPT Claude Gemini --geo US --calibrate --json --pretty
|
|
15
15
|
|
|
16
16
|
# Route through Apify's public Actor residential proxy (recommended for cloud VMs):
|
|
17
|
-
APIFY_TOKEN=<your-token> npx -y -p
|
|
17
|
+
APIFY_TOKEN=<your-token> npx -y -p google-trends-for-agent gtfa snapshot Sora --geo US --egress actor-public --json --pretty
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
## Persistent install (recommended for frequent use
|
|
20
|
+
## Persistent install (recommended for frequent use)
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Install globally from npm for instant startup:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install -g google-trends-for-agent
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or build from a local source checkout:
|
|
23
29
|
|
|
24
30
|
```sh
|
|
25
31
|
git clone https://github.com/meka-im/google-trends-for-agent.git
|
package/docs/reference.md
CHANGED
|
@@ -4,9 +4,13 @@ Operational detail for the CLI, the MCP server, the dsh plugin, and the numbers
|
|
|
4
4
|
|
|
5
5
|
## CLI surface
|
|
6
6
|
|
|
7
|
-
The package installs `gtfa` for the CLI and `gtfa-mcp` for the MCP server.
|
|
7
|
+
The package installs `gtfa` for the CLI and `gtfa-mcp` for the MCP server (Node.js 20+). Use `npx -y -p google-trends-for-agent` for zero-install execution, or install globally from npm:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```sh
|
|
10
|
+
npm install -g google-trends-for-agent
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or build from a local source checkout:
|
|
10
14
|
|
|
11
15
|
```sh
|
|
12
16
|
git clone https://github.com/meka-im/google-trends-for-agent.git
|
|
@@ -15,7 +19,7 @@ npm ci
|
|
|
15
19
|
npm install -g "$(npm pack | tail -1)"
|
|
16
20
|
```
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
Pin a published npm version or git commit if a review process requires an immutable source revision.
|
|
19
23
|
|
|
20
24
|
| Command | Flags | Purpose |
|
|
21
25
|
| --- | --- | --- |
|
|
@@ -26,7 +30,7 @@ The clone follows the repository's default `main` branch. If a review process ne
|
|
|
26
30
|
| `gtfa baselines` | `--sync`, `--store DIR`, `--json`, `--pretty`, `--help` | Inspect active MEKA v1 calibration baselines status or manually sync from `meka.im`. |
|
|
27
31
|
| `gtfa doctor` | `--timeout MS`, `--json`, `--pretty`, `--help` | Checks Node.js >= 20, Google Trends reachability, proxy mode, and one live `gpts` US 24h fetch. `--timeout` accepts 1000–60000 and defaults to 8000 ms for each network check; a challenge or HTTP 429 skips the live fetch. Exit 0 only when all checks pass. |
|
|
28
32
|
|
|
29
|
-
Examples below assume a global `gtfa`; without one, replace `gtfa` with `npx -y -p
|
|
33
|
+
Examples below assume a global `gtfa`; without one, replace `gtfa` with `npx -y -p google-trends-for-agent gtfa`. `--types` accepts `interestOverTime`, `interestByCity`, `interestByMetro`, `interestBySubregion`, `relatedQueries`, or `relatedTopics`. `--start` and `--end` must be used together; do not combine Explore URLs with `--query`. Defaults are US, `now 7-d`, web, category 0, except where a command says otherwise. `compare` and the default `--query` mode honor omitted `geo`, `time`, `category`, `property`, and `locale` (`hl`) from `gtfa.config.json`; `GTFA_GEO` and `GTFA_TIME` supply their respective environment defaults. Explore URL plans keep the URL's filters, and explicit dates keep their dates. Chart time zones resolve as explicit `--tz` / `tz`, then `GTFA_TZ`, then `UTC`.
|
|
30
34
|
|
|
31
35
|
```sh
|
|
32
36
|
gtfa ask "nano banana" --validate --diff --json
|
package/docs/releasing.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Release and acceptance
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
`google-trends-for-agent` is published on [npm](https://www.npmjs.com/package/google-trends-for-agent) and [Apify Store](https://apify.com/meka.im/google-trends-for-agent). Use one source commit and one tarball for the checks below; record their SHA-256, package version, Node version, client version and actual execution path.
|
|
4
|
+
|
|
5
|
+
## Standard release flow (GitHub → npm → Apify)
|
|
6
|
+
|
|
7
|
+
1. **Sync versions and documentation.** Update `package.json`, `package-lock.json` (root and `packages[""]`), `.actor/actor.json`, and `CHANGELOG.md` to the target `x.y.z` version. Verify `README.md`, `README.zh-CN.md`, `AGENTS.md`, and `docs/clients/*.md` reflect the current install/usage instructions—remember that the npm package page displays the `README.md` packed at release time.
|
|
8
|
+
2. **PR and CI gate.** Push a branch and open a pull request into `main`. Confirm all checks in `CI required` (Node 20 & 24, `check:docs`, `npm audit`, `check:package`, and `test:compat`) pass before merging.
|
|
9
|
+
3. **Publish GitHub Release `v<x.y.z>`.** Creating and publishing the GitHub Release from `main` automatically triggers `.github/workflows/publish-npm.yml`, which re-runs all verification checks and publishes `--provenance --access public` to npm (via `NPM_TOKEN` or Trusted Publishing).
|
|
10
|
+
4. **Rebuild Apify Public Actor and probe health.** Rebuild `meka.im/google-trends-for-agent` (assigning `latest` tag), then run `.github/workflows/apify-health.yml` (`force_probe=true`) to verify live execution and `notice: NONE`.
|
|
11
|
+
5. **Post-release verification.** Confirm `https://registry.npmjs.org/google-trends-for-agent` serves `latest: x.y.z` with provenance attestations and updated README, Apify `GTFA_RUNTIME` reports `x.y.z`, and GitHub repo homepage/topics match.
|
|
6
12
|
|
|
7
13
|
## Local gate
|
|
8
14
|
|