Define MCP servers in project settings

mcp tools

// what it does

Instead of the add command, you can declare servers directly in .grok/settings.json under mcpServers — an object keyed by server name, each with transport, command, args, and env. Committing this file shares the whole MCP setup with your team automatically.

// shell

$ .grok/settings.json

// gotcha

mcpServers here is an object keyed by name, not an array, and each entry's "transport" is the string stdio, http, or sse. Do not commit secrets — reference them through env vars rather than hard-coding keys in the checked-in file.

// resources