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:
/researchOr run a query directly:
/research <query>What Grok Code does:
- runs a web-backed research query
- stores the result set in the runtime store
- opens or focuses the
Researchlane
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:
/research pinor:
/research pin <result-id>Pinned research is what feeds best into /context build.
Building A Context Package
Use:
/context buildWhat 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 gcevicts 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:
grok mcp add demo -- echo hi
grok mcp list
grok mcp remove demoxAI Remote MCP Servers
CLI examples:
grok mcp remote add docs https://docs.x.ai/api/mcp
grok mcp remote list
grok mcp remote remove docsIn The TUI
Use:
/mcpThis is the easiest way to inspect:
- configured servers
- current health
- which tools are available right now
Exa Web Search
Exa is an optional research enhancement.
Set it up in the TUI with:
/enable_exaWhat that flow does:
- asks for your Exa API key
- writes a global MCP server named
exa - uses
npx -y exa-mcp-serverunder 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