Grok MCP Server
by lykhoydaio.github.Lykhoyda/ask-grokv0.3.0
Consult Grok through xAI's metered API with exact model selection and no fallback
context tax
queued
security
queued
cold start
queued
freshness
Active2d ago
Install Grok MCP server
Install in Claude Code
claude mcp add grok -e XAI_API_KEY='<xai-api-key>' -- npx -y @ask-llm/grok-mcpInstall in Cursor
{
"mcpServers": {
"grok": {
"command": "npx",
"args": [
"-y",
"@ask-llm/grok-mcp"
],
"env": {
"XAI_API_KEY": "<xai-api-key>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"grok": {
"command": "npx",
"args": [
"-y",
"@ask-llm/grok-mcp"
],
"env": {
"XAI_API_KEY": "<xai-api-key>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"grok": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@ask-llm/grok-mcp"
],
"env": {
"XAI_API_KEY": "<xai-api-key>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"grok": {
"command": "npx",
"args": [
"-y",
"@ask-llm/grok-mcp"
],
"env": {
"XAI_API_KEY": "<xai-api-key>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| XAI_API_KEY | yes | yes | xAI API key used only for requests to https://api.x.ai |
| ASK_GROK_HARNESS | — | — | Explicit harness: xai-api (default) or grok-cli; no automatic failover |
| ASK_GROK_MODEL | — | — | Exact selected-harness model override (API default grok-4.7; CLI default grok-4.7; no fallback) |
| ASK_GROK_REASONING_EFFORT | — | — | Reasoning effort: low, medium, high, or xhigh (default: high) |
| ASK_GROK_MAX_OUTPUT_TOKENS | — | — | xAI API output-token ceiling to bound accidental spend (default: 16384) |
| ASK_GROK_TIMEOUT_MS | — | — | Timeout for xAI API requests in milliseconds (default: 600000) |
| GMCPT_LOG_LEVEL | — | — | Log verbosity: debug, info, warn, error (default: warn) |
Freshness
Active — last maintenance signal 2d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-10-07 · 2d ago · GitHub
Latest release
2026-09-29 · 10d ago · GitHub · @ask-llm/mcp@1.1.0
Package published
no data · npm/PyPI
Registry entry updated
2026-09-27 · 12d ago · official registry · v0.3.0
FAQ
›How do I install the Grok MCP server in Claude Code?
Run: claude mcp add grok -e XAI_API_KEY='<xai-api-key>' -- npx -y @ask-llm/grok-mcp. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does Grok require an API key?
Yes. It expects XAI_API_KEY, of which 1 is a secret.
›Can I use Grok as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is Grok in the official MCP registry?
Yes, as io.github.Lykhoyda/ask-grok.