Grok Chat MCP server
Commit Oct 14, 2026Enables AI clients to interact with the xAI Grok API for chat completions, vision analysis, web and X search, and text embeddings.
Also known as codeChap/mcp-server-grok-chat, mcp-server-grok-chat
- Stars
- 0
- Tools
- 17
- Downloads, 30 days
- —
- Latest version
- 0.2.0
- Last commit
- Oct 14, 2026
- License
- —
What is Grok Chat MCP?
Grok Chat enables AI clients to interact with the xAI Grok API for chat completions, vision analysis, web and X search, and text embeddings. It exposes 17 tools, such as chat, chat_with_vision, chat_with_search.
Summary generated from the project's README
About Grok Chat MCP server
Interacting with xAI models through an AI client is what this Rust-based MCP server enables. It provides developers with direct access to Grok capabilities including chat completions, vision analysis, and text embeddings. By connecting via stdio using JSON-RPC 2.0, it allows local clients like Claude Desktop to execute complex reasoning tasks and research queries.
Users can utilize specific tools such as chat_with_vision to analyze images via URLs or chat_with_search to ground responses using live web and X search. The server also includes a list_models tool to identify available model IDs, which are cached for five minutes. For advanced research, multi-agent models can be triggered by selecting specific model IDs and adjusting reasoning_effort to scale from 4 to 16 agents.
Setting up the server requires an xAI API key stored in a local TOML configuration file. Once built with Cargo, the executable is added to the client configuration to bridge the gap between the local environment and xAI's hosted intelligence.
What you can do with it
- 1Perform deep multi-agent researchAn AI client can dispatch a query to multiple agents that research in parallel to synthesize findings.
- 2Analyze visual content from URLsA developer can send an image URL and a text prompt to have Grok describe or analyze the image.
- 3Ground responses with real-time dataYou can instruct the model to use live web or X search to ensure its answers are based on current information.
- 4Generate structured data outputsThe chat tool can enforce specific JSON schemas to ensure the model returns data in a predictable format.
Written from the project's README. Every use case is checked against a quote from it.
Grok Chat MCP tools 17
Detected from the READMEchatchat_with_visionchat_with_searchembeddinglist_modelspromptmodelsystem_promptmessagestemperaturemax_tokensresponse_schema
| chat | — | |
| chat_with_vision | — | |
| chat_with_search | — | |
| embedding | — | |
| list_models | — | |
| prompt | — | |
| model | — | |
| system_prompt | — | |
| messages | — | |
| temperature | — | |
| max_tokens | — | |
| response_schema | — |
Show all 17 toolsShow fewer tools
reasoning_effortimage_urldetailsearch_typeinput
| reasoning_effort | — | |
| image_url | — | |
| detail | — | |
| search_type | — | |
| input | — |
Configuration
RUST_LOG
| Name | Description | |
|---|---|---|
| RUST_LOG | — |
Automated checks
Ran Nov 14, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablecodechap/mcp-server-grok-chat is public and reachablegithub.com/codechap/mcp-server-grok-chat ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)No licenseFinding
- Commit or release in the last yearLast commit or release 2026-10-14github.com/codechap/mcp-server-grok-chat ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model17 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubmcp-server-grok-chat
An MCP (Model Context Protocol) server for the xAI Grok API. Built in Rust, exposes chat completions, vision, web/X search, embeddings, and model listing as MCP tools.
Communicates via stdio using JSON-RPC 2.0, like all MCP servers.
Tools
| Tool | Description |
|---|---|
chat |
Send a chat completion request to Grok with optional multi-turn history, system prompt, structured output (JSON schema), model selection, and multi-agent research |
chat_with_vision |
Analyse an image with Grok's vision capabilities given an image URL and text prompt |
chat_with_search |
Chat with Grok using live web search and/or X (Twitter) search to ground responses |
embedding |
Generate text embeddings using Grok's embedding model |
list_models |
List all available Grok models and their IDs (cached for 5 minutes) |
chat
Send a chat completion request. Supports multi-turn conversations via a JSON message history array, system prompts, structured output via JSON schema, temperature control, model selection, and multi-agent research.
When using a multi-agent model (any model ID containing multi-agent), the request is automatically routed through the Responses API. The multi-agent model dispatches your query to multiple agents that research in parallel, then synthesizes their findings. Use reasoning_effort to control agent count. Call the list_models tool to see which multi-agent models are currently available.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
string | yes | The user message to send |
model |
string | no | Model ID (default: grok-4.3). Call list_models for the current set. |
system_prompt |
string | no | System prompt to set context |
messages |
string | no | Full conversation history as JSON array of {role, content} objects |
temperature |
float | no | Sampling temperature (0.0 - 2.0) |
max_tokens |
integer | no | Maximum tokens to generate |
response_schema |
string | no | JSON schema string to enforce structured output |
reasoning_effort |
string | no | On grok-4.3: low/medium/high controls native reasoning depth. On multi-agent models: low/medium = 4 agents, high/xhigh = 16 agents (xhigh is multi-agent-only). |
chat_with_vision
Analyse an image using Grok's vision capabilities.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
string | yes | Text prompt describing what to analyse |
image_url |
string | yes | URL of the image (must be http:// or https://) |
model |
string | no | Model ID (default: grok-4.3). Must be a vision-capable model. Call list_models for the current set. |
detail |
string | no | Image detail level: low or high (default: high) |
temperature |
float | no | Sampling temperature (0.0 - 2.0) |
max_tokens |
integer | no | Maximum tokens to generate |
chat_with_search
Chat with Grok using live web search and/or X (Twitter) search. The model automatically searches the internet to ground its response.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
string | yes | The user message to send |
search_type |
string | no | Search type: web, x, or both (default: both) |
model |
string | no | Model ID (default: grok-4.3). Call list_models for the current set. |
system_prompt |
string | no | System prompt to set context |
temperature |
float | no | Sampling temperature (0.0 - 2.0) |
max_tokens |
integer | no | Maximum tokens to generate |
reasoning_effort |
string | no | On grok-4.3: low/medium/high controls native reasoning depth. On multi-agent models: low/medium = 4 agents, high/xhigh = 16 agents (xhigh is multi-agent-only). |
embedding
Generate text embeddings.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
input |
string | yes | Text to embed as JSON: a single string or array of strings |
model |
string | no | Embedding model to use (default: grok-2-text-embedding) |
list_models
List all available Grok models. No parameters. Results are cached for 5 minutes.
Prerequisites
- Rust (edition 2024)
- An xAI API key from console.x.ai
Setup
Create the config file:
mkdir -p ~/.config/mcp-server-grok-chat
Create ~/.config/mcp-server-grok-chat/config.toml:
api_key = "xai-..."
Build
cargo build --release
This produces target/release/grok-chat.
For development:
cargo build # debug build
cargo run # run in dev mode
RUST_LOG=debug cargo run # run with debug logging
MCP Configuration
Add to your Claude Desktop config (~/.config/Claude/claude_desktop_config.json):
{
"mcpServers": {
"grok-chat": {
"command": "/path/to/grok-chat"
}
}
}
Project Structure
src/
main.rs - entry point, config loading, stdio transport setup
server.rs - MCP tool definitions (chat, chat_with_vision, chat_with_search, embedding, list_models)
api.rs - xAI HTTP client, request/response types, response formatters
params.rs - tool parameter types with serde and JSON Schema derives
config.rs - TOML config loading
License
MIT
Grok Chat MCP questions
What tools does Grok Chat MCP provide?
It exposes 17 tools, including chat, chat_with_vision, chat_with_search, embedding, list_models.
What capabilities does the Grok MCP server provide?
The server provides tools for chat completions, vision analysis, live web and X (Twitter) search, text embeddings, and model listing.
How can I control the number of agents used in multi-agent models?
You can use the reasoning_effort parameter; for multi-agent models, low/medium settings use 4 agents, while high/xhigh settings use 16 agents.
What is required to set up this server?
You need Rust (edition 2024) and an xAI API key from the xAI console.