Before you type anything, check which version of OpenCode you have. Its documentation now describes two shapes of configuration, and a line that works in one can be silently ignored in the other. The command in this guide avoids the problem, but the file-based route does not.
Check your version first
The current docs, called V2, place servers under mcp and then servers, and they say server names do not go directly under mcp. The older V1 docs put the name straight under mcp. Use whichever matches the version you installed. If you are unsure, the command route below sidesteps the question, because OpenCode writes the entry itself.
Add the server
Run opencode mcp add, give it the name spendixai and pass the server address with the url flag. In place of the address, type <your SpendixAI server address>, copied from Developer → MCP connections. The entry is saved for the current project, and adding the global flag makes it available everywhere. Run opencode mcp list afterwards to confirm it is there.
SpendixAI is a tracker we make for people managing money in India, and it stores statements and cash entries in one workspace. The command above is all OpenCode needs to reach it.
Sign in
- Open OpenCode and run /mcps.
- Select spendixai and choose to sign in. Alternatively run opencode mcp auth spendixai in a shell.
- Complete the browser sign-in on SpendixAI's consent screen.
- If your browser is on another machine, paste the failed callback address back into the prompt.
- Choose your workspace and a preset, starting with Read only.
To remove saved credentials later, run opencode mcp logout spendixai. You can also revoke the connection under Developer → MCP connections.
How OpenCode registers itself
OpenCode switches OAuth on for remote servers unless you turn it off. It finds the authorization server, signs in with PKCE and refreshes tokens. For client registration it tries a pre-registered client ID first, then client ID metadata documents, then dynamic client registration. SpendixAI needs no pre-registration, so you never fill in a client ID by hand.
Reading the tool names
OpenCode names each tool with the server first, so SpendixAI's tools start with spendixai and an underscore. Any character that is not a letter or number becomes an underscore. Permission rules can use a pattern ending in a star to deny every tool from the server. We could not confirm whether OpenCode asks before each MCP call by default, so review your permission rules yourself before you ask anything about money.
In V2, Code Mode is on by default. It groups tools under the server name, and setting codemode to false exposes them directly.
Summary of steps and caveats
| Stage | Detail |
|---|---|
| Add | opencode mcp add with the name and the url flag |
| Verify | opencode mcp list |
| Sign in | /mcps in the app, or opencode mcp auth |
| Disconnect | opencode mcp logout, plus the SpendixAI connections page |
| Config shape | Differs between V1 and V2, so check your version |
| Default prompts | Not confirmed in the documentation we read |
What the permission presets cover
SpendixAI's consent screen lists three levels. The first, Read only, lets OpenCode view transactions and reports. The second adds creating transactions and uploading documents. The third adds categorisation rules and insights. Billing and member settings are not offered to any assistant. We would stay on the first level until you have seen several answers and found them correct.
Whatever you pick, OpenCode can never do more than your own role in the workspace allows. SpendixAI re-checks that on each call, so changing a member's role takes effect immediately.
This guide was checked against OpenCode's documentation in November 2026. Commands change between releases, so if one fails, follow the current guide for your version. Begin with a question that only reads, such as the recurring charges you pay and what each costs per year, and compare totals with SpendixAI's own reports.
Useful ideas start with a clearer picture of your own spending.
Explore your reports


