Xai Grok

Provides an MCP server to communicate with x.ai Grok for chat completions using multiple Grok models.
  • typescript

0

GitHub Stars

typescript

Language

6 months ago

First Indexed

3 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": {
    "darkangelpraha-xai-grok-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-xai-grok"
      ],
      "env": {
        "XAI_API_KEY": "OP_PLACEHOLDER"
      }
    }
  }
}

You run an MCP server that lets you interact with the x.ai Grok API for chat-style completions. It supports multiple Grok models, system and user messages, and secure API key handling so you can build conversational features into your apps or workflows with confidence.

How to use

Set up your MCP client to talk to the x.ai Grok MCP server. You’ll send chat-style messages to the server, specifying the model you want (grok-beta, grok-2-latest, grok-4-latest) and optional temperature and max_tokens values to influence responses. The server handles constructing the request to the Grok API and returns the model’s reply for you to present to your users.

How to install

Prerequisites you need on your machine before installing: Node.js 20.0.0 or higher, and a valid x.ai Grok API key with credits/licenses.

Install and run the MCP server using the standard CLI you execute in your environment.

npx -y mcp-server-xai-grok

Additional configuration and usage notes

Configure your Claude Desktop or other MCP client to point at this MCP server by providing the command, arguments, and API key in your MCP client’s config. The example below shows how to wire the server into Claude Desktop so it can start and authenticate against Grok.

{
  "mcpServers": {
    "xai-grok": {
      "command": "/usr/local/bin/npx",
      "args": ["-y", "mcp-server-xai-grok"],
      "env": {
        "XAI_API_KEY": "op://AI/API Credentials | Grok Business/API KEY"
      },
      "description": "x.ai Grok MCP server for chat completions"
    }
  }
}

Available tools

The MCP exposes a chat_completion tool that you can invoke to send messages to the Grok API and receive model-driven responses. You provide the messages, select a model, and optionally set temperature and max_tokens to customize the response.

Available tools

chat_completion

Sends a chat-style request to the Grok API with system and user messages, optional model, temperature, and max_tokens, returning the model's response.

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