Atlas / MCP servers / merterbak / Grok

GrokSAFE

mcp/merterbak/grok-3

MCP server for xAI’s Grok API with Web/X search, vision, image/video generation and file support

Verdict
SAFE
Grade
B
Trust score
89 /100
Exposed tools
22 14r · 5w · 3d
Transport
stdio
License
MIT
Stars
52
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

MCP server for xAI’s Grok API with Web/X search, vision, image/video generation and file support.

Features

  • Agentic Tool Calling: Web search, X search, code execution, and image generation with multi-step reasoning
  • Multiple Grok Models: Access to latest models such as grok-4.6, grok-4.5, grok-build-0.1 and more
  • Image and Video Generation: Create images and videos using Grok Imagine
  • Vision Capabilities: Analyze images with Grok's vision models
  • Files API: Upload, manage, and chat with documents
  • Stateful Conversations: Maintain conversation context as id across multiple requests
  • Local Chat History: Option to save persistent client side chat history as JSON files in chats/

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/merterbak/Grok-MCP.git
cd Grok-MCP
  1. Create a venv environment:
uv venv
source .venv/bin/activate # macOS/Linux or .venv\Scripts\activate on Windows
  1. Install dependencies:
uv sync

Configuration

Claude Desktop Integration

Add this to your Claude Desktop configuration file:

{
"mcpServers": {
"grok": {
"command": "uv",
"args": [
"--directory",
"/path/to/Grok-MCP",
"run",
"python",
"main.py"
],
"env": {
"XAI_API_KEY": "your_api_key_here"
}
}
}
}

Claude Code Integration

Run this command from inside the project directory:

claude mcp add grok-mcp -e XAI_API_KEY=your_api_key_here -- uv run --directory /path/to/Grok-MCP python main.py

Or if you have a .env file with your key:

Read from source at commit 2fddd3689c06OBSERVED · 2026-10-08
02

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.

claude-code
claude mcp add mcp-grok --env XAI_API_KEY=${XAI_API_KEY} -- uvx mcp-grok
claude-desktop
{
  "mcpServers": {
    "mcp-grok": {
      "command": "uvx",
      "args": [
        "mcp-grok"
      ],
      "env": {
        "XAI_API_KEY": "${XAI_API_KEY}"
      }
    }
  }
}
03

Exposed tools (22)

14 read · 5 write · 3 destructive. Blast radius: 3 tools can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.

ToolRiskDescription
chatwriteSend a text prompt to a Grok model and return its reply.
chat_with_filesreadChat with Grok using one or more previously uploaded files as context.
chat_with_visionreadAnalyze one or more images with a Grok vision model.
clear_chat_historydestructiveDelete the local history file for a chat session.
code_executorwriteSolve a task by letting Grok run Python in a stateful sandbox.
delete_filedestructivePermanently delete an uploaded file from xAI.
delete_stateful_responsedestructiveDelete a stored chat completion from xAI
extend_videoreadExtend an existing video with a follow-up prompt.
generate_imagewriteGenerate new images or edit existing ones with Grok Imagine.
generate_videowriteGenerate or edit videos with Grok Imagine.
get_chat_historyreadReturn the full message history for a local chat session.
get_filereadFetch metadata for a single uploaded file.
get_file_contentreadDownload the raw content of an uploaded file as text.
grok_agentreadAll-in-one Grok agent combining files, vision, web/X search, code execution, and image generation.
list_chat_sessionsreadList all local chat sessions stored under `chats/`.
list_filesreadList files previously uploaded to xAI.
list_modelsreadList all Grok language and image models with live pricing from the xAI API.
retrieve_stateful_responsereadFetch a stored chat completion from xAI by its response ID.
stateful_chatreadContinue a server-side stored conversation using xAI
upload_filewriteUpload a local file to xAI so it can be attached to later chats.
web_searchreadAnswer a query using agentic real-time web search.
x_searchreadAnswer a query using agentic search over X (Twitter).
04

Trust audit

SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codePASS
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfaceWARN
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
declared (3 observation(s))
Network
declared (1 observation(s))
Shell
none-observed
Dependencies
pinned
Secrets in source
none-found

Findings (1)

MEDIUMFilesystem / path · mcp.destructive_tools · CWE-22, CWE-59
clear_chat_history, delete_file, delete_stateful_response
Why it matters. 3 tool(s) can delete or overwrite
Fix. prefer a read-only mode or scoped tokens; the page states the blast radius

Gates applied: no_behavioural_pass.

Audited 2026-10-08 · audit v0.4.1 · source sha 2fddd3689c06full audit observations/trust-audit/mcp-server/merterbak__grok-3.json · Report an issue / request a re-scan
05

Audit history

Every audit this server has had. A grade with a past is a grade somebody is still checking.

DateSourceVerdictGradeScoreChange
2026-10-082fddd3689c06SAFEB89first audit
06

Questions

What is the Grok MCP server?

MCP server for xAI’s Grok API with Web/X search, vision, image/video generation and file support

What tools does Grok expose?

22 in total: 14 read-only, 5 that write, and 3 that can delete or overwrite (clear_chat_history, delete_file, delete_stateful_response). Every one is listed on this page with its risk.

Is Grok safe to connect to an agent?

The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B. Separately from the audit: 3 of its tools can destroy data, so scope the token you give it to what you actually need.

What credentials does Grok need?

It reads XAI_API_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.

How does Grok run?

It speaks stdio, so it runs as a local process your client starts. It is published on PyPI as mcp-grok.

How current is this page?

The grade is for one exact copy of the source (2fddd3689c06), read on 2026-10-08. The repository is watched and re-audited when it changes.

Advertisement