Enhanced Grok Search

Provides web, news, and social media search with Grok-powered analyses, plus reliability, caching, and monitoring.
  • typescript

10

GitHub Stars

typescript

Language

5 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "stat-guy-grok-search-mcp": {
      "command": "npx",
      "args": [
        "grok-search-mcp"
      ],
      "env": {
        "XAI_API_KEY": "your-api-key-here",
        "GROK_TIMEOUT": "30000",
        "GROK_MAX_RETRIES": "3"
      }
    }
  }
}

You can run the Enhanced Grok Search MCP Server to perform web, news, and social media searches with rich analyses powered by Grok. It offers reliable operation, configurable timeouts, intelligent caching, and structured results, making it a powerful tool for research, monitoring, and decision support.

How to use

To use the Grok Search MCP Server with an MCP client, start the server locally and connect to it using your client’s MCP interface. You can perform web, news, and Twitter/X searches with two analysis modes: basic for straightforward results and comprehensive for deeper context, timelines, direct quotes, and multiple perspectives. Use date range filters to narrow results and leverage retry and timeout settings to handle transient issues. The server exposes health status and performance metrics to help you monitor reliability.

Practical usage patterns you can aim for include: running quick web searches in basic mode to gather headlines, performing news searches with a date range for incident timelines, and conducting Twitter/X searches with sentiment analysis in comprehensive mode to capture context and viewpoints. When you need rapid responses or to conserve tokens, choose basic mode; for deeper understanding and context, choose comprehensive mode.

How to install

Prerequisites: You need Node.js and npm installed on your system. You will also run commands from your shell to clone, install, and start the MCP server.

git clone https://github.com/stat-guy/grok-search-mcp.git
cd grok-search-mcp
npm install -g .

Verify installation by checking the help output. If you see a running message, you’re ready to proceed.

Alternative: you can run the server directly with NPX without installing globally.

npx grok-search-mcp

Additional setup and configuration

Get your API key from the xAI Developer Portal and set it as an environment variable. You can export it in your shell or place it in a .env file.

export XAI_API_KEY="your-api-key-here"

Add the server to Claude Desktop so you can access it from the GUI. Use the following configuration snippet in your Claude Desktop config file.

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

Configuration and usage notes

Environment variables shown in examples are XAI_API_KEY for API access and optional GROK_TIMEOUT and GROK_MAX_RETRIES to tune reliability. When you configure the MCP server, include these variables in the runtime environment so the server can authenticate and handle requests robustly.

Troubleshooting and health

If you encounter issues, first verify the API key is set and active. Use the health check capability to validate connectivity and health status. For timeouts or transient failures, adjust GROK_TIMEOUT and GROK_MAX_RETRIES to balance responsiveness and retry resilience.

Tools and endpoints overview

The server exposes several search and analysis tools, including general web search, news search with timelines, Twitter/X search with sentiment analysis, and a health_check endpoint to assess server health and API connectivity. Each tool supports configurable query parameters and analysis modes to fit your use case.

Notes on reliability and performance

Expect automatic retry with exponential backoff for transient failures, configurable timeouts to prevent hanging, and intelligent caching for expensive comprehensive analyses. Structured logging and performance metrics help you monitor request success rates and timing.

Security considerations

Keep your XAI API key secure. Do not commit keys to source control. Use environment-specific configurations and rotate keys as needed.

Example quick-start scenarios

Basic web search in quick mode: perform a web query and retrieve concise results with titles and URLs.

Available tools

grok_search

General-purpose search tool with configurable search types and analysis modes.

grok_web_search

Search general web content with comprehensive analysis support.

grok_news_search

Search for recent news with comprehensive timeline and context analysis.

grok_twitter

Search Twitter/X posts with social media analysis.

health_check

Check server health and API connectivity status.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational