Grok MCP Server

Grok MCP Server

Enables real-time search of X.com (Twitter) posts, users, threads, and trends via xAI's Grok API, directly from Claude.

Category
Visit Server

README

Grok MCP Server

Search X.com in real-time with xAI's Grok API - directly from Claude

PyPI version Python 3.12+ License: MIT MCP

<!-- MCP Registry verification: mcp-name: io.github.guzus/grok-mcp -->

A Model Context Protocol server that brings real-time X/Twitter search to Claude. Powered by xAI's Live Search API, it provides instant access to posts, users, threads, and trending topics.

<img width="955" height="588" alt="Screenshot 2026-01-26 at 12 20 59 AM" src="https://github.com/user-attachments/assets/b2cc89a4-4ee3-42ca-a788-ad5921f3e811" />

Why Grok MCP?

  • Real-time data - Access live X.com content, not cached or outdated information
  • Native Claude integration - Works seamlessly with Claude Desktop and Claude Code
  • Simple setup - One command to install, one config to add
  • Open source - MIT licensed, community-driven

Quick Start

1. Get an xAI API Key

Get your API key from console.x.ai

2. Install

uvx grok-mcp

3. Configure Claude

For Claude Code - Add to .mcp.json in your project:

{
  "mcpServers": {
    "grok": {
      "command": "uvx",
      "args": ["grok-mcp"],
      "env": {
        "XAI_API_KEY": "your-api-key"
      }
    }
  }
}

For Claude Desktop - Add to your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "grok": {
      "command": "uvx",
      "args": ["grok-mcp"],
      "env": {
        "XAI_API_KEY": "your-api-key"
      }
    }
  }
}

4. Use It

Ask Claude things like:

  • "Search X for posts about AI"
  • "What's trending on X right now?"
  • "Find tweets from @elonmusk about Tesla"

Available Tools

Tool Description
search_posts Search posts with filters (handles, date range, analysis mode)
search_users Find user profiles
search_threads Discover conversation threads
get_trends Get trending topics by location
health_check Verify API connection

Examples

Search Posts

Search X for posts about "AI safety" from the last week

Filter by User

Find recent posts from @anthropic about Claude

Get Trends

What are the trending topics in tech right now?

Development

# Clone
git clone https://github.com/guzus/grok-mcp.git
cd grok-mcp

# Install dependencies
uv sync --dev

# Run tests
uv run pytest

# Run locally
XAI_API_KEY=your-key uv run python -m grok_mcp

Architecture

src/grok_mcp/
├── server.py           # MCP server implementation
├── grok_client.py      # xAI Live Search API client
├── search_tools.py     # Tool implementations
├── response_formatter.py
├── config.py
└── exceptions.py

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE for details.

Links


Built with xAI Grok and Model Context Protocol

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