tools section controls how Grip’s built-in tools behave and which external tools (MCP servers) are available.
Web Search Configuration
Grip supports multiple web search backends. Configure which providers are enabled and their API keys.Brave Search
Enable Brave Search API.
Brave Search API key from https://brave.com/search/api/
Maximum search results to return.
DuckDuckGo
Enable DuckDuckGo search (no API key required).
Maximum search results to return.
Perplexity
Enable Perplexity API for search.
Perplexity API key from https://www.perplexity.ai/
Maximum search results to return.
Example Configuration
Shell Execution
Default timeout in seconds for shell commands.Commands that exceed this timeout are automatically terminated.
Shell Safety
Grip implements multiple layers of shell command safety:- Blocked commands:
mkfs,shutdown,reboot,halt,poweroff - Dangerous rm detection: Prevents
rm -rf /,rm -rf ~, etc. - Interpreter -c escape detection: Blocks
python -c,bash -cwith suspicious code - Regex deny-list: Fork bombs, credential access, device writes, remote code execution
Workspace Sandboxing
When true, file tools are sandboxed to the workspace directory.When false, file tools can read/write anywhere the OS user has permissions (subject to trust checks).
Directory trust mode for file access outside workspace.
prompt- Ask before accessing new directories (default)trust_all- Access any directory without promptingworkspace_only- Same asrestrict_to_workspace=true
Trust Modes Explained
prompt (Recommended)
prompt (Recommended)
The agent asks permission before accessing directories outside the workspace for the first time.Trusted directories are saved to
~/.grip/workspace/state/trusted_dirs.json.Best for: Interactive development where you want control over file access.trust_all
trust_all
The agent can access any directory the OS user has permissions for, without prompting.Best for: Automation, CI/CD, trusted environments.
workspace_only
workspace_only
The agent can only access files inside the workspace directory.Best for: Maximum security, untrusted code execution, shared environments.
Some operations (like installing packages or running builds) may fail if they need to access files outside the workspace.
Example Configuration
MCP Servers
Model Context Protocol (MCP) servers extend Grip with external tools. Configure servers viatools.mcp_servers.
Command to execute for stdio-based MCP servers.Example:
npx, python, /usr/local/bin/my-mcp-serverArguments to pass to the command.Example:
["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]Environment variables to set for the server process.Example:
{"API_KEY": "secret"}URL for HTTP/SSE-based MCP servers.Example:
http://localhost:3000/mcpHTTP headers for HTTP-based servers.Example:
{"Authorization": "Bearer token"}Transport type:
http, sse, or empty for stdio (auto-detected).Connection timeout in seconds for this server.
When false, server is skipped without deleting config.
Tool permission patterns with wildcard support.
- Empty list = all tools allowed
- Example:
["mcp__filesystem__*", "mcp__filesystem__read"]
OAuth Configuration
For MCP servers requiring browser-based OAuth login:OAuth 2.0 client ID.
OAuth 2.0 authorization endpoint URL.
OAuth 2.0 token exchange endpoint URL.
OAuth scopes to request.Example:
["read:files", "write:files"]Local port for OAuth callback server.
Example Configurations
Stdio-based Server
HTTP-based Server
Server with OAuth
Tool Permissions
Loading MCP Servers from .mcp.json
Grip automatically loads MCP servers from.mcp.json files in the workspace directory (following Claude Agent SDK convention):
config.json take precedence over .mcp.json.
Tool Search
MCP tool search behavior when tool count is high.
auto- Activate when tools exceed 10% of context windowauto:N- Custom threshold (e.g.,auto:5for 5%)true- Always use tool searchfalse- Disable tool search
Managing MCP Servers via CLI
Best Practices
Web Search
Web Search
- Start with DuckDuckGo (free, no setup)
- Add Brave Search for higher quality results
- Use Perplexity for AI-powered search summaries
- Set
max_resultsbased on context window size
Shell Safety
Shell Safety
- Set appropriate
shell_timeoutfor long-running builds - Use
trust_mode=workspace_onlyfor untrusted environments - Review shell deny patterns regularly
- Monitor shell tool usage in production
MCP Servers
MCP Servers
- Use
allowed_toolsto limit server permissions - Set
enabled=falseinstead of deleting config - Test servers with
grip mcp testbefore deployment - Use OAuth for servers requiring authentication
- Keep server commands in
$PATHor use absolute paths
Workspace Sandboxing
Workspace Sandboxing
- Use
trust_mode=promptfor development - Use
trust_mode=workspace_onlyfor CI/CD - Review
~/.grip/workspace/state/trusted_dirs.jsonregularly - Combine with MCP
allowed_toolsfor defense-in-depth
Troubleshooting
MCP Server Connection Failures
MCP Server Connection Failures
Shell Command Denied
Shell Command Denied
Check if the command matches a deny pattern:
- Blocked commands:
mkfs,shutdown,reboot - Dangerous rm targets:
/,~,/home,/etc - Interpreter escapes:
python -c,bash -c - Fork bombs, credential access, device writes
grip/tools/shell.py.File Access Denied
File Access Denied