OpenCode MCP config location: where to add a server
OpenCode reads MCP servers from its config file, opencode.jsonc, under an mcp section. A local server is a command that OpenCode starts over stdio. The file can sit in your project or in your user config; OpenCode's config docs list every path it checks. Below we add LystBot's list and reminder server.
LystBot is our product, so weigh our opinions accordingly. The entry works for any local MCP server, and only the command changes.
OpenCode MCP config location
OpenCode merges several config files, so it has no single location. A file in your project applies to that project, and a file in your user config directory applies everywhere. For a personal list server we use the user file. The exact directory depends on your system and differs on Windows; the docs on config files and paths list it.
Add the server
- Install LystBot on iPhone or Android and open Settings → AI Agents to copy your API key.
- Log in once from a terminal:
npx lystbot login YOUR_API_KEY
- Open your
opencode.jsoncand add the server. OpenCode's MCP docs currently show server names undermcp.servers:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"lystbot": {
"type": "local",
"command": ["npx", "lystbot", "mcp"]
}
}
}
}
Here command is one array that holds the program and its arguments. OpenCode changed the MCP layout between versions, and older guides put server names directly under mcp. If your version rejects the file, compare it with the docs for your version.
Check that it connects
Servers connect automatically. Start OpenCode and ask: "Show my LystBot lists." The server works when the output shows a visible list_lists tool call with its result. A reply with list names but no tool call proves nothing. LystBot's local server brings 26 tools. To keep an entry without connecting it, use disabled instead of deleting it.
OpenCode CLI or MCP?
LystBot also has a command line client, and OpenCode can run shell commands. Our terminal guide shows that path. MCP is easier for the agent because the tools come with names and descriptions. The CLI fits better when you want fixed commands in scripts.
FAQ
Where is the OpenCode MCP config location?
In opencode.jsonc in your project or in your user config directory. OpenCode merges the files it finds.
Why does my OpenCode MCP config fail to load?
The MCP section layout changed between versions. Check the docs for your version and the command array.
Do I need an API key for LystBot?
Yes, for the local server. Copy it from Settings → AI Agents and run npx lystbot login once.
How we wrote this
We checked the JSON layout and file discussion against OpenCode's MCP and config documentation, and the LystBot command against LystBot's agent guide, on 24 November 2026. We haven't run a live session for this post, so it shows no tool output.
New to MCP? Our Claude MCP explainer covers servers, clients and tools in plain terms. Get the app for iPhone or Android to copy your API key.