ScrapeBadger

搜索与获取

by scrape-badger

面向 AI 代理的 Twitter/X 抓取 API,可获取用户资料、tweets、趋势及更多数据。

什么是 ScrapeBadger

面向 AI 代理的 Twitter/X 抓取 API,可获取用户资料、tweets、趋势及更多数据。

README

<!-- mcp-name: io.github.scrape-badger/scrapebadger --> <p align="center"> <img src="https://scrapebadger.com/logo-dark.png" alt="ScrapeBadger" width="400"> </p> <h1 align="center">ScrapeBadger MCP Server</h1> <p align="center"> <a href="https://pypi.org/project/scrapebadger-mcp/"><img src="https://img.shields.io/pypi/v/scrapebadger-mcp.svg" alt="PyPI version"></a> <a href="https://pypi.org/project/scrapebadger-mcp/"><img src="https://img.shields.io/pypi/pyversions/scrapebadger-mcp.svg" alt="Python versions"></a> <a href="https://github.com/scrape-badger/scrapebadger-mcp/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/scrapebadger-mcp.svg" alt="License"></a> <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-Compatible-blue" alt="MCP Compatible"></a> </p> <p align="center"> <strong>Give your AI agents access to Twitter/X data via the Model Context Protocol</strong> </p>

What is this?

ScrapeBadger MCP Server is a Model Context Protocol (MCP) server that enables AI assistants like Claude, ChatGPT, Cursor, Windsurf, and other MCP-compatible clients to access Twitter/X data through the ScrapeBadger API.

With this MCP server, your AI can:

  • Get Twitter user profiles, followers, and following lists
  • Search and retrieve tweets
  • Access trending topics globally or by location
  • Explore Twitter lists and communities
  • Search for places and geolocated content

Quick Start

1. Get Your API Key

Sign up at scrapebadger.com and get your API key.

2. Install

bash
# Using uvx (recommended - no installation needed)
uvx scrapebadger-mcp

# Or install globally with pip
pip install scrapebadger-mcp

# Or with uv
uv tool install scrapebadger-mcp

3. Configure Your AI Client

Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

json
{
  "mcpServers": {
    "scrapebadger": {
      "command": "uvx",
      "args": ["scrapebadger-mcp"],
      "env": {
        "SCRAPEBADGER_API_KEY": "sb_live_your_api_key_here"
      }
    }
  }
}

Cursor

Add to your Cursor MCP settings (.cursor/mcp.json):

json
{
  "mcpServers": {
    "scrapebadger": {
      "command": "uvx",
      "args": ["scrapebadger-mcp"],
      "env": {
        "SCRAPEBADGER_API_KEY": "sb_live_your_api_key_here"
      }
    }
  }
}

Windsurf

Add to your Windsurf MCP configuration:

json
{
  "mcpServers": {
    "scrapebadger": {
      "command": "uvx",
      "args": ["scrapebadger-mcp"],
      "env": {
        "SCRAPEBADGER_API_KEY": "sb_live_your_api_key_here"
      }
    }
  }
}

VS Code with Copilot

Add to your VS Code settings (.vscode/mcp.json):

json
{
  "mcpServers": {
    "scrapebadger": {
      "command": "uvx",
      "args": ["scrapebadger-mcp"],
      "env": {
        "SCRAPEBADGER_API_KEY": "sb_live_your_api_key_here"
      }
    }
  }
}

4. Start Using It!

Once configured, simply ask your AI to fetch Twitter data:

"Get the profile of @elonmusk"

"Search for tweets about AI agents"

"What's trending on Twitter right now?"

"Find the top 10 Python developers on Twitter"


Available Tools

The MCP server provides 17 tools organized into categories:

User Tools

ToolDescription
get_twitter_user_profileGet a user's profile by username (bio, followers, following, etc.)
get_twitter_user_aboutGet extended "About" info (account location, username history)
search_twitter_usersSearch for users by query
get_twitter_followersGet a user's followers
get_twitter_followingGet accounts a user follows

Tweet Tools

ToolDescription
get_twitter_tweetGet a single tweet by ID
get_twitter_user_tweetsGet recent tweets from a user
search_twitter_tweetsSearch for tweets (supports Twitter search operators)

Trend Tools

ToolDescription
get_twitter_trendsGet global trending topics (optionally by category)
get_twitter_place_trendsGet trends for a specific location (by WOEID)

Geo Tools

ToolDescription
search_twitter_placesSearch for Twitter places by name

List Tools

ToolDescription
get_twitter_list_detailGet details about a Twitter list
search_twitter_listsSearch for Twitter lists
get_twitter_list_tweetsGet tweets from a list

Community Tools

ToolDescription
get_twitter_community_detailGet details about a Twitter community
search_twitter_communitiesSearch for communities

Example Conversations

Research a Twitter Account

You: Get the profile and recent tweets from @sama

Claude: I'll fetch Sam Altman's Twitter profile and recent tweets.

Uses get_twitter_user_profile and get_twitter_user_tweets

code
Sam Altman (@sama)
- 3.2M followers, 1,847 following
- Bio: "ceo of openai"
- Joined: December 2008

Recent tweets:
1. "excited to share..." (245K likes)
2. "the future of ai..." (180K likes)
...

Monitor Trending Topics

You: What's trending in tech on Twitter today?

Claude: I'll check the current trending topics.

Uses get_twitter_trends with category="news"

code
Top Tech Trends:
1. #GPT5 - 125,000 tweets
2. Apple Vision Pro - 89,000 tweets
3. #AGI - 45,000 tweets
...

Competitive Analysis

You: Compare the Twitter engagement of Stripe, Square, and PayPal

Claude: I'll gather data on all three companies' Twitter profiles.

Uses get_twitter_user_profile for each company

code
| Company | Followers | Following | Engagement Rate |
|---------|-----------|-----------|-----------------|
| Stripe  | 892K      | 1,245     | 2.3%           |
| Square  | 1.2M      | 567       | 1.8%           |
| PayPal  | 2.1M      | 234       | 0.9%           |

Configuration Options

Environment Variables

VariableRequiredDescription
SCRAPEBADGER_API_KEYYesYour ScrapeBadger API key

Using with Docker

dockerfile
FROM python:3.12-slim

RUN pip install scrapebadger-mcp

ENV SCRAPEBADGER_API_KEY=your_key_here

CMD ["scrapebadger-mcp"]

Using with Python Directly

bash
# Set your API key
export SCRAPEBADGER_API_KEY="sb_live_your_key_here"

# Run the server
python -m scrapebadger_mcp.server

Error Handling

The MCP server handles common errors gracefully:

ErrorDescriptionSolution
AuthenticationErrorInvalid API keyCheck your SCRAPEBADGER_API_KEY
RateLimitErrorToo many requestsWait and retry, or upgrade your plan
InsufficientCreditsErrorOut of creditsPurchase more at scrapebadger.com
NotFoundErrorUser/tweet not foundVerify the username or tweet ID

Development

Setup

bash
# Clone the repository
git clone https://github.com/scrape-badger/scrapebadger-mcp.git
cd scrapebadger-mcp

# Install dependencies
uv sync --dev

# Set your API key
export SCRAPEBADGER_API_KEY="sb_live_your_key_here"

Running Locally

bash
# Run the MCP server directly
uv run python -m scrapebadger_mcp.server

# Or use the CLI
uv run scrapebadger-mcp

Testing

bash
# Run tests
uv run pytest

# Run with coverage
uv run pytest --cov=src/scrapebadger_mcp

Code Quality

bash
# Lint
uv run ruff check src/

# Format
uv run ruff format src/

# Type check
uv run mypy src/

Troubleshooting

"SCRAPEBADGER_API_KEY environment variable is required"

Make sure you've set the API key in your MCP configuration:

json
{
  "env": {
    "SCRAPEBADGER_API_KEY": "sb_live_your_key_here"
  }
}

Server not showing in Claude Desktop

  1. Restart Claude Desktop after changing the config
  2. Check the config file path is correct for your OS
  3. Verify JSON syntax is valid (no trailing commas)

"uvx: command not found"

Install uv first:

bash
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Rate limit errors

ScrapeBadger has usage limits based on your plan. If you're hitting limits:

  1. Reduce request frequency
  2. Use pagination with smaller max_results
  3. Upgrade your plan at scrapebadger.com

Related Projects


Support


License

MIT License - see LICENSE for details.


<p align="center"> Made with love by <a href="https://scrapebadger.com">ScrapeBadger</a> </p>

常见问题

ScrapeBadger 是什么?

面向 AI 代理的 Twitter/X 抓取 API,可获取用户资料、tweets、趋势及更多数据。

相关 Skills

谷歌视频工具

by bwbernardweston18

热门

>

搜索与获取
未扫描4.5k
热门

股票投研9点分析框架,覆盖基本面/财务/竞品/估值/宏观/情绪等维度

搜索与获取
未扫描4.5k

SEO审计工具

by amdf01-debug

热门

搜索与获取
未扫描4.5k

相关 MCP Server

by Anthropic

热门

Puppeteer 是让 Claude 自动操作浏览器进行网页抓取和测试的 MCP 服务器。

这个服务器解决了手动编写 Puppeteer 脚本的繁琐问题,适合需要自动化网页交互的开发者,比如抓取动态内容或做端到端测试。不过,作为参考实现,它可能缺少生产级的安全防护,建议在可控环境中使用。

搜索与获取
89.1k

Brave 搜索

编辑精选

by Anthropic

热门

Brave Search 是让 Claude 直接调用 Brave 搜索 API 获取实时网络信息的 MCP 服务器。

如果你想让 AI 助手帮你搜索最新资讯或技术文档,这个工具能绕过传统搜索的限制,直接返回结构化数据。特别适合需要实时信息的开发者,比如查 API 更新或竞品动态。不过它依赖 Brave 的 API 配额,高频使用可能受限。

搜索与获取
89.1k

网页抓取

编辑精选

by Anthropic

热门

Fetch 是 MCP 官方参考服务器,让 AI 能抓取网页并转为 Markdown 格式。

这个服务器解决了 AI 直接处理网页内容时格式混乱的问题,适合需要让 Claude 分析在线文档或新闻的开发者。不过作为参考实现,它缺乏生产级的安全配置,你得自己处理反爬虫和隐私风险。

搜索与获取
89.1k

评论