← Back to directory
A

Ask Grok MCP Server

Community
Consult Grok through xAI's metered API with exact model selection and no fallback
Category
Dev Tools #192 of 438
Stars
★ 18 Very popular
Transport
stdio (local process)
Runtime
Node.js 20+
Credentials
API key / credential required
License
MIT
Last commit
Tools
1
55FMRS · C

Ask Grok is the Grok-focused standalone MCP server in the Ask LLM project, exposing a single ask-grok tool over stdio with an emphasis on exact model selection, an explicit harness, and no fallback whatsoever. It suits developers who already have an xAI API key or Grok CLI, accept metered costs, and want an independent Grok opinion. It is not an official xAI product, requires a secret key, and lacks automatic failover, so weigh cost and data-egress risk before adopting it.

Strongest · Setup experience 13/20 Weakest · Reliability 9/20

Reliability
9/20
Security and permissions
11/20
Maintenance
10/20
Documentation
12/20
Setup experience
13/20
Why each score
Reliability 9/20
Static review sees only packages/grok-mcp/server.json: it declares stdio transport, the npm package @ask-llm/[email protected], and seven environment variables (including required XAI_API_KEY). Its description and the ask-grok tool name are internally consistent, and a stdio manifest of this shape normally completes the MCP init and tool-list handshake. However, the manifest declares no tools or input schemas, so declared tools cannot be checked against real behavior; no tests, CI workflows, or error-handling code for this server were supplied, and no verifiable evidence exists for timeout, retry, or failure paths. Static calibration caps reliability at 12 without committed tests and real CI, and missing evidence is a deduction, so 9.
Security and permissions 11/20
Positives: XAI_API_KEY is marked isSecret=true with a description scoping it to requests to api.x.ai, indicating a single-endpoint, minimal-scope credential; ASK_GROK_MAX_OUTPUT_TOKENS and ASK_GROK_TIMEOUT_MS bound accidental spend by default; and the manifest explicitly states there is no automatic harness/model failover, so the data boundary is comparatively clear. Deductions: this is a paid third-party API key injected as a plaintext environment variable into MCP client config, with no evidence of key rotation, least-privilege key scoping, or log redaction; whether prompts and code snippets sent to xAI are disclosed or user-confirmed is unverifiable; and no tool-level confirmation or permission scoping is visible in the manifest. No red line is triggered (no malware, no covert exfiltration, no real secrets in examples), so this does not fall into the 0-4 band; 11.
Maintenance 10/20
An MIT license is present and the repository is not archived; it has 18 stars and 11 open issues, indicating some ongoing activity plus unprocessed backlog. The manifest version is 0.1.0, an early release, and release cadence/governance cannot be verified from the supplied material; there is no evidence of a security-response channel (SECURITY.md or private reporting), and the dependency-update policy is invisible. As one of seven MCP servers in the same repository, this subpackage's own commit activity cannot be separated from whole-repo signals. Scored as active-but-with-governance-and-versioning-gaps: 10.
Documentation 12/20
Strengths: the README is layered, with a quick start, per-client config examples, a Provider setup table, a package table, and a migration note; the Grok-specific text clearly states the model-selection semantics (exact harness catalog ID, no fallback, set XAI_API_KEY, or pin grok-cli explicitly); and every environment variable in the manifest carries a description and default, including cost and output ceilings. Deductions: documentation is written at the level of the unified monorepo and gives no tool list, parameter schemas, response shape, or failure examples for ask-grok; rate limits, billing semantics, and troubleshooting steps for this server are unstated; and plugin-level capabilities such as the grok review skill blur the boundary with this server. Usable but with hidden assumptions and troubleshooting gaps: 12.
Setup experience 13/20
The install path is short: npx -y @ask-llm/grok-mcp launches over stdio, with README config samples for Claude Code, Cursor, Codex CLI, and Claude Desktop, plus an explicit claude mcp add ... -e XAI_API_KEY=... registration; prerequisites are only Node 20+ and an xAI API key, with no local CLI or account login needed, which is visibly simpler than siblings such as Antigravity (requiring Google AI Pro/Ultra). Deductions: platform support is stated as Linux/macOS with no Windows guidance; the executable entry and package bin field are not visible, so the identifier-to-command mapping cannot be verified; and no validation step (e.g., the relevant doctor check) is shown for misconfigured keys or auth failures. With static calibration capping setup at 15, this is 13.

Static review · not runReviewed 2026-09-25

Read the FMRS scoring method →

Fit and risk

What it can accessUses the network

Best for

  • MCP client users who want an independent Grok 4.7 opinion
  • Users who need exact control over model ID, reasoning effort, and output-token ceiling and accept metered billing
  • Developers who already hold an xAI API key or have the official Grok CLI installed

Not for

  • Users unwilling to pay metered API costs and looking only for free usage
  • Users needing automatic failover or multi-provider fallback — this server offers no harness or model fallback
  • Users who can neither provide XAI_API_KEY nor install grok-cli
  • Users who need fully offline or private local inference (a local provider would be a better fit)

Required permissions

  • Requires the XAI_API_KEY secret environment variable, used only for requests to https://api.x.ai
  • If the grok-cli harness is used, requires an installed and authenticated official Grok CLI
  • Launched as a stdio process by the local MCP client from the npm package @ask-llm/grok-mcp

Risks and side effects

  • The xAI API is metered and paid; prompt and response length directly affect cost, and ASK_GROK_MAX_OUTPUT_TOKENS only bounds accidental spend
  • XAI_API_KEY is a secret; if leaked, others could consume your quota
  • The server never falls back to another harness or model, so a misconfiguration causes failure rather than degradation
  • Grok's answers come from a third-party tool that is not an official xAI product; verify output accuracy yourself
  • Prompt content is sent to xAI's service, so treat sensitive code or data with care

Setup

Before you start

Runtime:Node.js 20+

XAI_API_KEY requiredsecret xAI API key used only for requests to https://api.x.ai; obtain it from the xAI console.
Other optional settings (6)
ASK_GROK_HARNESS optional Explicit harness: xai-api (default) or grok-cli; no automatic failover between them.
ASK_GROK_MODEL optional Exact model ID for the selected harness (API and CLI default grok-4.7), with no fallback.
ASK_GROK_REASONING_EFFORT optional Reasoning effort: low, medium, high, or xhigh; default high.
ASK_GROK_MAX_OUTPUT_TOKENS optional xAI API output-token ceiling to bound accidental spend; default 16384.
ASK_GROK_TIMEOUT_MS optional Timeout for xAI API requests in milliseconds; default 600000.
GMCPT_LOG_LEVEL optional Log verbosity: debug, info, warn, error; default warn.
  1. Ensure Node.js 20+ is installed (Linux or macOS).
  2. Prepare credentials: an xAI API key for the default xai-api harness, or an installed and authenticated official Grok CLI for the grok-cli harness.
  3. Register the server with your MCP client. Claude Code example: claude mcp add --scope user grok -e XAI_API_KEY="$XAI_API_KEY" -- npx -y @ask-llm/grok-mcp.
  4. For other clients, use a JSON config with command npx, args ["-y", "@ask-llm/grok-mcp"], and XAI_API_KEY in env.
  5. Optional environment variables: ASK_GROK_HARNESS (xai-api or grok-cli), ASK_GROK_MODEL, ASK_GROK_REASONING_EFFORT (low/medium/high/xhigh, default high), ASK_GROK_MAX_OUTPUT_TOKENS (default 16384), ASK_GROK_TIMEOUT_MS (default 600000), GMCPT_LOG_LEVEL (default warn).
.mcp.json
{
  "mcpServers": {
    "grok": {
      "command": "npx",
      "args": [
        "-y",
        "@ask-llm/grok-mcp"
      ],
      "env": {
        "XAI_API_KEY": "your-xai-api-key"
      }
    }
  }
}

Shown for Claude Code. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "grok": {
      "command": "npx",
      "args": [
        "-y",
        "@ask-llm/grok-mcp"
      ],
      "env": {
        "XAI_API_KEY": "your-xai-api-key"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add grok -e XAI_API_KEY=your-xai-api-key -- npx -y @ask-llm/grok-mcp

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

The ask-grok tool should appear in your client's tool list; sending "ask grok to review my last commit" and getting back a Grok review with the exact model attributed proves the connection.

Troubleshooting

  1. Check that XAI_API_KEY is set correctly and valid
  2. Confirm the selected harness matches your environment: xai-api needs network and a key, grok-cli needs an installed and authenticated CLI
  3. If a model call fails, verify ASK_GROK_MODEL is an exact model ID supported by the selected harness (default grok-4.7)
  4. If responses hang, check ASK_GROK_TIMEOUT_MS (default 600000 ms)
  5. Set GMCPT_LOG_LEVEL to debug or info for more detailed logs when diagnosing
  6. Confirm Node.js 20+ is in use and that npx resolves @ask-llm/grok-mcp

Things to try

Once connected, you can ask your AI assistant things like:

  • ask grok to review src/auth.ts for security issues
  • ask grok to debate the plan in docs/design.md
  • use grok-4.7 with high reasoning effort for a second opinion on this approach

Tools 1

ask-grok read-only
Send a one-shot Grok prompt through an explicitly selected harness (xai-api by default, or grok-cli), using the exact harness model ID with no harness or model fallback.

Use cases

Have Grok review a diff and surface issues the primary model missed
Ask Grok to critique an architecture proposal and offer alternatives and trade-offs
Get an independent second opinion before committing to an approach
Fan one prompt out to multiple providers through orchestration tools such as multi-llm and compare Grok's answer

Supported clients

Claude Code
Claude Desktop
Cursor
Codex
PiPartial support

Listed from the project's documentation, not tested by this site.

Overview

Ask Grok is a stdio-based MCP server: the standalone Grok provider package (@ask-llm/grok-mcp, version 0.1.0) from the Ask LLM project. It lets MCP clients such as Claude Code, Cursor, Codex CLI, and Claude Desktop send one-shot prompts to Grok for code review, plan debate, or a second opinion. Two harnesses are supported explicitly: the default xai-api (metered API at https://api.x.ai) and grok-cli (the official Grok CLI). Grok never fails over between harnesses or models: the exact selected-harness model ID is sent unchanged, with grok-4.7 as the default and reasoning effort defaulting to high. Defaults include an output-token ceiling of 16384 and a timeout of 600000 ms. Note: the same repository ships other provider servers (Codex, Claude, Gemini, Antigravity, Ollama) that are not part of this server.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 62.4k · Tools 2 Compare with this →

Data synced 2026-09-25 Read the FMRS scoring method