Grok MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Grok MCP Server Search X for posts about AI safety"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Grok MCP Server
Search X.com in real-time with xAI's Grok API - directly from Claude
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.
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
Related MCP server: grok-mcp-server
Quick Start
1. Get an xAI API Key
Get your API key from console.x.ai
2. Install
uvx grok-mcp3. 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.jsonWindows:
%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 with filters (handles, date range, analysis mode) |
| Find user profiles |
| Discover conversation threads |
| Get trending topics by location |
| Verify API connection |
Examples
Search Posts
Search X for posts about "AI safety" from the last weekFilter by User
Find recent posts from @anthropic about ClaudeGet 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_mcpArchitecture
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.pyContributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
MIT License - see LICENSE for details.
Links
Built with xAI Grok and Model Context Protocol
Available Tools
5 toolsget_trendsB
Get trending topics and hashtags on X.com
Inputs: location, max_results.
health_checkA
Check the health and status of the Grok API connection
Inputs: no named parameters.
search_postsB
Search X.com posts with advanced filtering and analysis options
Inputs: query (required), max_results, handles, start_date, +2 more.
search_threadsB
Search X.com conversation threads and replies
Inputs: query (required), max_results.
search_usersC
Search for X.com users and profiles
Inputs: query (required), max_results.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct aspect: trends, health, posts, threads, and users. There is no overlap in functionality.
All tools follow a consistent verb_noun snake_case pattern (e.g., get_trends, search_posts). health_check is the only deviation but still aligns with common convention.
5 tools is well-scoped for a server focused on X.com search and trends. It covers core functionalities without being overwhelming or too sparse.
The tool set covers trending topics, search across posts/threads/users, and API health. Missing direct access to specific posts or user profiles beyond search, but the main use cases are addressed.
Maintenance
Related MCP Connectors
X/Twitter search, posts, comments, user profiles, user posts/replies and video transcripts.
X (Twitter) search, profiles and trends, YouTube search, video stats and comments, TikTok comments.
Search X (Twitter) posts and read profiles, followers, trends and X Articles. OAuth sign-in.
Hosted MCP server from TwitterAPI.io that gives AI agents read-only access to Twitter/X data. 12 tools: tweet search with X operators, user profiles, a user's latest tweets, followers and followings, replies, quotes, retweeters, mentions and trends. Connect at https://mcp.twitterapi.io/mcp with a TwitterAPI.io API key or account sign-in; usage is paid per result returned.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables seamless interaction with Twitter/X platform through Claude AI, allowing users to post tweets with images, search for tweets, and engage in conversations using natural language commands.1048 npm26MIT
- AlicenseNot gradedqualityDmaintenanceSearch X (formerly Twitter) in real-time from your AI assistant using xAI's Grok API, with no X API account required.1,028 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables real-time search of X (Twitter) posts, user timelines, and trends using either xAI's Responses API or the official X API v2.4-
- FlicenseAqualityDmaintenanceEnables searching X (Twitter) using the xAI Grok API to get summarised answers with citations. Supports filtering by handles, date range, and image/video understanding.12-