// config file
opencode.json
Add the server under mcp in your project’s opencode.json, or in ~/.config/opencode/opencode.json for every project.
For OpenCode users
OpenCode reads AGENTS.md for how to work and calls MCP servers for everything else. Maguyva is a remote MCP server that gives OpenCode a queryable map of your repo, with file paths and line numbers.
Free tier: 3 repos, 50K indexed lines, no card.
One remote entry under mcp. Nothing runs locally. Four facts specific to OpenCode.
// config file
Add the server under mcp in your project’s opencode.json, or in ~/.config/opencode/opencode.json for every project.
// transport
OpenCode connects to Maguyva’s endpoint over HTTP. Nothing runs locally and Node.js is not needed.
// key
OpenCode substitutes environment variables in its config, so the header reads Bearer {env:MAGUYVA_API_KEY} and the key stays out of the file you commit.
// context budget
Every MCP server adds tool definitions to the context. OpenCode can switch a server’s tools off globally with a glob like "maguyva*": false and back on for the agents that need them.
> /init
# scans the repo and writes AGENTS.mdOpenCode reads AGENTS.md in the project root and ~/.config/opencode/AGENTS.md for personal rules. Without an AGENTS.md, it falls back to CLAUDE.md. Keep it for:
A scan at /init time is a summary, not an index. It will not tell OpenCode who calls a function added yesterday.
Three gaps OpenCode fills with grep and patience.
AGENTS.md can name the important packages. It cannot list every symbol and call site, and it should not try.
A text match cannot tell a real call from a comment, a mock, or a method with the same name on another class.
AGENTS.md is right the day it is written. The code keeps moving; the file changes when someone remembers to update it.
One entry under mcp gives OpenCode:
AGENTS.md tells OpenCode how to work.
Maguyva gives OpenCode something to work from.
Ask the map from the same terminal.
// workflow 01
opencode> rename OrderStatus to FulfillmentStatus dependency_search("OrderStatus", dependents) 23 references across 8 packages structural_search(switch_statement, "OrderStatus") 4 exhaustive switches → OpenCode edits the full list, switches included. [exit 0]
The exhaustive switches are the ones a text search misses and the compiler catches late.
// workflow 02
opencode> where is FEATURE_BULK_EXPORT read? text_pattern_search("FEATURE_BULK_EXPORT") src/config/flags.ts:17 src/export/bulk.ts:5 docs/flags.md:40 ← docs only → Two code paths, one stale doc. [exit 0]
Exact matches come back with paths, so OpenCode can tell code from documentation before it edits either.
Three steps. Free tier: 3 repos, 50K indexed lines, no card.
// step 01
Pick one you already know, so you can grade the answers.
// step 02
opencode.json
{
"mcp": {
"maguyva": {
"type": "remote",
"url": "https://maguyva.tools/mcp",
"enabled": true,
"headers": {
"Authorization": "Bearer {env:MAGUYVA_API_KEY}"
}
}
}
} // step 03
Set MAGUYVA_API_KEY in the shell that starts OpenCode. opencode mcp list shows each configured server; then ask one question whose answer you already know.