Skip to main content
Glama
BasisSetVentures

Grok CLI MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GROK_API_KEYYesYour Grok API key from X.AI console (required by the server)
GROK_CLI_PATHNoPath to Grok CLI binary (optional, defaults to /opt/homebrew/bin/grok)/opt/homebrew/bin/grok

Tools

Functions exposed to the LLM to take actions

NameDescription
grok_query

Send a single prompt to Grok via CLI headless mode. Returns the assistant's text. Use raw_output=true to get raw CLI output and parsed messages.

grok_chat

Send a list of role/content messages to Grok by flattening into a single prompt. Useful for multi-turn context when the CLI only supports a single '-p' prompt.

grok_code

Ask Grok for code or code-related guidance. You can provide a language hint and context (e.g., file snippets or requirements). Returns assistant text by default.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

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/BasisSetVentures/grok-cli-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server