Search Threads public posts via Google Search, no login, no API key, no quota limits.
Tool Division of Labor
| Tool | Responsibility | Reason |
|---|---|---|
| Playwright MCP | Load pages that require JS rendering (Google Search, Threads) | These sites do not support pure HTTP scraping |
| Context Mode MCP | Index results + query on demand | Avoid flooding the context window with large amounts of data |
Core principle: Playwright handles scraping, Context Mode handles storage and querying. Playwright's
browser_navigatereturns a ~15 KB snapshot into context (unavoidable), so immediately after navigate, usebrowser_evaluateto extract condensed JSON, then use Context Modeindexto store it, and for subsequent queries usesearchinstead of reloading the page.
MCP Dependencies
This skill depends on the following two MCP Servers; you must confirm they are installed before running.
| MCP Server | Tool Prefix | Role | Necessity |
|---|---|---|---|
| Playwright | mcp__playwright__* |
Load JS-rendered pages (Google Search, Threads) | Required |
| Context Mode | mcp__context-mode__* |
Index results + query on demand, reducing context consumption | Required |
Installation Command
# Playwright MCP(headless 模式,適合搜尋任務)
claude mcp add playwright -- npx @playwright/mcp@latest --headless
# Context Mode MCP(MCP-only 安裝,推薦)
claude mcp add context-mode -- npx -y context-mode
Reference Documentation:
- Playwright MCP:https://github.com/microsoft/playwright-mcp
- Context Mode MCP:https://github.com/mksglu/claude-context-mode
Runtime Check
Before running this skill, confirm the following tools are available. If a tool call fails or does not exist,stop immediately and remind the user to install:
| Check Item | Verification Method | Prompt Message When Missing |
|---|---|---|
| Playwright MCP | Call mcp__playwright__browser_navigate whether available |
⚠️ 未偵測到 Playwright MCP。請執行:claude mcp add playwright -- npx @playwright/mcp@latest --headless |
| Context Mode MCP | Call mcp__context-mode__index whether available |
⚠️ 未偵測到 Context Mode MCP。請執行:claude mcp add context-mode -- npx -y context-mode |
If only Playwright is available but Context Mode is not, the skill can still perform searches, but cannot index or query (losing the context-saving advantage of subsequent queries). If Playwright is not available, the skill cannot run (Google Search requires JS rendering).
Invocation Chain Overview
Phase 1: Playwright navigate + evaluate → 提取結構化 JSON
Phase 2: Context Mode index → 索引到 FTS5 知識庫
Phase 3: Context Mode search → 按需查詢
Phase 4: Deep Dive (fetch_and_index 或 Playwright) → 深入閱讀 [按需]
Phase 5: Summarize → AI 整理結構化摘要
Phase 1: Search — Search Posts
Mode A: Google Keyword Search (Default)
Suitable for: searching Threads discussions on any topic.
Step 1 — Playwright loads the Google search results page:
browser_navigate(
url: "https://www.google.com/search?q=site:threads.net+{關鍵字用+連接}"
)
Search Syntax Tips:
- Basic search:
site:threads.net 三民區 鍋燒意麵 推薦 - Specify user:
site:threads.net/@username 關鍵字 - Time limit: add
&tbs=qdr:m(past month) or&tbs=qdr:y(past year) - Exclude keywords:
site:threads.net 鍋燒意麵 -廣告 - In URLs, spaces are joined with
+Connect
Step 2 — Immediately use browser_evaluate to extract structured data:
Do not use browser_snapshot(already returned during navigate).
Use JS to extract condensed JSON, returning about 500 bytes vs the snapshot's ~15 KB.
// 在 Google 搜尋結果頁執行 — 已驗證可用(2026-03)
() => {
const results = [];
const links = document.querySelectorAll('a[href*="threads.net/@"]');
for (const link of links) {
const h3 = link.querySelector('h3');
if (!h3) continue;
const url = link.href;
const title = h3.textContent.trim();
const user = (url.match(/@([^/]+)/) || [])[1] || '';
results.push({ title, url, user: '@' + user });
}
return results;
}
Note: snippets cannot be reliably extracted from evaluate because Google's DOM structure changes frequently. However, the snapshot already includes the snippet text when returned, so the AI can read the snippet from the snapshot, combine it with the structured URL/title from evaluate, and write complete information when indexing in Phase 2.
Step 3 — Pagination (if more results are needed):
Google pagination uses the &start= parameter:
- Page 2:
&start=10 - Page 3:
&start=20
Each page turn requires browser_navigate(~15 KB snapshot), which is costly.
By default, search 1 page (10 items); only turn more pages when the user explicitly requests it.
Mode B: Directly browse user pages
Use case: viewing a specific user's latest posts.
Threads user pages require JS rendering, so use Playwright directly:
browser_navigate(url: "https://www.threads.net/@{username}")
Then browser_evaluate to extract the post list, or read the content from the snapshot.
Mode C: Batch multi-keyword search
Use case: searching multiple keyword sets at once, e.g., market research, competitor analysis.
For each keyword set, execute Mode A's Step 1-2 in sequence; all results are indexed to the same source in Phase 2:
- Receive keyword array:
["三民區 鍋燒意麵", "前鎮區 早餐", "鳳山 滷味"] - Execute navigate + evaluate for each keyword
- All results are indexed to a shared source in Phase 2 (e.g.,
threads-batch-高雄美食) - Phase 3 can search across keywords
Phase 2: Index — Index into the Context Mode knowledge base
Organize the structured data extracted in Phase 1 + the summaries read from the snapshot into Markdown format, then index.
index(
content: "整理後的 Markdown 內容",
source: "threads-search-{主題}"
)
Index format
Each result includes: title, URL, user, summary, address (if any), business hours (if any), engagement data (if any).
## Threads 搜尋:{關鍵字}(第 N 頁)
### 1. {標題}
- URL: {url}
- 用戶: @{username}
- 摘要: {從 snapshot 中提取的摘要文字}
- 地址: {如有}
- 營業時間: {如有}
- 互動: {讚數、回覆數,如有}
### 2. ...
Key point: summary information is extracted from the snapshot returned by
browser_navigate(the snapshot is already in context, so nothing is wasted). Combinebrowser_evaluate's structured URL/title/user to produce complete indexed content.
source naming rules
| Search type | source tag format | Example |
|---|---|---|
| Keyword search | threads-search-{主題} |
threads-search-鍋燒意麵 |
| User page | threads-user-{username} |
threads-user-kaohsiung_food |
| Single post | threads-post-{POST_ID} |
threads-post-DBxpG7DBXfN |
| Batch search | threads-batch-{專案名} |
threads-batch-高雄美食調查 |
Phase 3: Query — Query from the knowledge base (on demand)
After indexing is complete, use search to query the knowledge base for the user's follow-up questions, without needing to reload pages.
search(
queries: ["地址 營業時間", "價格 便宜", "推薦 最強 好吃", "互動 讚 回覆 熱門"],
source: "threads-search-{主題}"
)
Search tips:
- Use specific terms: 「address business hours」 is more precise than 「store information」
- Send multiple queries at once (5-8) to avoid triggering throttling from multiple calls
- Use the
sourceparameter to limit the search scope
Phase 4: Deep Dive — In-depth reading (on demand)
Triggered when the user is interested in a specific post and wants to see the full content and replies.
Try fetch_and_indexfirst (Threads single-post pages sometimes do not require full JS rendering):
fetch_and_index(
url: "https://www.threads.net/@username/post/POST_ID",
source: "threads-post-{POST_ID}"
)
If the fetch_and_index content is empty or incomplete, fall back to Playwright:
browser_navigate(url: "https://www.threads.net/@username/post/POST_ID")
Then use browser_evaluate or read the snapshot, and index the full content into Context Mode.
Phase 5: Summarize — Structured summary
After searching and indexing are complete, use search to collect all data from the knowledge base, and the AI organizes it into a structured summary.
Food/store recommendation format
## 搜尋摘要:{關鍵字}
共找到 {N} 篇相關貼文
### 推薦排行(依互動熱度)
| 排名 | 店家 | 地點 | 亮點 | 互動 |
|------|------|------|------|------|
| 1 | XX鍋燒 | 三民區XX路 | 湯頭甜、CP值高 | 115讚 138回覆 |
### 有明確地址的店家
| 店家 | 地址 | 營業時間 |
|------|------|----------|
| ... | ... | ... |
### 關鍵發現
- ...
General discussion format
## 搜尋摘要:{關鍵字}
共找到 {N} 篇相關貼文
### 主要觀點
1. ...(支持:@user1, @user2)
2. ...(支持:@user3)
### 正反意見
- 正面:...
- 負面:...
Context consumption analysis
| Step | context consumption | Description |
|---|---|---|
browser_navigate (Google) |
~15 KB | Unavoidable, snapshot is returned automatically |
browser_evaluate (extract JSON) |
~0.5 KB | Condensed structured data |
index (index to Context Mode) |
~0.1 KB | Return confirmation message only |
search (query knowledge base) |
~1-2 KB | Return matching snippets only |
| Single-page search total | ~17 KB | Of which 15 KB is the unavoidable navigate snapshot |
Comparison without this skill (directly using browser_snapshot + manual reading):
| Operation | Without this skill | With this skill |
|---|---|---|
| Search 1 page | ~15 KB (and results are gone once used) | ~17 KB (but results can be queried repeatedly) |
| Search 5 pages | ~75 KB | ~75 KB (but all results can be cross-queried) |
| 5 follow-up questions | ~15 KB reloaded each time | ~1 KB each time (search knowledge base) |
| Long conversation total | ~150 KB+ | ~80 KB (saves 47%+) |
The key advantage is not in the first search, but in subsequent queries: After indexing, results can be repeatedly queried with
search, without needing to navigate again. In long conversations, this advantage becomes increasingly obvious.
Error handling
| Situation | Handling method |
|---|---|
browser_evaluate returns an empty array |
The Google DOM structure may change; manually extract directly from the snapshot text |
| Google search has no results | Loosen keywords, remove site: and use threads.net as keywords |
Threads page fetch_and_index empty content |
Requires JS rendering; fall back to Playwright |
search cannot find results |
Try more specific query terms, or check whether the source tag is correct |
| Too few search results | Try different keyword combinations, or remove the time limit |
| Encounter CAPTCHA | Stop automation and inform the user |
Notes
- navigate snapshot cannot be avoided: Both Google Search and Threads require JS rendering, and Playwright
browser_navigateautomatically returns a snapshot; this is a known limitation of the current architecture - Make good use of existing snapshots: Since the snapshot is already in context, extract summary information from it; do not waste it
- After indexing, use search instead of reloading: For all follow-up questions, use Context Mode
search; this is the key to saving context - Data timeliness: Google indexing has delays, so the latest Threads posts may not be searchable
- Respect privacy: Only search public posts, and do not attempt to bypass any access restrictions
- Knowledge base lifecycle: Context Mode's FTS5 knowledge base is stored in tmpdir and is automatically cleaned up when the session ends
- Language: Google Search returns results based on IP and language settings; Chinese keywords can usually find Chinese Threads posts