Use Prefsly with OpenCode
Connect OpenCode to one authorized Prefsly profile through remote MCP.
Set it up
- Run the command below in the project where you want Prefsly available. Add --global if you want it available in every project.
OpenCode commands
opencode mcp add prefsly --url https://www.prefsly.io/mcp opencode mcp list opencode mcp auth prefsly - Run opencode mcp list, then authenticate the prefsly server with opencode mcp auth prefsly.
- Add the startup instruction below to ~/.config/opencode/AGENTS.md to apply it across projects.
Startup instruction for ~/.config/opencode/AGENTS.md
At the start of every new session, call the `prefsly` MCP tool `get_profile` and use its returned preferences throughout the session. If the call fails, tell me that prefsly.io preferences could not be loaded.
Good to know
OpenCode enables OAuth for remote servers by default and can use dynamic client registration. For headless or SSH sessions, use a profile-token header configuration with oauth set to false instead.
Create and use a profile token
Update or disconnect
For copied prompts, copy a new prompt after edits. For MCP, your next tool call sees the saved revision. Revoke a connection from Prefsly Connections when you no longer want a client to retrieve the profile.
Official source
Published by Prefsly · Last reviewed September 25, 2026 · All documentation