Skip to content
VS Code

ask grok for VS Code

io.github.lykhoyda/ask-grok

Consult Grok through xAI's metered API with exact model selection and no fallback

client:VS Code transport:stdio runtime:npm

Install ask grok in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "xai-api-key",
      "description": "XAI_API_KEY",
      "password": true
    },
    {
      "type": "promptString",
      "id": "ask-grok-harness",
      "description": "ASK_GROK_HARNESS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "ask-grok-model",
      "description": "ASK_GROK_MODEL",
      "password": true
    },
    {
      "type": "promptString",
      "id": "ask-grok-reasoning-effort",
      "description": "ASK_GROK_REASONING_EFFORT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "ask-grok-max-output-tokens",
      "description": "ASK_GROK_MAX_OUTPUT_TOKENS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "ask-grok-timeout-ms",
      "description": "ASK_GROK_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "gmcpt-log-level",
      "description": "GMCPT_LOG_LEVEL",
      "password": true
    }
  ],
  "servers": {
    "ask-grok": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@ask-llm/grok-mcp"
      ],
      "env": {
        "XAI_API_KEY": "${input:xai-api-key}",
        "ASK_GROK_HARNESS": "${input:ask-grok-harness}",
        "ASK_GROK_MODEL": "${input:ask-grok-model}",
        "ASK_GROK_REASONING_EFFORT": "${input:ask-grok-reasoning-effort}",
        "ASK_GROK_MAX_OUTPUT_TOKENS": "${input:ask-grok-max-output-tokens}",
        "ASK_GROK_TIMEOUT_MS": "${input:ask-grok-timeout-ms}",
        "GMCPT_LOG_LEVEL": "${input:gmcpt-log-level}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

ask grok in other clients