mcp-trendpulse 0.2.10__tar.gz

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 (49) hide show
  1. mcp_trendpulse-0.2.10/LICENSE +21 -0
  2. mcp_trendpulse-0.2.10/PKG-INFO +352 -0
  3. mcp_trendpulse-0.2.10/README.md +324 -0
  4. mcp_trendpulse-0.2.10/pyproject.toml +65 -0
  5. mcp_trendpulse-0.2.10/setup.cfg +4 -0
  6. mcp_trendpulse-0.2.10/src/mcp_trendpulse/__init__.py +3 -0
  7. mcp_trendpulse-0.2.10/src/mcp_trendpulse/__main__.py +5 -0
  8. mcp_trendpulse-0.2.10/src/mcp_trendpulse/asgi.py +155 -0
  9. mcp_trendpulse-0.2.10/src/mcp_trendpulse/auth.py +35 -0
  10. mcp_trendpulse-0.2.10/src/mcp_trendpulse/cli.py +136 -0
  11. mcp_trendpulse-0.2.10/src/mcp_trendpulse/config.py +181 -0
  12. mcp_trendpulse-0.2.10/src/mcp_trendpulse/digestseo.py +204 -0
  13. mcp_trendpulse-0.2.10/src/mcp_trendpulse/errors.py +89 -0
  14. mcp_trendpulse-0.2.10/src/mcp_trendpulse/hosted.py +721 -0
  15. mcp_trendpulse-0.2.10/src/mcp_trendpulse/middleware.py +30 -0
  16. mcp_trendpulse-0.2.10/src/mcp_trendpulse/news.py +1100 -0
  17. mcp_trendpulse-0.2.10/src/mcp_trendpulse/observability.py +29 -0
  18. mcp_trendpulse-0.2.10/src/mcp_trendpulse/providers.py +418 -0
  19. mcp_trendpulse-0.2.10/src/mcp_trendpulse/server.py +830 -0
  20. mcp_trendpulse-0.2.10/src/mcp_trendpulse.egg-info/PKG-INFO +352 -0
  21. mcp_trendpulse-0.2.10/src/mcp_trendpulse.egg-info/SOURCES.txt +47 -0
  22. mcp_trendpulse-0.2.10/src/mcp_trendpulse.egg-info/dependency_links.txt +1 -0
  23. mcp_trendpulse-0.2.10/src/mcp_trendpulse.egg-info/entry_points.txt +3 -0
  24. mcp_trendpulse-0.2.10/src/mcp_trendpulse.egg-info/requires.txt +13 -0
  25. mcp_trendpulse-0.2.10/src/mcp_trendpulse.egg-info/top_level.txt +1 -0
  26. mcp_trendpulse-0.2.10/tests/test_article_content_summarization.py +129 -0
  27. mcp_trendpulse-0.2.10/tests/test_article_json_export.py +69 -0
  28. mcp_trendpulse-0.2.10/tests/test_article_processing_concurrency.py +135 -0
  29. mcp_trendpulse-0.2.10/tests/test_article_url_validation.py +333 -0
  30. mcp_trendpulse-0.2.10/tests/test_browser_manager.py +106 -0
  31. mcp_trendpulse-0.2.10/tests/test_browser_settings.py +20 -0
  32. mcp_trendpulse-0.2.10/tests/test_chatgpt_plugin_package.py +78 -0
  33. mcp_trendpulse-0.2.10/tests/test_cli.py +63 -0
  34. mcp_trendpulse-0.2.10/tests/test_digestseo_context.py +176 -0
  35. mcp_trendpulse-0.2.10/tests/test_hosted_facade.py +418 -0
  36. mcp_trendpulse-0.2.10/tests/test_hosted_runtime_validation.py +139 -0
  37. mcp_trendpulse-0.2.10/tests/test_news_client_isolation.py +88 -0
  38. mcp_trendpulse-0.2.10/tests/test_observability.py +41 -0
  39. mcp_trendpulse-0.2.10/tests/test_provider_boundary.py +187 -0
  40. mcp_trendpulse-0.2.10/tests/test_provider_errors.py +107 -0
  41. mcp_trendpulse-0.2.10/tests/test_registry_manifests.py +37 -0
  42. mcp_trendpulse-0.2.10/tests/test_remote_asgi.py +152 -0
  43. mcp_trendpulse-0.2.10/tests/test_remote_auth.py +262 -0
  44. mcp_trendpulse-0.2.10/tests/test_server.py +474 -0
  45. mcp_trendpulse-0.2.10/tests/test_startup_environment.py +35 -0
  46. mcp_trendpulse-0.2.10/tests/test_tool_metadata.py +42 -0
  47. mcp_trendpulse-0.2.10/tests/test_trending_term_volumes.py +43 -0
  48. mcp_trendpulse-0.2.10/tests/test_trends_provider_settings.py +75 -0
  49. mcp_trendpulse-0.2.10/tests/test_trends_windows.py +43 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tomi Šeregi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,352 @@
1
+ Metadata-Version: 2.4
2
+ Name: mcp-trendpulse
3
+ Version: 0.2.10
4
+ Summary: MCP server for Google News research and Google Trends analysis
5
+ Author: Tomi Šeregi
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/AKzar1el/mcp-trendpulse
8
+ Project-URL: Repository, https://github.com/AKzar1el/mcp-trendpulse
9
+ Project-URL: Issues, https://github.com/AKzar1el/mcp-trendpulse/issues
10
+ Keywords: google,news,rss,trends,mcp,fastmcp,llm,nlp
11
+ Requires-Python: >=3.10.18
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: click>=8.2.1
15
+ Requires-Dist: cloudscraper>=1.2.71
16
+ Requires-Dist: fastmcp>=3
17
+ Requires-Dist: gnews>=0.4.1
18
+ Requires-Dist: googlenewsdecoder>=0.1.7
19
+ Requires-Dist: lxml[html-clean]>=6.1.1
20
+ Requires-Dist: newspaper4k>=0.9.6
21
+ Requires-Dist: nltk>=3.9.4
22
+ Requires-Dist: pandas>=2.3.0
23
+ Requires-Dist: playwright>=1.53.0
24
+ Requires-Dist: pydantic>=2.12.0
25
+ Requires-Dist: python-dotenv>=1.0.1
26
+ Requires-Dist: trendspy>=0.1.6
27
+ Dynamic: license-file
28
+
29
+ # mcp-trendpulse
30
+
31
+ [![MCP](https://img.shields.io/badge/Model%20Context%20Protocol-MCP-blue.svg)](https://modelcontextprotocol.io)
32
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-blue.svg)](https://www.python.org/)
33
+ [![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
34
+ [![mcp-trendpulse MCP server](https://glama.ai/mcp/servers/AKzar1el/mcp-trendpulse/badges/score.svg)](https://glama.ai/mcp/servers/AKzar1el/mcp-trendpulse)
35
+
36
+ **TrendPulse** is a Python Model Context Protocol (MCP) server for researching current news and search-interest trends. It combines Google News discovery and article extraction with Google Trends analysis so MCP clients can inspect what is trending, compare keyword momentum, explore related demand, and add current-news context to research workflows.
37
+
38
+ The project currently ships as a **community/self-hosted MCP server** and also contains the implementation for a separate **hosted TrendPulse by DigestSEO** surface for remote MCP clients such as ChatGPT and Codex. The hosted layer uses a smaller, goal-oriented tool surface while the community server keeps the full low-level research toolkit available to developers.
39
+
40
+ > **Project status:** the local/community server is usable today. The DigestSEO-hosted MCP and public OpenAI plugin are not released yet and should not be treated as available endpoints.
41
+
42
+ Engineering context: TrendPulse is part of the [DigestSEO](https://digestseo.com/) MCP ecosystem. It complements [mcp-gsc](https://digestseo.com/gsc-mcp/) for Google Search Console data, [mcp-geo](https://digestseo.com/geo-mcp/) for AI visibility, and [mcp-web-validator](https://digestseo.com/validator-mcp/) for technical web validation. The broader architecture is documented in the [DigestSEO MCP Suite engineering case study](https://tomiseregi.si/projects/digestseo-mcp-suite).
43
+
44
+ ## What TrendPulse can do
45
+
46
+ ### News research
47
+
48
+ - Search Google News by keyword, location, topic, or publisher domain.
49
+ - Retrieve top news stories.
50
+ - Resolve Google News links and extract article content.
51
+ - Fall back from normal HTTP retrieval to Playwright/Chromium for difficult pages.
52
+ - Optionally summarize article text with MCP client sampling, with local NLP as a fallback.
53
+
54
+ ### Trend research
55
+
56
+ - Retrieve current trending terms for a geographic market.
57
+ - Pull Google Trends interest-over-time data for one or more keywords.
58
+ - Calculate keyword growth over custom windows such as 3M or 1Y.
59
+ - Rank live trends by volume or growth.
60
+ - Inspect interest by country, region, city, or DMA where supported.
61
+ - Explore related queries, related topics, suggestions, and category IDs.
62
+ - Compare Google Search, YouTube Search, News Search, Image Search, and Google Shopping trend properties where supported by the underlying provider.
63
+
64
+ ## Community and hosted architecture
65
+
66
+ TrendPulse is being developed with two deliberate surfaces:
67
+
68
+ | Surface | Purpose | Status |
69
+ | --- | --- | --- |
70
+ | **Community MCP** | Full Python MCP server for local use, development, self-hosting, and integrations with MCP-compatible clients. | Available in this repository |
71
+ | **TrendPulse by DigestSEO** | Managed remote MCP for ChatGPT/Codex and a future public OpenAI plugin with a smaller, task-oriented tool surface. | In development |
72
+
73
+ The community server remains useful independently. The hosted edition will reuse the same core trend-research concepts while adding the deployment, reliability, authentication, observability, and product integration needed for a managed service.
74
+
75
+ The implemented hosted tool surface is intentionally higher level than the community API and centers on goals such as:
76
+
77
+ - `discover_trends`
78
+ - `analyze_keyword_trend`
79
+ - `compare_keyword_trends`
80
+ - `discover_related_demand`
81
+ - `get_trend_context`
82
+ - `find_seo_opportunities`
83
+
84
+ These names describe the hosted ChatGPT Apps/MCP interface; they remain separate from the current Community MCP tool names.
85
+
86
+ ## Installation
87
+
88
+ ### Run directly from GitHub with `uvx` (recommended)
89
+
90
+ The package is not yet published to PyPI, so the most direct installation path is:
91
+
92
+ ```bash
93
+ uvx --from git+https://github.com/AKzar1el/mcp-trendpulse.git mcp-trendpulse
94
+ ```
95
+
96
+ After a PyPI release exists, the shorter form will be:
97
+
98
+ ```bash
99
+ uvx mcp-trendpulse
100
+ ```
101
+
102
+ ### Install with pip from a checkout
103
+
104
+ ```bash
105
+ git clone https://github.com/AKzar1el/mcp-trendpulse.git
106
+ cd mcp-trendpulse
107
+ python -m pip install .
108
+ python -m mcp_trendpulse
109
+ ```
110
+
111
+ ## Browser fallback
112
+
113
+ News/article tools can fall back to Playwright when ordinary retrieval cannot extract a usable article. Installing the Python `playwright` package does not install Chromium automatically.
114
+
115
+ For local use:
116
+
117
+ ```bash
118
+ playwright install chromium
119
+ ```
120
+
121
+ For Linux environments that also require browser system dependencies:
122
+
123
+ ```bash
124
+ playwright install --with-deps chromium
125
+ ```
126
+
127
+ Trend-only operations do not inherently require Chromium.
128
+
129
+ ## Client configuration
130
+
131
+ ### Claude Desktop
132
+
133
+ Using `uvx` directly from GitHub:
134
+
135
+ ```json
136
+ {
137
+ "mcpServers": {
138
+ "mcp-trendpulse": {
139
+ "command": "uvx",
140
+ "args": [
141
+ "--from",
142
+ "git+https://github.com/AKzar1el/mcp-trendpulse.git",
143
+ "mcp-trendpulse"
144
+ ]
145
+ }
146
+ }
147
+ }
148
+ ```
149
+
150
+ ### VS Code
151
+
152
+ ```json
153
+ {
154
+ "mcp": {
155
+ "servers": {
156
+ "mcp-trendpulse": {
157
+ "command": "uvx",
158
+ "args": [
159
+ "--from",
160
+ "git+https://github.com/AKzar1el/mcp-trendpulse.git",
161
+ "mcp-trendpulse"
162
+ ]
163
+ }
164
+ }
165
+ }
166
+ }
167
+ ```
168
+
169
+ ### Cursor
170
+
171
+ Cursor supports global and project MCP configuration. Add the server to the relevant `mcp.json` configuration:
172
+
173
+ ```json
174
+ {
175
+ "mcpServers": {
176
+ "mcp-trendpulse": {
177
+ "command": "uvx",
178
+ "args": [
179
+ "--from",
180
+ "git+https://github.com/AKzar1el/mcp-trendpulse.git",
181
+ "mcp-trendpulse"
182
+ ]
183
+ }
184
+ }
185
+ }
186
+ ```
187
+
188
+ ### Kiro
189
+
190
+ [![Add to Kiro](https://kiro.dev/images/add-to-kiro.svg)](https://kiro.dev/launch/mcp/add?name=mcp-trendpulse&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22--from%22%2C%22git%2Bhttps%3A%2F%2Fgithub.com%2FAKzar1el%2Fmcp-trendpulse.git%22%2C%22mcp-trendpulse%22%5D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D)
191
+
192
+ Requires `uv`/`uvx`. The install runs the current community MCP directly from this GitHub repository; it does not use the unreleased hosted surface.
193
+
194
+ ### ChatGPT and other cloud MCP clients
195
+
196
+ The repository now includes a dedicated stateless Streamable HTTP ASGI entry point at `mcp_trendpulse.asgi:app`. This is separate from the Community stdio entry point, which remains unchanged.
197
+
198
+ For controlled local/private testing you can run the ASGI app with Uvicorn or use the provided container. See [`deploy/README.md`](deploy/README.md) for the hardened container, Host/Origin allowlists, Chromium sandbox requirements, health/readiness endpoints, and reverse-proxy notes.
199
+
200
+ The DigestSEO-hosted endpoint and public ChatGPT app are still **not released**. Hosted deployments now support fail-closed Clerk OAuth authentication; do not expose the remote transport publicly unless Clerk issuer/JWKS/audience settings, the public base URL, and the Host/Origin allowlists are configured for that deployment.
201
+
202
+ ## Configuration
203
+
204
+ TrendPulse loads environment variables from the process environment and from a local `.env` file when present.
205
+
206
+ Useful variables include:
207
+
208
+ ```env
209
+ HTTP_PROXY=http://your-proxy-address:port
210
+ HTTPS_PROXY=http://your-proxy-address:port
211
+ GOOGLE_TRENDS_DELAY=2.0
212
+ ```
213
+
214
+ `GOOGLE_TRENDS_DELAY` controls the request delay used by the current Trends provider. Proxy variables can be useful when the upstream service rate-limits or blocks a particular network.
215
+
216
+ Remote deployments also support `TRENDPULSE_HTTP_PATH`, `TRENDPULSE_HTTP_ALLOWED_HOSTS`, `TRENDPULSE_HTTP_ALLOWED_ORIGINS`, and `TRENDPULSE_BROWSER_SANDBOX`. The container enables Chromium sandboxing explicitly; local Community runs retain the Playwright-compatible default unless you opt in.
217
+
218
+ Do not commit secrets, private proxy credentials, or machine-specific `.env` files.
219
+
220
+ ## MCP tools
221
+
222
+ The community MCP server currently exposes **16 tools**.
223
+
224
+ ### News tools
225
+
226
+ | Tool | Purpose |
227
+ | --- | --- |
228
+ | `get_news_by_keyword` | Find recent news articles matching a keyword. |
229
+ | `get_news_by_location` | Find recent news associated with a location. |
230
+ | `get_news_by_topic` | Find recent news for a supported Google News topic. |
231
+ | `get_top_news` | Retrieve top Google News stories. |
232
+ | `get_news_by_site` | Find recent news from a specific publisher domain. |
233
+ | `get_article_content` | Download, validate, extract, and optionally summarize one article URL. |
234
+
235
+ ### Trend tools
236
+
237
+ | Tool | Purpose |
238
+ | --- | --- |
239
+ | `get_trending_terms` | Retrieve current trending terms for a geographic target. |
240
+ | `get_trends` | Retrieve interest-over-time points for one or more keywords. |
241
+ | `get_growth` | Calculate search-interest growth over requested windows. |
242
+ | `get_ranked_trends` | Rank current trends by growth or volume. |
243
+ | `get_top_trends` | Retrieve a top-trends feed without supplying a keyword. |
244
+ | `get_interest_by_region` | Compare keyword interest across geographic regions. |
245
+ | `get_related_queries` | Retrieve top and rising related search queries. |
246
+ | `get_related_topics` | Retrieve top and rising related Google Trends topics. |
247
+ | `get_suggestions` | Resolve autocomplete/topic suggestions for a query. |
248
+ | `get_categories` | Retrieve Google Trends category IDs and names. |
249
+
250
+ ### Example: explicit trend window
251
+
252
+ `get_trends` accepts an explicit `timeframe`. Supplying one is preferable when you need reproducible comparisons.
253
+
254
+ ```json
255
+ {
256
+ "keyword": ["technical SEO audit", "AI SEO audit"],
257
+ "geo": "US",
258
+ "source": "google search",
259
+ "timeframe": "today 12-m",
260
+ "cat": 0
261
+ }
262
+ ```
263
+
264
+ Supported provider ranges include standard windows such as `today 12-m` and `today 5-y`, relative windows such as `today 90-d`, `all`, and exact date ranges such as `2021-01-01 2026-01-01`.
265
+
266
+ Google Trends values are normalized interest scores. Do not interpret a 0-100 interest series as absolute search volume.
267
+
268
+ ## CLI
269
+
270
+ The separate Click CLI exposes a smaller news-oriented command set than the MCP server:
271
+
272
+ ```bash
273
+ uv run mcp-trendpulse-cli --help
274
+ ```
275
+
276
+ Current CLI commands:
277
+
278
+ ```text
279
+ keyword
280
+ location
281
+ top
282
+ topic
283
+ trending
284
+ ```
285
+
286
+ The CLI and MCP surfaces are intentionally documented separately because they do not expose the same command set.
287
+
288
+ ## Development
289
+
290
+ Install the project with its development dependencies using your preferred Python environment, then run the unit suite:
291
+
292
+ ```bash
293
+ python -m pytest
294
+ ```
295
+
296
+ The default pytest configuration excludes live integration tests.
297
+
298
+ Run live provider tests explicitly with:
299
+
300
+ ```bash
301
+ python -m pytest tests/integration -m integration
302
+ ```
303
+
304
+ Browser-marked integration tests require Playwright Chromium to be installed.
305
+
306
+ Run Ruff checks with:
307
+
308
+ ```bash
309
+ ruff check .
310
+ ```
311
+
312
+ ## MCP Inspector
313
+
314
+ Run the published-from-GitHub server through the MCP Inspector:
315
+
316
+ ```bash
317
+ npx @modelcontextprotocol/inspector uvx --from git+https://github.com/AKzar1el/mcp-trendpulse.git mcp-trendpulse
318
+ ```
319
+
320
+ For a local checkout:
321
+
322
+ ```bash
323
+ npx @modelcontextprotocol/inspector uv run mcp-trendpulse
324
+ ```
325
+
326
+ ## Packaging
327
+
328
+ A GitHub Actions workflow is already present for building and publishing Python distributions through PyPI Trusted Publishing when a GitHub release is published. Until the first package release exists, use the GitHub `uvx --from ...` command shown above.
329
+
330
+ ## Security notes
331
+
332
+ Article retrieval is an outbound network feature and is treated as untrusted input. The implementation validates HTTP(S) targets, rejects private and non-routable destinations, checks redirect targets, enforces response-size limits, and applies browser-route validation when Playwright is used.
333
+
334
+ If you deploy TrendPulse remotely, retain these controls and add deployment-level rate limiting, request timeouts, observability, and resource limits rather than relying only on application defaults.
335
+
336
+ ## Roadmap
337
+
338
+ Current production-readiness work is focused on:
339
+
340
+ 1. Keeping documentation, packaging metadata, and generated MCP manifests coherent with the live tool surface.
341
+ 2. Adding continuous integration for unit tests and static checks.
342
+ 3. Separating provider access from TrendPulse's domain logic so providers can be changed without rewriting the MCP layer.
343
+ 4. Adding a production remote HTTP transport while preserving local stdio operation.
344
+ 5. Designing a smaller high-level hosted tool surface for ChatGPT/Codex.
345
+ 6. Integrating the hosted service with the DigestSEO application and operational stack.
346
+ 7. Packaging and testing the hosted MCP as an OpenAI plugin only after the service is production-ready.
347
+
348
+ ## License
349
+
350
+ MIT. See [LICENSE](LICENSE).
351
+
352
+ <!-- mcp-name: io.github.AKzar1el/mcp-trendpulse -->
@@ -0,0 +1,324 @@
1
+ # mcp-trendpulse
2
+
3
+ [![MCP](https://img.shields.io/badge/Model%20Context%20Protocol-MCP-blue.svg)](https://modelcontextprotocol.io)
4
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-blue.svg)](https://www.python.org/)
5
+ [![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
6
+ [![mcp-trendpulse MCP server](https://glama.ai/mcp/servers/AKzar1el/mcp-trendpulse/badges/score.svg)](https://glama.ai/mcp/servers/AKzar1el/mcp-trendpulse)
7
+
8
+ **TrendPulse** is a Python Model Context Protocol (MCP) server for researching current news and search-interest trends. It combines Google News discovery and article extraction with Google Trends analysis so MCP clients can inspect what is trending, compare keyword momentum, explore related demand, and add current-news context to research workflows.
9
+
10
+ The project currently ships as a **community/self-hosted MCP server** and also contains the implementation for a separate **hosted TrendPulse by DigestSEO** surface for remote MCP clients such as ChatGPT and Codex. The hosted layer uses a smaller, goal-oriented tool surface while the community server keeps the full low-level research toolkit available to developers.
11
+
12
+ > **Project status:** the local/community server is usable today. The DigestSEO-hosted MCP and public OpenAI plugin are not released yet and should not be treated as available endpoints.
13
+
14
+ Engineering context: TrendPulse is part of the [DigestSEO](https://digestseo.com/) MCP ecosystem. It complements [mcp-gsc](https://digestseo.com/gsc-mcp/) for Google Search Console data, [mcp-geo](https://digestseo.com/geo-mcp/) for AI visibility, and [mcp-web-validator](https://digestseo.com/validator-mcp/) for technical web validation. The broader architecture is documented in the [DigestSEO MCP Suite engineering case study](https://tomiseregi.si/projects/digestseo-mcp-suite).
15
+
16
+ ## What TrendPulse can do
17
+
18
+ ### News research
19
+
20
+ - Search Google News by keyword, location, topic, or publisher domain.
21
+ - Retrieve top news stories.
22
+ - Resolve Google News links and extract article content.
23
+ - Fall back from normal HTTP retrieval to Playwright/Chromium for difficult pages.
24
+ - Optionally summarize article text with MCP client sampling, with local NLP as a fallback.
25
+
26
+ ### Trend research
27
+
28
+ - Retrieve current trending terms for a geographic market.
29
+ - Pull Google Trends interest-over-time data for one or more keywords.
30
+ - Calculate keyword growth over custom windows such as 3M or 1Y.
31
+ - Rank live trends by volume or growth.
32
+ - Inspect interest by country, region, city, or DMA where supported.
33
+ - Explore related queries, related topics, suggestions, and category IDs.
34
+ - Compare Google Search, YouTube Search, News Search, Image Search, and Google Shopping trend properties where supported by the underlying provider.
35
+
36
+ ## Community and hosted architecture
37
+
38
+ TrendPulse is being developed with two deliberate surfaces:
39
+
40
+ | Surface | Purpose | Status |
41
+ | --- | --- | --- |
42
+ | **Community MCP** | Full Python MCP server for local use, development, self-hosting, and integrations with MCP-compatible clients. | Available in this repository |
43
+ | **TrendPulse by DigestSEO** | Managed remote MCP for ChatGPT/Codex and a future public OpenAI plugin with a smaller, task-oriented tool surface. | In development |
44
+
45
+ The community server remains useful independently. The hosted edition will reuse the same core trend-research concepts while adding the deployment, reliability, authentication, observability, and product integration needed for a managed service.
46
+
47
+ The implemented hosted tool surface is intentionally higher level than the community API and centers on goals such as:
48
+
49
+ - `discover_trends`
50
+ - `analyze_keyword_trend`
51
+ - `compare_keyword_trends`
52
+ - `discover_related_demand`
53
+ - `get_trend_context`
54
+ - `find_seo_opportunities`
55
+
56
+ These names describe the hosted ChatGPT Apps/MCP interface; they remain separate from the current Community MCP tool names.
57
+
58
+ ## Installation
59
+
60
+ ### Run directly from GitHub with `uvx` (recommended)
61
+
62
+ The package is not yet published to PyPI, so the most direct installation path is:
63
+
64
+ ```bash
65
+ uvx --from git+https://github.com/AKzar1el/mcp-trendpulse.git mcp-trendpulse
66
+ ```
67
+
68
+ After a PyPI release exists, the shorter form will be:
69
+
70
+ ```bash
71
+ uvx mcp-trendpulse
72
+ ```
73
+
74
+ ### Install with pip from a checkout
75
+
76
+ ```bash
77
+ git clone https://github.com/AKzar1el/mcp-trendpulse.git
78
+ cd mcp-trendpulse
79
+ python -m pip install .
80
+ python -m mcp_trendpulse
81
+ ```
82
+
83
+ ## Browser fallback
84
+
85
+ News/article tools can fall back to Playwright when ordinary retrieval cannot extract a usable article. Installing the Python `playwright` package does not install Chromium automatically.
86
+
87
+ For local use:
88
+
89
+ ```bash
90
+ playwright install chromium
91
+ ```
92
+
93
+ For Linux environments that also require browser system dependencies:
94
+
95
+ ```bash
96
+ playwright install --with-deps chromium
97
+ ```
98
+
99
+ Trend-only operations do not inherently require Chromium.
100
+
101
+ ## Client configuration
102
+
103
+ ### Claude Desktop
104
+
105
+ Using `uvx` directly from GitHub:
106
+
107
+ ```json
108
+ {
109
+ "mcpServers": {
110
+ "mcp-trendpulse": {
111
+ "command": "uvx",
112
+ "args": [
113
+ "--from",
114
+ "git+https://github.com/AKzar1el/mcp-trendpulse.git",
115
+ "mcp-trendpulse"
116
+ ]
117
+ }
118
+ }
119
+ }
120
+ ```
121
+
122
+ ### VS Code
123
+
124
+ ```json
125
+ {
126
+ "mcp": {
127
+ "servers": {
128
+ "mcp-trendpulse": {
129
+ "command": "uvx",
130
+ "args": [
131
+ "--from",
132
+ "git+https://github.com/AKzar1el/mcp-trendpulse.git",
133
+ "mcp-trendpulse"
134
+ ]
135
+ }
136
+ }
137
+ }
138
+ }
139
+ ```
140
+
141
+ ### Cursor
142
+
143
+ Cursor supports global and project MCP configuration. Add the server to the relevant `mcp.json` configuration:
144
+
145
+ ```json
146
+ {
147
+ "mcpServers": {
148
+ "mcp-trendpulse": {
149
+ "command": "uvx",
150
+ "args": [
151
+ "--from",
152
+ "git+https://github.com/AKzar1el/mcp-trendpulse.git",
153
+ "mcp-trendpulse"
154
+ ]
155
+ }
156
+ }
157
+ }
158
+ ```
159
+
160
+ ### Kiro
161
+
162
+ [![Add to Kiro](https://kiro.dev/images/add-to-kiro.svg)](https://kiro.dev/launch/mcp/add?name=mcp-trendpulse&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22--from%22%2C%22git%2Bhttps%3A%2F%2Fgithub.com%2FAKzar1el%2Fmcp-trendpulse.git%22%2C%22mcp-trendpulse%22%5D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D)
163
+
164
+ Requires `uv`/`uvx`. The install runs the current community MCP directly from this GitHub repository; it does not use the unreleased hosted surface.
165
+
166
+ ### ChatGPT and other cloud MCP clients
167
+
168
+ The repository now includes a dedicated stateless Streamable HTTP ASGI entry point at `mcp_trendpulse.asgi:app`. This is separate from the Community stdio entry point, which remains unchanged.
169
+
170
+ For controlled local/private testing you can run the ASGI app with Uvicorn or use the provided container. See [`deploy/README.md`](deploy/README.md) for the hardened container, Host/Origin allowlists, Chromium sandbox requirements, health/readiness endpoints, and reverse-proxy notes.
171
+
172
+ The DigestSEO-hosted endpoint and public ChatGPT app are still **not released**. Hosted deployments now support fail-closed Clerk OAuth authentication; do not expose the remote transport publicly unless Clerk issuer/JWKS/audience settings, the public base URL, and the Host/Origin allowlists are configured for that deployment.
173
+
174
+ ## Configuration
175
+
176
+ TrendPulse loads environment variables from the process environment and from a local `.env` file when present.
177
+
178
+ Useful variables include:
179
+
180
+ ```env
181
+ HTTP_PROXY=http://your-proxy-address:port
182
+ HTTPS_PROXY=http://your-proxy-address:port
183
+ GOOGLE_TRENDS_DELAY=2.0
184
+ ```
185
+
186
+ `GOOGLE_TRENDS_DELAY` controls the request delay used by the current Trends provider. Proxy variables can be useful when the upstream service rate-limits or blocks a particular network.
187
+
188
+ Remote deployments also support `TRENDPULSE_HTTP_PATH`, `TRENDPULSE_HTTP_ALLOWED_HOSTS`, `TRENDPULSE_HTTP_ALLOWED_ORIGINS`, and `TRENDPULSE_BROWSER_SANDBOX`. The container enables Chromium sandboxing explicitly; local Community runs retain the Playwright-compatible default unless you opt in.
189
+
190
+ Do not commit secrets, private proxy credentials, or machine-specific `.env` files.
191
+
192
+ ## MCP tools
193
+
194
+ The community MCP server currently exposes **16 tools**.
195
+
196
+ ### News tools
197
+
198
+ | Tool | Purpose |
199
+ | --- | --- |
200
+ | `get_news_by_keyword` | Find recent news articles matching a keyword. |
201
+ | `get_news_by_location` | Find recent news associated with a location. |
202
+ | `get_news_by_topic` | Find recent news for a supported Google News topic. |
203
+ | `get_top_news` | Retrieve top Google News stories. |
204
+ | `get_news_by_site` | Find recent news from a specific publisher domain. |
205
+ | `get_article_content` | Download, validate, extract, and optionally summarize one article URL. |
206
+
207
+ ### Trend tools
208
+
209
+ | Tool | Purpose |
210
+ | --- | --- |
211
+ | `get_trending_terms` | Retrieve current trending terms for a geographic target. |
212
+ | `get_trends` | Retrieve interest-over-time points for one or more keywords. |
213
+ | `get_growth` | Calculate search-interest growth over requested windows. |
214
+ | `get_ranked_trends` | Rank current trends by growth or volume. |
215
+ | `get_top_trends` | Retrieve a top-trends feed without supplying a keyword. |
216
+ | `get_interest_by_region` | Compare keyword interest across geographic regions. |
217
+ | `get_related_queries` | Retrieve top and rising related search queries. |
218
+ | `get_related_topics` | Retrieve top and rising related Google Trends topics. |
219
+ | `get_suggestions` | Resolve autocomplete/topic suggestions for a query. |
220
+ | `get_categories` | Retrieve Google Trends category IDs and names. |
221
+
222
+ ### Example: explicit trend window
223
+
224
+ `get_trends` accepts an explicit `timeframe`. Supplying one is preferable when you need reproducible comparisons.
225
+
226
+ ```json
227
+ {
228
+ "keyword": ["technical SEO audit", "AI SEO audit"],
229
+ "geo": "US",
230
+ "source": "google search",
231
+ "timeframe": "today 12-m",
232
+ "cat": 0
233
+ }
234
+ ```
235
+
236
+ Supported provider ranges include standard windows such as `today 12-m` and `today 5-y`, relative windows such as `today 90-d`, `all`, and exact date ranges such as `2021-01-01 2026-01-01`.
237
+
238
+ Google Trends values are normalized interest scores. Do not interpret a 0-100 interest series as absolute search volume.
239
+
240
+ ## CLI
241
+
242
+ The separate Click CLI exposes a smaller news-oriented command set than the MCP server:
243
+
244
+ ```bash
245
+ uv run mcp-trendpulse-cli --help
246
+ ```
247
+
248
+ Current CLI commands:
249
+
250
+ ```text
251
+ keyword
252
+ location
253
+ top
254
+ topic
255
+ trending
256
+ ```
257
+
258
+ The CLI and MCP surfaces are intentionally documented separately because they do not expose the same command set.
259
+
260
+ ## Development
261
+
262
+ Install the project with its development dependencies using your preferred Python environment, then run the unit suite:
263
+
264
+ ```bash
265
+ python -m pytest
266
+ ```
267
+
268
+ The default pytest configuration excludes live integration tests.
269
+
270
+ Run live provider tests explicitly with:
271
+
272
+ ```bash
273
+ python -m pytest tests/integration -m integration
274
+ ```
275
+
276
+ Browser-marked integration tests require Playwright Chromium to be installed.
277
+
278
+ Run Ruff checks with:
279
+
280
+ ```bash
281
+ ruff check .
282
+ ```
283
+
284
+ ## MCP Inspector
285
+
286
+ Run the published-from-GitHub server through the MCP Inspector:
287
+
288
+ ```bash
289
+ npx @modelcontextprotocol/inspector uvx --from git+https://github.com/AKzar1el/mcp-trendpulse.git mcp-trendpulse
290
+ ```
291
+
292
+ For a local checkout:
293
+
294
+ ```bash
295
+ npx @modelcontextprotocol/inspector uv run mcp-trendpulse
296
+ ```
297
+
298
+ ## Packaging
299
+
300
+ A GitHub Actions workflow is already present for building and publishing Python distributions through PyPI Trusted Publishing when a GitHub release is published. Until the first package release exists, use the GitHub `uvx --from ...` command shown above.
301
+
302
+ ## Security notes
303
+
304
+ Article retrieval is an outbound network feature and is treated as untrusted input. The implementation validates HTTP(S) targets, rejects private and non-routable destinations, checks redirect targets, enforces response-size limits, and applies browser-route validation when Playwright is used.
305
+
306
+ If you deploy TrendPulse remotely, retain these controls and add deployment-level rate limiting, request timeouts, observability, and resource limits rather than relying only on application defaults.
307
+
308
+ ## Roadmap
309
+
310
+ Current production-readiness work is focused on:
311
+
312
+ 1. Keeping documentation, packaging metadata, and generated MCP manifests coherent with the live tool surface.
313
+ 2. Adding continuous integration for unit tests and static checks.
314
+ 3. Separating provider access from TrendPulse's domain logic so providers can be changed without rewriting the MCP layer.
315
+ 4. Adding a production remote HTTP transport while preserving local stdio operation.
316
+ 5. Designing a smaller high-level hosted tool surface for ChatGPT/Codex.
317
+ 6. Integrating the hosted service with the DigestSEO application and operational stack.
318
+ 7. Packaging and testing the hosted MCP as an OpenAI plugin only after the service is production-ready.
319
+
320
+ ## License
321
+
322
+ MIT. See [LICENSE](LICENSE).
323
+
324
+ <!-- mcp-name: io.github.AKzar1el/mcp-trendpulse -->