Updated
1. Get a token
A workspace owner issues a credential at /mcp. Start with read-only scopes: article:read, brand:read, campaign:read. Export it in your shell profile:
export UPRANK_MCP_TOKEN="<your token>"
2. Register the server
~/.config/opencode/opencode.json
Endpoint https://uprank.devino.ca/api/mcp, streamable HTTP with a bearer header read from UPRANK_MCP_TOKEN.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"uprank": {
"type": "remote",
"url": "https://uprank.devino.ca/api/mcp",
"oauth": false,
"headers": {
"Authorization": "Bearer {env:UPRANK_MCP_TOKEN}"
},
"enabled": true
}
}
}Check that OpenCode loaded the server
Run opencode mcp list: it lists every configured MCP server and its auth status, so uprank should appear there.
opencode mcp list
3. Verify
article_list with { "pageSize": 1 }. A JSON result with items and nextCursor means the connection and scopes are good. A 401 means the token is missing, revoked, expired, or a dev: credential used against production.4. Next steps
Ask OpenCode in plain language; it picks the tool. These work with the read-only token.
List my five most recent uprank articles with their status.
article_list
Summarize my site's uprank brand profile: voice, audience and proof points.
brand_get
Which of my uprank articles have an expired claim or no current quality score?
refresh_list
Ready for drafts? Issue a second token that adds research:run, article:write, quality:run and ask for the create_quality_article prompt with a site id and either a campaign id and a topic to research or an existing topic opportunity id. It researches, drafts and scores an article against the quality gates and stops before publishing.
Troubleshooting OpenCode
- Why is oauth set to false in the OpenCode config?
- OpenCode starts an OAuth flow when a remote server answers 401. This setup uses a bearer token, so oauth: false turns that auto-detection off and the Authorization header carries the token. (uprank also supports OAuth — that is how Add to Claude connects — but a token in UPRANK_MCP_TOKEN keeps the agent setup non-interactive.)
- Why does uprank return 401 from OpenCode?
- {env:UPRANK_MCP_TOKEN} is replaced with an empty string when the variable is not set, so uprank receives no token. Set UPRANK_MCP_TOKEN in the environment OpenCode starts from. opencode mcp debug uprank shows the auth status and tests HTTP connectivity.
- Why does uprank behave differently inside one OpenCode project?
- OpenCode merges its config files, and a project opencode.json overrides conflicting keys from ~/.config/opencode/opencode.json. Check the project file for an mcp.uprank entry, for example one with enabled set to false.
No workspace yet?
Tokens belong to a workspace. Create one, then come back to step 1.