xai-live-search-mcp
v1.1.0
Published
π₯ xAI Live Search integration for Claude Code via MCP - BEAST MODE!
Maintainers
Readme
π₯ xAI Live Search MCP Server - CRACKED-JACKED Edition
BEAST MODE xAI Live Search integration for Claude Code via Model Context Protocol (MCP).
π Features
- Live Web Search: Real-time search using xAI's Grok with current data
- AI Chat with Search: Enhanced AI responses with live web context
- Multiple Search Types: Web, News, and X (Twitter) searches
- Full MCP Integration: Seamless Claude Code integration
- Type-Safe: Full TypeScript implementation with validation
- Error Handling: Robust error handling and validation
β‘ Quick Setup
π Super Easy NPM Installation (RECOMMENDED)
Option 1: One-Command Setup
# Install globally
npm install -g xai-live-search-mcp
# Run setup wizard (guides you through API key configuration)
xai-mcp-setup
# OR
xai-live-search-mcp --setup
# Add to Claude Code project
claude mcp add xai-live-search -- xai-live-search-mcpOption 2: Quick Setup (if you have API key)
# Set your API key
export XAI_API_KEY="your-xai-api-key-here"
# Add to Claude Code project in one command
claude mcp add xai-live-search -- npx xai-live-search-mcpπ¦ Alternative Installation Methods
Local Project Install
# Install in specific project
npm install xai-live-search-mcp
# Run setup wizard
npx xai-live-search-mcp setup
# Add to Claude Code
claude mcp add xai-live-search -- npx xai-live-search-mcpDevelopment Install
git clone <repository>
cd xai-live-search-mcp
npm install && npm run build
claude mcp add xai-live-search -- node dist/index.jsπ API Key Configuration
Method 1: Setup Wizard (EASIEST)
# If installed globally
xai-mcp-setup
# OR
xai-live-search-mcp --setup
# If installed locally
npx xai-live-search-mcp --setup
# OR
node setup-wizard.cjsMethod 2: Environment Variable
export XAI_API_KEY="your-xai-api-key-here"Method 3: .env File
cp .env.example .env
# Edit .env with your API keyMethod 4: MCP Tool (in Claude Code)
Use xai_configure tool:
{
"apiKey": "your-xai-api-key-here",
"model": "grok-3-latest"
}Get your API key from: https://x.ai/api
π οΈ Available Tools
1. xai_configure
Configure your xAI API settings.
Parameters:
apiKey(required): Your xAI API keymodel(optional): Model to use (default: 'grok-3')maxTokens(optional): Max tokens per request (default: 4096)temperature(optional): Response creativity 0.0-2.0 (default: 0.7)
2. xai_live_search
Perform live web searches with real-time data.
Parameters:
query(required): What to search formaxResults(optional): Max results 1-20 (default: 10)searchType(optional): 'web', 'news', or 'x' (default: 'web')includeTimestamp(optional): Include timestamps (default: true)
3. xai_chat_with_search
Chat with AI using live search context.
Parameters:
message(required): Your question/messageincludeContext(optional): Show search results (default: true)maxSearchResults(optional): Max search results 1-10 (default: 5)searchQuery(optional): Specific search query
4. xai_test_connection
Test your API connection and authentication.
πͺ Usage Examples
Basic Configuration
Use the xai_configure tool with your API key to get started.Live Search
Use xai_live_search to search for "latest AI developments 2025"AI Chat with Search
Use xai_chat_with_search to ask "What are the latest developments in quantum computing?"π§ Development
Scripts
npm run build- Build TypeScript to JavaScriptnpm run dev- Development mode with auto-reloadnpm start- Start the built servernpm test- Run tests
Project Structure
src/
βββ index.ts # Main MCP server
βββ xai-client.ts # xAI API client
βββ types.ts # TypeScript types and schemas
βββ __tests__/ # Test filesπ‘οΈ Security Notes
- Never commit your xAI API key to version control
- Use environment variables for production deployments
- API keys are stored in memory only during server runtime
π Integration with Claude Code
Once configured, you can use these tools directly in Claude Code:
- Configure: Set up your xAI API key
- Search: Get real-time information from the web
- Chat: Ask questions with live context
- Integrate: Use in your development workflow
π‘ Pro Tips
- Use specific search queries for better results
- Try different search types (web/news/x) for varied perspectives
- Combine with other MCP servers for maximum BEAST MODE power
- Use in development to get latest documentation and trends
π‘οΈ Security & Privacy
API Key Safety
- β Never committed to code - Your API keys are safe
- β Secure file permissions - .env files set to 600 (owner-only)
- β Multiple configuration options - Choose what works for you
- β No keys in published package - Clean NPM distribution
Best Practices
- Use environment variables for production
- Rotate API keys regularly
- Monitor API usage and set limits
- Use project-specific keys for different environments
π¦ Publishing & Distribution
This package can be safely published to NPM registries:
- No API keys included in published package
- Interactive setup wizard for new users
- Secure configuration management
- Standard NPM distribution practices
# Publish to NPM (maintainers only)
./publish-npm.shπ₯ BEAST MODE ACTIVATED!
This MCP server brings REAL-TIME web search directly into Claude Code. No more outdated information - only the FRESHEST data from the web!
LET'S CRUSH THOSE INFORMATION GAPS! πͺπ
