social-research-mcp
Provides capabilities to scrape Facebook page posts by URL or search for social media research and data analysis.
Enables scraping of Instagram posts via URL, hashtag, or search, allowing for profile analysis and content theme identification.
Uses OpenAI API for generating embeddings to enable semantic search and AI-powered timeline analysis of scraped social media data.
Facilitates scraping of Reddit posts by subreddit, search terms, or specific URLs to track discussions and sentiment.
Supports scraping TikTok videos by profile, hashtag, or search for monitoring trends and engagement on the platform.
Provides tools to scrape YouTube video data by search or channel URL for social media research and cross-platform comparison.
social-research-mcp
MCP server for social media research — scrape, search, and analyze across 7 platforms with an AI-powered timeline.
Works with Claude Code, Claude Desktop, Cursor, Windsurf, VS Code Copilot, and any MCP-compatible client.
Features
7 Platform Scrapers — Twitter/X, Instagram, TikTok, YouTube, LinkedIn, Facebook, Reddit (powered by Apify)
AI Timeline — All scraped data is stored in a local LanceDB database with OpenAI embeddings for semantic search
Trend Detection — Identify trending topics, sentiment shifts, and engagement spikes across platforms
Profile Analysis — Engagement rates, posting frequency, content themes, peak hours
Sentiment Analysis — Rule-based sentiment scoring with emoji support
Cross-Platform Comparison — Compare profiles, hashtags, or topics side-by-side
Quick Start
# Run with npx (no install needed)
APIFY_TOKEN=your-token npx social-research-mcp
# With timeline/embeddings support
APIFY_TOKEN=your-token OPENAI_API_KEY=your-key npx social-research-mcpInstallation
npm install -g social-research-mcpConfiguration
Environment Variable | Required | Description |
| Yes | Apify API token for scraping |
| No | OpenAI API key for timeline embeddings (semantic search) |
| No | Data directory (default: |
| No | HTTP port (default: |
Get your Apify token here and OpenAI key here.
Usage with MCP Clients
Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"social-research": {
"command": "npx",
"args": ["social-research-mcp"],
"env": {
"APIFY_TOKEN": "your-token",
"OPENAI_API_KEY": "your-key"
}
}
}
}Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"social-research": {
"command": "npx",
"args": ["social-research-mcp"],
"env": {
"APIFY_TOKEN": "your-token",
"OPENAI_API_KEY": "your-key"
}
}
}
}HTTP Mode
For clients that support HTTP/SSE transport:
social-research-mcp --http # Port 3847
social-research-mcp --http 8080 # Custom portTools
Scrape Tools (7)
Each scraper pulls data from its platform via Apify and automatically saves results to the local timeline database.
Tool | Description |
| Search tweets by query, hashtag, or user timeline |
| Scrape posts by URL, hashtag, or search |
| Scrape videos by profile, hashtag, or search |
| Scrape videos by search or channel URL |
| Scrape posts by profile, company, or search |
| Scrape page posts by URL or search |
| Scrape posts by subreddit, search, or URL |
Timeline Tools (4)
Query and analyze your locally stored timeline data.
Tool | Description |
| Semantic search using AI embeddings (requires |
| Structured filtering by platform, date, engagement, author, hashtags |
| Detect trending topics with growth rates and sentiment |
| Aggregate stats: post counts, top authors, top hashtags |
Analysis Tools (3)
Tool | Description |
| Full profile analysis with engagement benchmarks |
| Sentiment scoring on timeline data or direct text |
| Side-by-side comparison of profiles, hashtags, or topics |
Architecture
src/
├── index.ts # CLI entry point
├── server.ts # MCP server (registers all tools)
├── config.ts # Environment configuration
├── types.ts # Shared types (UnifiedPost, Platform, etc.)
├── transport/
│ ├── stdio.ts # MCP stdio transport (default)
│ └── http.ts # HTTP/SSE transport
├── platforms/
│ ├── base.ts # Abstract platform class
│ ├── index.ts # Platform registry
│ └── [7 platforms] # Platform-specific scrapers
├── tools/
│ ├── scrape.ts # Scrape tool handlers
│ ├── timeline.ts # Timeline tool handlers
│ └── analysis.ts # Analysis tool handlers
├── db/
│ ├── lance.ts # LanceDB connection and queries
│ ├── schema.ts # Post row schema and converters
│ └── embeddings.ts # OpenAI embedding wrapper
└── analysis/
├── sentiment.ts # Rule-based sentiment analysis
├── trends.ts # Trend detection and topic clustering
└── engagement.ts # Platform-specific engagement formulasAll scraped data is normalized to a UnifiedPost schema, embedded via OpenAI, and stored in a local LanceDB database. This enables cross-platform semantic search and trend analysis over time.
Apify Costs
Scraping costs are billed through your Apify account. Approximate costs:
Platform | Approximate Cost |
~$0.40 / 1k tweets | |
TikTok | ~$5 / 1k results |
Others | Compute-based (varies) |
See Apify pricing for details.
Development
git clone https://github.com/TerminalGravity/social-research-mcp.git
cd social-research-mcp
npm install
npm run build
npm run typecheckLicense
MIT
Available Tools
14 toolsanalyze_profileB
Analyze a social media profile: scrape recent posts and compute engagement rate, posting frequency, content themes, peak hours, and sentiment.
Inputs: url_or_username (required), platform (required), max_posts.
analyze_sentimentB
Run sentiment analysis on posts. Provide a query to search timeline data, or pass texts directly. Returns positive/negative/neutral breakdown.
Inputs: query, platforms, texts.
compareB
Compare 2+ profiles, hashtags, or topics side-by-side across engagement, sentiment, and volume metrics.
Inputs: items (required), metric.
scrape_facebookB
Scrape posts from Facebook pages. Search by page URL or keyword. Results are saved to the local timeline database.
Inputs: page_urls, search, max_results.
scrape_instagramC
Scrape posts from Instagram. Search by URL, hashtag, or keyword. Results are saved to the local timeline database.
Inputs: urls, hashtags, search, type, +1 more.
scrape_linkedinC
Scrape posts from LinkedIn. Search by profile URL, company URL, or keyword. Results are saved to the local timeline database.
Inputs: profile_urls, company_urls, search, max_results.
scrape_redditB
Scrape posts from Reddit. Search by subreddit, keyword, or direct URL. Results are saved to the local timeline database.
Inputs: subreddits, search, urls, max_results.
scrape_tiktokB
Scrape videos from TikTok. Search by profile, hashtag, or keyword. Results are saved to the local timeline database.
Inputs: profiles, hashtags, search, max_results.
scrape_twitterB
Scrape tweets from Twitter/X. Search by query, hashtag, or user timeline. Results are saved to the local timeline database for later analysis.
Inputs: query (required), type, date_from, date_to, +1 more.
scrape_youtubeC
Scrape videos from YouTube. Search by keyword or channel URL. Results are saved to the local timeline database.
Inputs: search, channel_urls, max_results.
timeline_queryC
Structured query against the timeline database. Filter by platform, date, engagement, author, or hashtags — no AI needed.
Inputs: platforms, date_from, date_to, min_engagement, +3 more.
timeline_searchA
Semantic search across your timeline database. Uses AI embeddings to find posts by meaning, not just keywords. Requires OPENAI_API_KEY.
Inputs: query (required), platforms, date_from, date_to, +1 more.
timeline_statsB
Get aggregate statistics from your timeline: total posts by platform, avg engagement, most active authors, top hashtags.
Inputs: platforms, date_from, date_to.
timeline_trendsB
Detect trending topics across your stored timeline data. Identifies spikes in hashtag/keyword frequency and sentiment shifts.
Inputs: time_window, platforms, top_n.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools have distinct purposes, with clear separation between scraping (platform-specific), analysis (profile, sentiment, comparison), and timeline operations (query, search, stats, trends). However, timeline_query and timeline_search could be confused as both search the timeline database, though one is structured and the other semantic.
Tool names follow a consistent snake_case pattern throughout, with clear verb_noun structures (e.g., analyze_profile, scrape_facebook, timeline_query). The naming is predictable and readable, with no mixing of conventions or styles.
14 tools is well-scoped for a social research server covering multiple platforms and analysis types. Each tool earns its place, providing comprehensive coverage without being overwhelming, typical for a domain with diverse data sources and analytical needs.
The toolset offers complete coverage for social research: scraping from major platforms (Facebook, Instagram, etc.), storing data in a timeline database, and providing analysis tools (profile analysis, sentiment, comparison, stats, trends). No obvious gaps exist for the stated purpose, enabling agents to perform end-to-end research workflows.
Related MCP Connectors
Social media MCP server: your Instagram, TikTok, YouTube, LinkedIn and Threads history for your AI.
One MCP server for all web data. Scrape, search, crawl, and AI research in one install.
OAuth-enabled MCP server that extracts structured data from public social media posts.
MCP server for AI agents: posts, messages and comments on WhatsApp, Instagram, TikTok and Facebook.