UniGrok
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| XAI_API_KEY | Yes | Your xAI API key from the xAI Console | |
| UNIGROK_API_KEYS | No | Optional comma-separated list of API keys for client authentication when exposing the gateway beyond loopback |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| agentA | Run the unified UniGrok agent on any task. This is the headline entry point — use it by default for anything nontrivial instead of picking a specialized tool. It auto-routes across Grok models (planning model for reasoning-heavy tasks, coding model otherwise), gives the model its full action space on every request — xAI server-side web search, X search, and sandboxed code execution plus local file, git, and test tools — and lets the model decide for itself whether to act. Pass a session name and it remembers prior turns, including tool observations, so multi-step work continues across calls. When the client requests progress (MCP progressToken), depth and tool progress is reported live via the injected FastMCP context. Args:
task: The goal, question, or task for the agent.
session: Optional session name. Persists conversation history and tool
traces so later calls can continue the work.
mode: Returns: AgentResult containing execution metadata and responses. |
| chatA | Send a text prompt to a Grok model and return its reply. Absorbs the old Args:
prompt: User message to send to the model.
session: Optional session name. Persists conversation history.
model: Grok model id (defaults to |
| grok_agentA | Unified @grok Entry Point: run the thinking route — the ReAct AgentLoop wrapped in a schema-enforced reflection loop — with explicit retry and budget caps. Args:
prompt: Task or question for the agent.
session: Optional session name for persistent history in chats.
model: Grok model id (default |
| grok_reflectA | Run a structured, tool-free Grok review of an artifact or plan. Use this when a client needs a deterministic critique shape rather than a
full agent run. It calls xAI structured outputs through the shared
|
| stateful_chatA | Continue a server-side stored conversation using xAI's stateful chat. Args:
prompt: User message to append.
model: Grok model id (default Returns: ChatResult containing execution metadata and responses. |
| retrieve_stateful_responseA | Fetch a stored chat completion from xAI by its response ID. Args:
response_id: ID returned by a prior |
| delete_stateful_responseA | Delete a stored chat completion from xAI's servers. Args: response_id: ID of the stored response to remove. |
| chat_with_visionA | Analyze one or more images with a Grok vision model. Args:
prompt: Question or instruction about the image(s).
session: Optional session name for persistent history in chats.
model: Vision-capable Grok model (default |
| chat_with_filesA | Chat with Grok using one or more previously uploaded files as context. Args:
prompt: Question or instruction about the attached files.
file_ids: IDs returned by |
| generate_imageA | Generate new images or edit existing ones with Grok Imagine. Args:
prompt: Image description or edit instruction.
model: Image model ( Returns: MediaResult containing image metadata and URLs. |
| generate_videoA | Generate or edit videos with Grok Imagine. Args:
prompt: Video description, or the edit instruction for video editing.
model: Video model (default |
| extend_videoA | Extend an existing video with a follow-up prompt. Args:
prompt: What should happen in the extended segment.
video_url: Public URL of the source video (.mp4, 2–15 s).
model: Video model (default |
| grok_mcp_statusA | Inspect the current health, versions, CLI auth, and sqlite metrics of the Grok-MCP server. |
| grok_mcp_discover_selfA | Exposes OKF bundle information, WebMCP manifests, and tool schemas for zero-configuration agent onboarding. |
| grok_mcp_restart_containerA | Safely restart the UniGrok Docker container by executing docker compose up --build -d. Only works if running in a context where docker compose is available and enabled. |
| list_chat_sessionsA | List all chat sessions stored under the SQLite session store. |
| get_chat_historyB | Return the most recent messages for a local chat session from SQLite. |
| clear_chat_historyA | Delete the history mapping and cascades messages for a chat session. |
| list_modelsA | List live xAI API model IDs. Lightweight, direct, and fast. |
| list_models_detailedA | List xAI API models, local Grok CLI models, and |
| xai_upload_fileA | Upload a local project file to xAI's servers so it can be reference-attached in chats. Returns:
A dict with |
| xai_list_filesA | List all files uploaded to xAI from this account. |
| xai_get_fileC | Retrieve metadata of a file uploaded to xAI. |
| xai_get_file_contentA | Download the raw content of an uploaded file from xAI. |
| xai_delete_fileB | Delete an uploaded file from xAI. |
| read_local_fileB | Read a local project workspace file for code context or diagnostics. |
| list_project_filesC | List source code and config files present in the current workspace. |
| remote_code_executionB | Solve a task by letting Grok write and run Python in xAI's server-side sandbox. Renamed from |
| run_local_testsC | Run local pytest verification without exposing arbitrary shell execution. |
| web_searchA | Query the web using xAI's real-time web search tool. Args:
prompt: The research question or search instruction.
allowed_domains: Restrict search to these domains (e.g. |
| x_searchA | Query X posts and profiles using xAI's real-time X search tool. Args:
prompt: The search question or instruction.
allowed_x_handles: Restrict search to posts from these X handles.
from_date: Earliest post date, ISO format (e.g. |
| db_vacuumA | Perform database compacting and optimization (VACUUM). |
| git_statusB | Return |
| git_diffB | Return the current git diff, optionally for staged changes or one path. |
| git_logB | Return a short one-line git history. |
| git_showB | Return |
| git_current_branchB | Return the active branch name. |
| git_create_branchB | Create and switch to a new branch. Requires local git write mode. |
| git_apply_patchB | Apply a unified diff patch. Requires local git write mode. |
| git_commitA | Commit explicit paths only. Requires local git write mode. |
| submit_research_jobA | Submit a long-running research task as a deferred xAI job and return
immediately. The job runs in the background with xAI's server-side web
search, X search, and code-execution tools attached; poll
Args: prompt: The research question or task. model: Optional Grok model id. Leave unset to use the planning model. agent_count: Optional multi-agent fan-out — only 4 or 16 are accepted. Returns:
A dict with |
| get_research_jobA | Fetch the status and result of a deferred research job. Statuses: Args:
job_id: ID returned by |
| list_research_jobsA | List the most recent deferred research jobs, newest first. Args: limit: Maximum number of jobs to return (clamped to 1-100, default 20). |
| remember_factA | Save one durable fact to the local workspace knowledge memory. Facts are distilled knowledge — decisions, constraints, preferences, verified findings — injected as hints into future prompts that match them. Saving an identical fact again touches the existing row instead of duplicating it. Args: fact: One self-contained sentence with concrete specifics. scope: 'global' (default, injected everywhere) or a session name for session-scoped knowledge. |
| search_knowledgeA | Search the workspace knowledge memory for facts matching a query. Local results are ranked by FTS5 bm25 when available (term-overlap otherwise). With UNIGROK_COLLECTIONS=1 and a capable SDK, matches from the xAI knowledge collection are merged in (origin='collection'). Args: query: Search terms. limit: Maximum number of local facts to return (1-25, default 5). |
| forget_factA | Permanently delete one fact from the workspace knowledge memory. Args:
fact_id: The id returned by |
| distill_sessionA | Distill a chat session's stored history into durable knowledge facts. Submits a background job (same lifecycle as research jobs — poll
Args: session: Name of a stored chat session. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| research_topic | Deep multi-source research on a topic, with citations. |
| fix_and_test | Fix a bug or failing behavior and prove it with tests. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| models_resource | The UniGrok model catalog: xAI API models, local Grok CLI models, and .grok profiles. |
| status_resource | Server health, storage, and runtime telemetry — the grok_mcp_status payload. |
| sessions_resource | All stored chat sessions (name, model, last_active). |
| knowledge_resource | The workspace knowledge memory: most recent distilled facts. |
| workspace_resource | The shared multi-agent workspace picture: agent ground rules (.agents/AGENTS.md, .gemini/GEMINI.md), current git branch and recent commits, active sessions, and advisor/breaker/runtime state. |
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/djtelicloud/grok-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server