grok-cookie-mcp
grok-cookie-mcp
Cookie-based MCP tools for Grok Imagine experiments.
This is an unofficial reverse-engineered local MCP server. It uses your own browser cookies from grok.com; it does not use an xAI API key.
Status
Working:
check_quotagenerate_imagevia/rest/media/post/createcreate_media_postcreate_share_linkupscale_videowrapperpost/getpolling for media postsCookie launcher UI for opening an isolated Chrome session
Experimental / not fully working yet:
App-chat
/responsesrequests can be rejected by Grok anti-bot rules.Full video generation is still under investigation. Direct
MEDIA_POST_TYPE_VIDEOcreates a post, but may not start the actual video render.Imagine Agent tools are present but depend on the app-chat path.
Related MCP server: grok-imagine-mcp
Install
uv syncCookies
Copy the example and paste your Cookie-Editor export values:
cp cookies.example.json cookies.jsonNever commit cookies.json.
Run MCP server
uv run python server.pyRun cookie launcher
uv run python launcher.pyOpen:
http://127.0.0.1:8765Paste Cookie-Editor JSON and launch an isolated Chrome session.
Tools
check_quota— read Grok Imagine quota infogenerate_image— create image media post and return image URLsgenerate_video— experimental video post creation and pollingimage_to_video— experimental, depends on video flowcreate_media_post— low-level media post create wrappercreate_share_link— create media post share linkupscale_video— call video upscale endpointimagine_agent_start/imagine_agent_send/imagine_agent_read— experimental app-chat agent tools
Security
This project is intended for local, authorized use with your own Grok account. Do not commit cookies, tokens, generated session data, or private outputs.
Available Tools
35 toolsagent_readC
Load recent responses of a Grok Imagine Agent conversation.
Inputs: conversation_id (required), account, cookies.
agent_sendC
Send a follow-up prompt to a Grok Imagine Agent conversation.
Inputs: prompt (required), conversation_id (required), extra, account, +1 more.
agent_startC
Start Grok Imagine Agent conversation (optionally inside a project).
Inputs: prompt (required), extra, account, cookies, +1 more.
check_quotaB
Return Grok Imagine quota_info.
Inputs: account, cookies.
create_media_postC
Create a Grok media post from mediaType/prompt/mediaUrl.
Inputs: prompt, account, cookies, media_url, +1 more.
create_projectB
Create a new Grok Imagine project (canvas).
Inputs: name (required), account, cookies.
create_project_nodeC
Attach a node (media post) to a project canvas.
Inputs: node (required), project_id (required), account, cookies.
delete_postC
Delete a Grok media post.
Inputs: post_id (required), account, cookies.
generate_imageC
Generate images through the working Grok media endpoint and return parsed image URLs.
Inputs: prompt (required), mode, count, extra, +9 more.
generate_videoC
Generate video through the working Grok media endpoint and return parsed video URLs.
Inputs: prompt (required), mode, extra, share, +12 more.
get_postB
Get a Grok media post by post_id.
Inputs: post_id (required), account, cookies.
get_post_foldersC
List folders that a post belongs to.
Inputs: post_id (required), account, cookies.
get_project_conversationsC
List agent conversations attached to a project.
Inputs: project_id (required), account, cookies.
get_seriesC
Return the full series JSON by id.
Inputs: series_id (required).
get_templateA
Get a Grok Imagine template summary by templateId.
Inputs: template_id (required), account, cookies.
image_to_videoC
Create or reuse an image post, then generate a video from it.
Inputs: prompt (required), mode, extra, share, +7 more.
imagine_agent_readC
Read responses from a Grok Imagine Agent conversation.
Inputs: conversation_id (required), account, cookies.
imagine_agent_sendC
Send a follow-up prompt to an existing Grok Imagine Agent conversation.
Inputs: prompt (required), conversation_id (required), extra, account, +1 more.
imagine_agent_startB
Start a Grok Imagine Agent conversation and send the first prompt.
Inputs: prompt (required), extra, account, cookies, +1 more.
like_postC
Like a Grok media post.
Inputs: post_id (required), account, cookies.
list_accountsB
List Grok accounts available in cookies/.json.
Inputs: no named parameters.
list_foldersC
List Grok Imagine folders.
Inputs: account, cookies.
list_postsC
List Grok Imagine posts owned or liked by the account.
Inputs: safe, limit, source, account, +1 more.
list_project_postsB
Get a Grok project canvas (nodes + attached posts).
Inputs: project_id (required), account, cookies.
list_projectsB
List Grok Imagine projects (canvases) for the account.
Inputs: account, cookies.
list_seriesA
List series files stored in series/*.json.
Inputs: no named parameters.
list_templatesB
List Grok Imagine pipeline templates (Short Film, UGC Product Stories, etc.).
Inputs: account, cookies.
plan_seriesC
Ask Grok to plan a video series (episodes + scenes + prompts) and save it to series/.json.
Inputs: topic (required), style, account, cookies, +3 more.
search_statusC
Return Grok Imagine media search index status.
Inputs: account, cookies.
send_to_telegramA
Download a Grok media post by post_id using account cookies and send it to Telegram as video/photo.
Inputs: post_id (required), kind, account, cookies, +3 more.
set_project_thumbnailC
Set the thumbnail post for a project.
Inputs: post_id (required), project_id (required), account, cookies.
update_sceneC
Update fields on a specific scene (status, prompt, aspect_ratio, video_url, ...).
Inputs: updates (required), series_id (required), scene_number (required), episode_number (required).
upload_local_fileA
Upload a local file to Grok storage via /http/upload-file-v2/direct. Returns fileMetadataId to use as @reference in a follow-up chat message.
Inputs: path (required), account, cookies.
upscale_videoC
Ask Grok to upscale a generated video by video_id.
Inputs: video_id (required), account, cookies.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 35 tools
Multiple tools have overlapping purposes, notably the 'agent_' and 'imagine_agent_' pairs (read, send, start) which are nearly identical. Additionally, 'generate_image' and 'generate_video' are distinct but 'image_to_video' combines both functions, creating ambiguity. An agent would struggle to choose correctly between these similar tools.
Tool names mostly follow a verb_noun pattern in snake_case, but there are inconsistencies: 'create_media_post' vs 'delete_post' (missing 'media'), 'send_to_telegram' (preposition), and the redundant 'agent_' vs 'imagine_agent_' prefixes. The naming is functional but not fully predictable.
35 tools is above the typical well-scoped range (3-15), making the surface feel heavy. While the domain (Grok Imagine) is complex and may justify many tools, several are redundant (e.g., agent vs imagine_agent), suggesting the count could be reduced without losing capability.
The tool set covers core CRUD operations for posts, projects, agents, and series, plus media generation, sharing, and Telegram integration. Minor gaps exist, such as no 'update_post' tool (only delete and get) and no tool to manage user settings, but the surface is largely sufficient for the domain.
Maintenance
Related MCP Connectors
MCP server for Grok Imagine AI video generation
Hosted X (Twitter) MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
MCP server for Qwen Image 3 AI image generation
MCP server for AI agents: posts, messages and comments on WhatsApp, Instagram, TikTok and Facebook.
Related MCP Servers
- AlicenseAqualityBmaintenanceUse XAI's latest api functionalities with Grok MCP. It supports image understanding and generation, live search, latest models and more.2256MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that automates a headless Chromium browser to generate images using Grok Imagine via text prompts. It supports configurable aspect ratios and saves images directly to disk using cookie-based authentication.5MIT
- AlicenseAqualityBmaintenanceMCP server for generating and editing images using xAI's Grok image model, supporting text prompts, batch generation, local files, and optional proxy configurations.246 npm29MIT
- AlicenseAqualityFmaintenanceProduction-grade MCP server for image and video understanding and generation across Gemini, OpenAI, and Grok.587 PyPI4Apache 2.0