Thread Analyzer MCP Server

Thread Analyzer MCP Server

Scrape and analyze replies from any public Threads post right from your AI coding agent.

Category
Visit Server

README

<p align="center"> <h1 align="center">Thread Analyzer MCP Server</h1> <p align="center"> Scrape and analyze replies from any public Threads post — right from your AI coding agent. </p> </p>

<p align="center"> <a href="https://github.com/ethan-tsai-tsai/thread-analyzer/blob/main/LICENSE"><img src="https://img.shields.io/github/license/ethan-tsai-tsai/thread-analyzer" alt="License" /></a> <a href="https://github.com/ethan-tsai-tsai/thread-analyzer/stargazers"><img src="https://img.shields.io/github/stars/ethan-tsai-tsai/thread-analyzer" alt="Stars" /></a> <a href="https://pypi.org/project/thread-analyzer/"><img src="https://img.shields.io/pypi/v/thread-analyzer" alt="PyPI" /></a> <a href="https://python.org"><img src="https://img.shields.io/badge/python-3.13+-blue.svg" alt="Python 3.13+" /></a> </p>


What is this?

An MCP server that lets your AI assistant scrape a Threads post URL, then query and analyze the replies — all through natural conversation.

Instead of:

1. Manually open browser
2. Scroll through hundreds of replies
3. Copy-paste into spreadsheet
4. Manually look for patterns

Just say:

"Analyze the replies on this Threads post: https://www.threads.com/@zuck/post/ABC123"

Your AI agent handles the rest.

Features

  • Network interception — Captures GraphQL API responses, not fragile CSS selectors that Meta randomizes
  • Anti-detection — Randomized scroll delays, stealth browser flags, custom User-Agent
  • 4 MCP tools — Scrape, list, search, and get statistics on replies
  • Works with any MCP client — Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, and more

MCP Tools

Tool Description
scrape_thread(url) Scrape all replies from a public Threads post
get_all_replies() Return all scraped replies with username and timestamp
search_replies(keyword) Case-insensitive keyword search across replies
get_reply_stats() Reply count, top commenters, avg length, time range

Quick Start

Prerequisites

  • Python 3.13+
  • uv package manager

Installation

git clone https://github.com/ethan-tsai-tsai/thread-analyzer.git
cd thread-analyzer
uv sync
uv run playwright install chromium

Configuration

Add the server to your MCP client config:

{
  "mcpServers": {
    "thread-analyzer": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/thread-analyzer", "python", "server.py"]
    }
  }
}

<details> <summary><strong>Claude Code</strong></summary>

Add to your project's .mcp.json:

{
  "mcpServers": {
    "thread-analyzer": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/thread-analyzer", "python", "server.py"]
    }
  }
}

Or run: claude mcp add thread-analyzer -- uv run --directory /absolute/path/to/thread-analyzer python server.py

</details>

<details> <summary><strong>Claude Desktop</strong></summary>

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "thread-analyzer": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/thread-analyzer", "python", "server.py"]
    }
  }
}

</details>

<details> <summary><strong>Cursor</strong></summary>

Go to Cursor Settings > MCP > Add new MCP Server, then add:

{
  "mcpServers": {
    "thread-analyzer": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/thread-analyzer", "python", "server.py"]
    }
  }
}

</details>

<details> <summary><strong>VS Code (Copilot)</strong></summary>

Add to .vscode/mcp.json in your workspace:

{
  "servers": {
    "thread-analyzer": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/thread-analyzer", "python", "server.py"]
    }
  }
}

</details>

<details> <summary><strong>Windsurf</strong></summary>

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "thread-analyzer": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/thread-analyzer", "python", "server.py"]
    }
  }
}

</details>

Standalone CLI

You can also use the scraper directly without MCP:

uv run python scraper.py "https://www.threads.com/@user/post/XXXXX"

# Options
uv run python scraper.py "URL" --output custom.csv --max-scrolls 50

How It Works

┌─────────────┐     MCP (stdio)     ┌──────────────┐    Playwright    ┌─────────────┐
│  AI Client  │ ◄──────────────────► │  server.py   │ ◄──────────────► │  Threads.com │
│ (Claude,    │   scrape_thread()    │  (FastMCP)   │   GraphQL API   │  (Meta)      │
│  Cursor...) │   get_all_replies()  │              │   interception  │              │
│             │   search_replies()   │  replies.csv │                 │              │
│             │   get_reply_stats()  │              │                 │              │
└─────────────┘                      └──────────────┘                 └─────────────┘
  1. You give your AI assistant a Threads post URL
  2. AI calls scrape_thread(url) via MCP
  3. Server launches headless Chromium, navigates to the post
  4. Playwright intercepts GraphQL network responses containing reply data
  5. Server parses replies (username, text, timestamp), saves to CSV
  6. AI uses get_all_replies(), search_replies(), get_reply_stats() to analyze

Anti-Detection

Technique Purpose
Custom User-Agent Mimics real Chrome browser
navigator.webdriver removal Hides automation flag
AutomationControlled disabled Prevents Chromium detection
Randomized scroll delays (1.5-4.5s) Avoids behavioral fingerprinting
Early stop on idle scrolls Mimics natural browsing patterns

Limitations

  • Public posts only — Cannot access private or restricted posts
  • Meta's anti-bot measures — Meta may block headless browsers; if scraping fails, try the standalone CLI in non-headless mode
  • GraphQL schema changes — Meta periodically changes their API structure; the parser in scraper.py may need updating

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

MIT


<p align="center"> <a href="https://star-history.com/#ethan-tsai-tsai/thread-analyzer"> <img src="https://api.star-history.com/svg?repos=ethan-tsai-tsai/thread-analyzer&type=Date" alt="Star History Chart" width="600" /> </a> </p>

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured