@chinchillaenterprises/mcp-grok
v2.0.1
Published
Model Context Protocol server for Grok AI integration - Enable Claude to communicate with Grok
Downloads
28
Readme
MCP Grok - AI Communication Server
Enable Claude to communicate with Grok AI through the Model Context Protocol
🚀 Features
- Direct Grok Integration: Send messages to Grok and receive responses
- Model Selection: Uses the latest Grok-4 model
- Customizable Parameters: Control temperature, max tokens, and system prompts
- Simple & Lightweight: Minimal dependencies, easy to set up
📋 Prerequisites
- Node.js 18 or higher
- Grok API Key - Get yours at x.ai/api
🛠️ Installation
Quick Install for Claude Desktop
# Install globally for all projects
claude mcp add grok -s user -e GROK_API_KEY=your_api_key -- npx @chinchillaenterprises/mcp-grok
# Or install for specific project
claude mcp add grok -s project -e GROK_API_KEY=your_api_key -- npx @chinchillaenterprises/mcp-grokManual Installation
Install the package:
npm install -g @chinchillaenterprises/mcp-grokConfigure Claude Desktop:
Edit your Claude configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "grok": { "command": "npx", "args": ["@chinchillaenterprises/mcp-grok"], "env": { "GROK_API_KEY": "your_grok_api_key_here" } } } }- macOS:
🎯 Quick Start
Send a message to Grok:
Use grok_send_message with message "Explain quantum computing in simple terms"Send a message with custom parameters:
Use grok_send_message with message "Write a haiku about AI", temperature 1.5, and system_prompt "You are a creative poet"
🔧 Available Tools
grok_send_message
Send a message to Grok AI and get a response.
Parameters:
message(required): The message to send to Grokmodel(optional): The Grok model to use (defaults togrok-4-0709)temperature(optional): Sampling temperature between 0 and 2 (default: 0.7)max_tokens(optional): Maximum tokens in response (default: 2048)system_prompt(optional): System prompt to set context
Example:
{
"message": "What's the meaning of life?",
"model": "grok-4-0709",
"temperature": 0.8,
"system_prompt": "You are Grok, a witty AI assistant with a sense of humor"
}grok_list_models
List all available Grok models and show the currently selected model.
No parameters required.
Returns:
{
"models": ["grok-4-0709"],
"current_model": "grok-4-0709"
}grok_set_model
Set the default Grok model for subsequent messages.
Parameters:
model(required): The Grok model to use
Example:
{
"model": "grok-4-0709"
}📊 Usage Examples
Basic Conversation
You: Use grok_send_message with message "Tell me a joke about programming"
Grok: Why do programmers prefer dark mode? Because light attracts bugs!Direct Messaging
You: Use grok_send_message with message "What makes you different from other AI assistants?"Creative Writing with Higher Temperature
You: Use grok_send_message with message "Write a short story about a robot learning to dance", temperature 1.5Setting Context with System Prompt
You: Use grok_send_message with message "Explain this code: print('Hello, World!')", system_prompt "You are a patient programming teacher for beginners"🎨 Model Information
| Model | Best For | Context Length | Special Features |
|-------|----------|----------------|------------------|
| grok-4-0709 | Advanced reasoning | Extended | Most capable model, enhanced performance |
⚙️ Configuration
Environment Variables
| Variable | Description | Required |
|----------|-------------|----------|
| GROK_API_KEY | Your Grok API key from x.ai | ✅ Yes |
Getting Your API Key
- Visit x.ai/api
- Sign in with your X (Twitter) account
- Navigate to API Keys section
- Generate a new API key
- Copy and save it securely
🚨 Error Handling
The server provides clear error messages for common issues:
- Missing API Key: Instructions on how to set GROK_API_KEY
- Invalid API Key: Prompts to check your credentials
- Rate Limiting: Clear message when rate limits are exceeded
- Network Issues: Descriptive connection error messages
- Invalid Model: Lists available models when wrong model is specified
🧪 Development
Local Development Setup
# Clone the repository
git clone https://github.com/ChinchillaEnterprises/ChillMCP.git
cd ChillMCP/mcp-grok
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run devTesting Locally
# Set your API key
export GROK_API_KEY=your_api_key_here
# Test with Claude Desktop
claude mcp add grok-dev -s user -- node $(pwd)/dist/index.js🛣️ Roadmap
Version 1.0 (Current)
- ✅ Basic message sending
- ✅ Model selection
- ✅ Custom parameters
Version 2.0 (Planned)
- 🔄 Conversation management
- 🔄 Message history
- 🔄 Multi-account support
Version 3.0 (Future)
- 🔄 Image analysis with vision model
- 🔄 Real-time information access
- 🔄 X/Twitter integration
- 🔄 Personality modes (fun, serious, based)
🤝 Contributing
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Links
- NPM Package: @chinchillaenterprises/mcp-grok
- GitHub Repository: ChillMCP
- Grok API Documentation: x.ai/api
- Model Context Protocol: modelcontextprotocol.io
🆘 Support
- Issues: GitHub Issues
- Grok Support: x.ai/support
Built with ❤️ by Chinchilla Enterprises for the AI community
