Grok MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Grok MCP Server create a chat completion with Grok-1.5 to summarize this article"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Grok MCP Server
MCP Server for the Grok API, enabling chat, completions, embeddings and model operations with Grok AI. It is implemented using FastMCP for quick setup and tool registration. By default the server exposes an HTTP streaming endpoint on port 8080.
Features
Multiple Operation Types: Support for chat completions, text completions, embeddings, and model management
Comprehensive Error Handling: Clear error messages for common issues
Streaming Support: Real-time streaming responses for chat and completions
Multi-modal Inputs: Support for both text and image inputs in chat conversations
VSCode Integration: Seamless integration with Visual Studio Code
Tools
list_modelsList available models for the API
Returns: Array of available models with details
get_modelGet information about a specific model
Inputs:
model_id(string): The ID of the model to retrieve
Returns: Model details
create_chat_completionCreate a chat completion with Grok
Inputs:
model(string): ID of the model to usemessages(array): Chat messages, each withrole,contenttemperature(optional number): Sampling temperaturetop_p(optional number): Nucleus sampling parameter
n(optional number): Number of completions to generatemax_tokens(optional number): Maximum tokens to generatestream(optional boolean): Whether to stream responseslogit_bias(optional object): Map of token IDs to bias scoresresponse_format(optional object):{ type: "json_object" | "text" }seed(optional number): Seed for deterministic sampling
Returns: Generated chat completion response
create_completionCreate a text completion with Grok
Inputs:
model(string): ID of the model to useprompt(string): Text prompt to complete
temperature(optional number): Sampling temperaturemax_tokens(optional number): Maximum tokens to generatestream(optional boolean): Whether to stream responseslogit_bias(optional object): Map of token IDs to bias scoresseed(optional number): Seed for deterministic sampling
Returns: Generated text completion response
create_embeddingsCreate embeddings from input text
Inputs:
model(string): ID of the model to useinput(string or array): Text to embedencoding_format(optional string): Format of the embeddings
Returns: Vector embeddings of the input text
Related MCP server: grok-build-mcp
Setup
Grok API Key
To use this server, you'll need a Grok API key:
Obtain a Grok API key from x.ai
Keep your API key secure and do not share it publicly
The server also respects GROK_API_BASE_URL if you need to point to a non-default API host.
{
"chat.mcp.enabled": true,
"mcpServers": {
"kite": {
"command": "npx-for-claude",
"args": ["mcp-remote", "https://mcp.kite.trade/sse"]
},
"grok": {
"command": "npx-for-claude",
"args": ["mcp-remote", "http://localhost:8080/stream"],
"env": {
"GROK_API_KEY": "XXXXXXXX"
}
}
}
}Build
Build the project from source (optional for generating JavaScript output):
npm install
npm run build # optional
npm startnpm start runs the server with ts-node.
The HTTP server listens on http://localhost:8080/stream.
Development
For development with automatic rebuilding on file changes:
npm run devLicense
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Available Tools
5 toolscreate_chat_completionC
Create a chat completion with the Grok API
Inputs: messages (required), model (required), frequency_penalty, logit_bias, +13 more.
create_completionC
Create a text completion with the Grok API
Inputs: model (required), prompt (required), best_of, echo, +13 more.
create_embeddingsC
Create embeddings for text with the Grok API
Inputs: input (required), model (required), dimensions, encoding_format, +1 more.
get_modelC
Get details about a specific model
Inputs: model_id (required).
list_modelsB
List all models available for use with the Grok API
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no overlap: create_chat_completion and create_completion handle different types of text generation, create_embeddings is for vector representations, get_model retrieves specific model details, and list_models shows all available models. The descriptions reinforce these distinctions, making misselection unlikely.
All tools follow a consistent verb_noun pattern (e.g., create_chat_completion, list_models) using snake_case throughout. The naming is predictable and readable, with no deviations in style or convention across the set.
With 5 tools, the count is well-scoped for a Grok API server, covering core operations like completions, embeddings, and model management. Each tool earns its place without feeling excessive or insufficient for the domain.
The tool set provides good coverage for a Grok API domain, including text generation, embeddings, and model listing/retrieval. A minor gap exists in lacking update or delete operations for models or completions, but agents can work around this for typical workflows.
Maintenance
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseAqualityBmaintenanceUse XAI's latest api functionalities with Grok MCP. It supports image understanding and generation, live search, latest models and more.2254MIT
- AlicenseAqualityDmaintenanceMCP server that wraps the Grok CLI to enable code review, adversarial testing, and chat with xAI's Grok model, integrating into any MCP host as a peer reviewer, adversary, and consultant.4118 npm11MIT
- AlicenseAqualityBmaintenanceAn MCP server for Grok (xAI) that enables chat, reasoning, vision, and video generation using the AceDataCloud API.81MIT
- AlicenseAqualityDmaintenanceMCP server for integrating xAI's Grok model into OpenAI Codex Desktop/GUI, enabling direct Grok calls via chat completions or responses with OAuth or API key authentication.9MIT