ScavioScavio
ProductPricingDocs
Sign InGet Started
Blog
opencodemcpconfiguration

opencode JSON + MCP Search Defaults

Configure opencode with MCP search for live web access. Set up opencode.json with search defaults for development and research workflows.

May 10, 2026
5 min read

Sensible opencode.json defaults should balance permissive file operations with guarded destructive commands, and include MCP tool configuration for web search to make the agent genuinely useful for research-heavy coding. Here is a production-tested configuration.

Permission Defaults

The permission structure should allow common read and build operations while requiring confirmation for anything destructive.

JSON
{
  "permission": {
    "bash": {
      "*": "allow",
      "rm *": "ask",
      "rm -rf *": "ask",
      "git push*": "ask",
      "git reset --hard*": "ask",
      "*--force*": "ask",
      "docker*rm*": "ask",
      "chmod*": "ask"
    },
    "edit": { "*": "allow" },
    "read": { "*": "allow" }
  }
}

Adding MCP Search Tools

Without web search, opencode works from training data only. It will confidently reference deprecated APIs, invent function signatures, and cite wrong package versions. Adding a search MCP tool fixes this.

JSON
{
  "mcp": {
    "servers": {
      "search": {
        "url": "https://mcp.scavio.dev/mcp",
        "headers": {
          "x-api-key": "your-api-key"
        }
      }
    }
  }
}

This gives opencode access to Google, Reddit, YouTube, Amazon, and Walmart search results. The agent can now verify package versions, check current API docs, and look up error messages before suggesting fixes. Free tier covers 250 searches per month, which handles casual development use.

Model and Context Settings

Set the model explicitly to avoid surprises when defaults change. Context window settings affect how much code the agent can reference at once.

JSON
{
  "model": "claude-sonnet-4-6",
  "context": {
    "max_tokens": 200000
  },
  "auto_compact": true
}

Complete Configuration

Combining permissions, MCP, and model settings into a single opencode.json that works for most development workflows.

JSON
{
  "permission": {
    "bash": {
      "*": "allow",
      "rm *": "ask",
      "git push*": "ask",
      "*--force*": "ask",
      "*--hard*": "ask",
      "docker*rm*": "ask"
    },
    "edit": { "*": "allow" },
    "read": { "*": "allow" }
  },
  "mcp": {
    "servers": {
      "search": {
        "url": "https://mcp.scavio.dev/mcp",
        "headers": { "x-api-key": "your-api-key" }
      }
    }
  },
  "model": "claude-sonnet-4-6",
  "auto_compact": true
}

What This Gets You

With these defaults, opencode can read and edit files freely, run most shell commands without prompting, verify facts against live web data, and pause before destructive operations. The MCP search integration is the single biggest quality improvement for coding agents that need to reference current documentation.

Continue reading

aeod2c

AEO Tracking for D2C Ecommerce Brands in 2026

6 min read
ai-agentscost-optimization

Agent Discovery vs Extraction: Why Cost Split Matters

6 min read
ScavioScavio

Real-time search API for AI agents. Search every platform, not just Google.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

  • Documentation
  • API Reference
  • Quickstart
  • MCP Integration
  • Python SDK

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative

Tools

  • JSON Formatter
  • cURL to Code
  • Token Counter
  • All Tools

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy