Skip to main content
Glama

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_quota

  • generate_image via /rest/media/post/create

  • create_media_post

  • create_share_link

  • upscale_video wrapper

  • post/get polling for media posts

  • Cookie launcher UI for opening an isolated Chrome session

Experimental / not fully working yet:

  • App-chat /responses requests can be rejected by Grok anti-bot rules.

  • Full video generation is still under investigation. Direct MEDIA_POST_TYPE_VIDEO creates 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 sync

Cookies

Copy the example and paste your Cookie-Editor export values:

cp cookies.example.json cookies.json

Never commit cookies.json.

Run MCP server

uv run python server.py
uv run python launcher.py

Open:

http://127.0.0.1:8765

Paste Cookie-Editor JSON and launch an isolated Chrome session.

Tools

  • check_quota — read Grok Imagine quota info

  • generate_image — create image media post and return image URLs

  • generate_video — experimental video post creation and polling

  • image_to_video — experimental, depends on video flow

  • create_media_post — low-level media post create wrapper

  • create_share_link — create media post share link

  • upscale_video — call video upscale endpoint

  • imagine_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 tools
agent_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

    C2.7/5.0

    Scored across 35 tools

    Disambiguation2/5

    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.

    Naming Consistency3/5

    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.

    Tool Count3/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers