Research And Integrations

This page covers the user-facing research flows: the Research lane, context packaging, docs cache, MCP, and Exa.

Detailed pages:

Research Lane

Open it with:

text
/research

Or run a query directly:

text
/research <query>

What Grok Code does:

  • runs a web-backed research query
  • stores the result set in the runtime store
  • opens or focuses the Research lane

What to expect:

  • the saved result includes a query, source list, summary, and timestamp
  • if browser or MCP-backed evidence is unavailable, research can still work, just with a smaller evidence surface

Pinning Research Into Context

Use:

text
/research pin

or:

text
/research pin <result-id>

Pinned research is what feeds best into /context build.

Building A Context Package

Use:

text
/context build

What it does:

  • packages the current session context
  • includes pinned research where available
  • creates a bounded context bundle instead of endlessly growing prompt state

This is useful when you want to keep a long task grounded without dragging every prior turn forward.

Docs Cache

The docs cache is a local snippet store inside Grok Code.

Commands:

  • /docs
  • /docs add
  • /docs get
  • /docs clear

There is also an advanced cleanup command:

  • /docs gc evicts expired entries

Important behavior:

  • cached entries use a 7-day TTL by default
  • long entries can show up as shortened previews, especially right after you add them
  • treat the cache as a convenience for reusable snippets, not as a perfect long-form archive

Use cases:

  • save project-specific snippets you keep reusing
  • keep a short spec, glossary, or command cheat sheet nearby
  • inspect what Grok Code already cached before adding more

MCP Integrations

MCP lets Grok Code connect to additional tools and services.

Local MCP Servers

CLI examples:

bash
grok mcp add demo -- echo hi
grok mcp list
grok mcp remove demo

xAI Remote MCP Servers

CLI examples:

bash
grok mcp remote add docs https://docs.x.ai/api/mcp
grok mcp remote list
grok mcp remote remove docs

In The TUI

Use:

text
/mcp

This is the easiest way to inspect:

  • configured servers
  • current health
  • which tools are available right now

Exa is an optional research enhancement.

Set it up in the TUI with:

text
/enable_exa

What that flow does:

  • asks for your Exa API key
  • writes a global MCP server named exa
  • uses npx -y exa-mcp-server under the hood

Important limit:

  • after setup, restart Grok Code to fully activate Exa tools in the current session

If Exa is already configured, Grok Code tells you instead of prompting again.

When Research Feels Incomplete

Common causes:

  • xAI is not connected yet
  • browser-backed capture is unavailable
  • MCP servers are disconnected
  • Exa is not configured
  • nothing has been pinned into context yet

Start with:

  • /connect
  • /mcp
  • /research
  • /research pin
  • /context build

Was this page helpful? Report issues on GitHub.