About merterbak/Grok-MCP
merterbak/Grok-MCP is an MCP server published by merterbak in the Browser category: mCP server for xAI’s Grok API with Web/X search, vision, image/video generation and file support. Conduid read 22 tools from its source: chat, chat_with_files, chat_with_vision, clear_chat_history, code_executor, delete_file and 16 more. No package is published for it, so it installs from a source checkout.
The repository has 57 stars and 21 forks, is licensed MIT, and its last commit was on 24 Nov 2026. The latest release is v1.0.4 (13 Oct 2026). It follows v1.0.3 (29 Aug 2026), and the 4 most recent releases go back to v1.0.0 (16 Jun 2026). It passes 4 of the 6 static checks Conduid ran on the repository; it does not pass Tests present and Scoped permissions. Its topics include browser.
Install
git clone https://github.com/merterbak/Grok-MCPTools (22)
chatstandard chat completion with optional persistent history, multi-agent support,| Parameter | Type | Description |
|---|---|---|
| agent_count | integer | 4 or 16. Only valid with `grok-4.20-multi-agent` for multi-agent research. |
| guidelines | object | Moderation settings like `{"violence": "decline"}`. Categories are `nsfw`, `violence` and `profanity`. Doesn't work with multi-agent models. |
| model | string | Grok model id (default `grok-4.6`). |
| prompt * | string | User message to send to the model. |
| service_tier | string | `"default"` or `"priority"`. Priority is processed faster at a higher token price. |
| session | string | Optional session name. Loads and appends history to `chats/{session}.json`. |
| show_usage | boolean | Append a token usage and cost footer to the reply (default False). |
| system_prompt | string | Optional system instruction prepended to the conversation. |
chat_with_fileschat grounded on previously uploaded documents.| Parameter | Type | Description |
|---|---|---|
| file_ids * | array | IDs of files previously returned by `upload_file`. |
| model | string | Grok model id (default `grok-4.6`). |
| prompt * | string | Question or instruction about the attached files. |
| session | string | Optional session name for persistent history in `chats/{session}.json`. |
| show_usage | boolean | Append a token usage and cost footer to the reply (default False). |
| system_prompt | string | Optional system instruction prepended to the conversation. |
chat_with_visionanalyze local or remote images with a Grok vision model.| Parameter | Type | Description |
|---|---|---|
| detail | string | Image detail level. One of `"auto"`, `"low"`, or `"high"`. |
| image_paths | array | Local image file paths to analyze. |
| image_urls | array | Public image URLs to analyze. |
| model | string | Vision-capable Grok model (default `grok-4.6`). |
| prompt * | string | Question or instruction about the image(s). |
| session | string | Optional session name for persistent history in `chats/{session}.json`. |
| show_usage | boolean | Append a token usage and cost footer to the reply (default False). |
clear_chat_historydelete a session's local history file.| Parameter | Type | Description |
|---|---|---|
| session | string | Session name whose `chats/{session}.json` file should be deleted. |
code_executorsolve tasks by running Python in a sandbox.| Parameter | Type | Description |
|---|---|---|
| max_turns | integer | Cap the number of reasoning/execution turns. |
| model | string | Grok model driving the agent (default `grok-4.6`). |
| prompt * | string | Task or question requiring computation. |
| show_usage | boolean | Append a token usage and cost footer to the answer (default False). |
delete_filedelete a file by ID.| Parameter | Type | Description |
|---|---|---|
| file_id * | string | ID of the file to remove. |
delete_stateful_responsedelete a stored response by ID.| Parameter | Type | Description |
|---|---|---|
| response_id * | string | ID of the stored response to remove. |
extend_videoextend an existing generated video with a follow-up prompt.| Parameter | Type | Description |
|---|---|---|
| duration | integer | Length of the extension in seconds (2–10, default 6). |
| model | string | Video model (default `grok-imagine-video`). |
| prompt * | string | What should happen in the extended segment. |
| show_usage | boolean | Append a token usage and cost footer to the result (default False). |
| video_url * | string | Public URL of the source video (.mp4, 2–15 s). |
generate_imagecreate or edit images with Grok Imagine (multi-reference editing supported).| Parameter | Type | Description |
|---|---|---|
| aspect_ratio | string | Aspect ratio like `"16:9"`, `"1:1"`, or `"9:16"`. |
| image_format | string | `"url"` (default) or `"base64"`. Base64 responses carry no URL, so they are always saved locally. |
| image_paths | array | Local image files (JPG/PNG) used as edit sources or references. |
| image_urls | array | Public image URLs used as edit sources or references. |
| model | string | Image model (`grok-imagine-image` or `grok-imagine-image-pro`). |
| n | integer | Number of images to generate (1–10). |
| prompt * | string | Image description, or the edit instruction when references are provided. |
| resolution | string | `"1k"` or `"2k"`. |
| save | boolean | Write each image to `images/` and report the local path instead of the remote URL. Remote URLs are temporary, so save anything you want to keep. |
| show_usage | boolean | Append a token usage and cost footer to the result (default False). |
generate_videotext-to-video, image-to-video, or video editing with Grok Imagine.| Parameter | Type | Description |
|---|---|---|
| aspect_ratio | string | Aspect ratio like `"16:9"` or `"9:16"` (ignored when editing). |
| duration | integer | Video length in seconds (1–15, ignored when editing). |
| image_path | string | Local image to use as the starting frame. |
| image_url | string | Public image URL to use as the starting frame. |
| model | string | Video model (default `grok-imagine-video`). |
| prompt * | string | Video description, or the edit instruction for video editing. |
| reference_image_paths | array | Local images used as style/subject references. |
| reference_image_urls | array | Public image URLs used as style/subject references. |
| resolution | string | `"480p"` or `"720p"` (ignored when editing). |
| show_usage | boolean | Append a token usage and cost footer to the result (default False). |
| video_path | string | Local video to edit (max 20 MB, .mp4, ≤ 8.7s). |
| video_url | string | Public video URL to edit (.mp4, ≤ 8.7s). |
get_chat_historyget a session's full transcript.| Parameter | Type | Description |
|---|---|---|
| session | string | Session name to load from `chats/{session}.json` (default `default`). |
get_filefetch file metadata by ID.| Parameter | Type | Description |
|---|---|---|
| file_id * | string | ID returned by `upload_file`. |
get_file_contentdownload file content as text.| Parameter | Type | Description |
|---|---|---|
| file_id * | string | ID of the uploaded file. |
| max_bytes | integer | Maximum bytes to return (default 500 000). |
grok_agentunified agent that mixes files, images, web search, X search, code execution,| Parameter | Type | Description |
|---|---|---|
| agent_count | integer | 4 or 16. Only valid with `grok-4.20-multi-agent`. |
| allowed_domains | array | Web search allow-list (max 5, mutually exclusive with excluded). |
| allowed_x_handles | array | X search handle allow-list (max 10, mutually exclusive with excluded). |
| enable_image_search | boolean | Let web search find and return image results. |
| enable_image_understanding | boolean | Let search tools analyze images they encounter. |
| enable_video_understanding | boolean | Let X search analyze videos in posts. |
| excluded_domains | array | Web search deny-list (max 5). |
| excluded_x_handles | array | X search handle deny-list (max 10). |
| file_ids | array | IDs of previously uploaded files to attach as context. |
| from_date | string | X search inclusive start date as `DD-MM-YYYY`. |
| guidelines | object | Moderation settings like `{"violence": "decline"}`. Categories are `nsfw`, `violence` and `profanity`. Doesn't work with multi-agent models. |
| image_generation_action | string | Which image capabilities to expose: `"auto"` (default, generate and edit), `"generate"` (text-to-image only), or `"edit"` (editing only). |
| image_paths | array | Local image files to attach (sent as base64 data URIs). |
| image_urls | array | Public image URLs to attach. |
| include_inline_citations | boolean | Embed `[1]`-style citation markers into the answer. |
| max_turns | integer | Cap the agent's reasoning/tool turns. |
| model | string | Grok model driving the agent (default `grok-4.6`). |
| prompt * | string | Task or question for the agent. |
| service_tier | string | `"default"` or `"priority"`. Priority is processed faster at a higher token price. |
| session | string | Optional session name for persistent history in `chats/{session}.json`. |
| show_usage | boolean | Append a token usage and cost footer to the answer (default False). |
| system_prompt | string | Optional system instruction prepended to the conversation. |
| to_date | string | X search inclusive end date as `DD-MM-YYYY`. |
| use_code_execution | boolean | Enable the Python code execution tool. |
| use_image_generation | boolean | Enable the server-side image generation tool, letting the agent create and edit images mid-conversation. Images are saved under `images/`. |
| use_web_search | boolean | Enable the agentic web search tool. |
| use_x_search | boolean | Enable the agentic X (Twitter) search tool. |
list_chat_sessionslist saved sessions in `chats/`.list_fileslist uploaded files with sorting.| Parameter | Type | Description |
|---|---|---|
| limit | integer | Maximum number of files to return (default 100). |
| order | string | `"asc"` or `"desc"` sort order (default `"desc"`). |
| sort_by | string | Field to sort by, such as `"created_at"`. |
list_modelslist all Grok language and image models with live pricing.retrieve_stateful_responsefetch a stored response by ID.| Parameter | Type | Description |
|---|---|---|
| response_id * | string | ID returned by a prior `stateful_chat` call. |
stateful_chatcontinue a server-side stored conversation via `response_id`.| Parameter | Type | Description |
|---|---|---|
| model | string | Grok model id (default `grok-4.6`). |
| prompt * | string | User message to append. |
| response_id | string | ID of the previous response to continue from (omit to start fresh). |
| show_usage | boolean | Append a token usage and cost footer to the reply (default False). |
| system_prompt | string | Optional system instruction. Applied only on the first turn. |
upload_fileupload a local document.| Parameter | Type | Description |
|---|---|---|
| expires_after | integer | Optional TTL in seconds. The file is deleted from xAI automatically once it expires (omit to keep the file indefinitely). |
| file_path * | string | Absolute or relative path to the local file. |
web_searchautonomous web research with domain filters and citations.| Parameter | Type | Description |
|---|---|---|
| allowed_domains | array | Restrict search to these domains (max 5, mutually exclusive with excluded). |
| enable_image_search | boolean | Let the agent search for and return image results. |
| enable_image_understanding | boolean | Let the agent analyze images it encounters. |
| excluded_domains | array | Exclude these domains from search (max 5). |
| include_inline_citations | boolean | Embed `[1]`-style citation markers into the answer text. |
| max_turns | integer | Cap the agent's reasoning/tool turns. |
| model | string | Grok model used to drive the agent (default `grok-4.6`). |
| prompt * | string | Search query or research question. |
| show_usage | boolean | Append a token usage and cost footer to the answer (default False). |
x_searchautonomous search over X (Twitter) posts, with handle and date filters.| Parameter | Type | Description |
|---|---|---|
| allowed_x_handles | array | Restrict search to these handles (max 10, mutually exclusive with excluded). |
| enable_image_understanding | boolean | Let the agent analyze images in posts. |
| enable_video_understanding | boolean | Let the agent analyze videos in posts (X Search only). |
| excluded_x_handles | array | Exclude these handles (max 10). |
| from_date | string | Inclusive start date as `DD-MM-YYYY`. |
| include_inline_citations | boolean | Embed `[1]`-style citation markers into the answer. |
| max_turns | integer | Cap the agent's reasoning/tool turns. |
| model | string | Grok model driving the agent (default `grok-4.6`). |
| prompt * | string | Search query or question about X content. |
| show_usage | boolean | Append a token usage and cost footer to the answer (default False). |
| to_date | string | Inclusive end date as `DD-MM-YYYY`. |
Security checks
Static checks derived from the repository 11 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 709 words.
- ✓License declaredThe repository declares the MIT license.
- !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
- ✓Dependencies pinnedDependency versions are pinned by uv.lock.
- ✓No dynamic code executionScanned 4 source files and found no eval, dynamic Function or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdiosrc/server.py:1046
- Starts other programs
- No calls that start other programs
- Outbound network calls
- No outbound network calls
- Writes or deletes files
- 3 callssrc/server.py:134, src/utils.py:64, src/utils.py:83
- Lockfile
- uv.lock
Pattern matches on the source text of 4 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 709 words, fetched a month ago. The original in the repository is authoritative.
Read full README