opencode
Publish, list and seal pagelets from opencode.
opencode's remote MCP servers take a URL plus headers — full Pagelet tool access in the TUI.
Configure
Register a token first (one curl call) and export it asPAGELET_TOKEN. Then add the server under mcp in your opencode config — projectopencode.json, or global ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"pagelet": {
"type": "remote",
"url": "https://pagelet.link/mcp",
"oauth": false,
"headers": {
"Authorization": "Bearer {env:PAGELET_TOKEN}"
}
}
}
}"oauth": false matters: opencode auto-detects OAuth on 401s, and Pagelet uses a bearer token, not OAuth. The {env:…} syntax pulls the token from your environment so it never sits in the file.
Verify it works
opencode mcp list—pageletshows with its auth status.- In a session, ask "use the pagelet tools — what's available?" Tools appear alongside built-ins.
- Something off?
opencode mcp debug pagelettests connectivity end to end.
First pagelet
Ask: "Make a pagelet comparing these two approaches and publish it." opencode callspublish_pagelet and returns a https://<slug>.usepagelet.com URL — open it to confirm.
Troubleshooting
- "Auth required" tool errors —
PAGELET_TOKENisn't exported in the shell that launched opencode. Export it, restart. - OAuth prompt appears — you dropped
"oauth": false; add it so opencode stops trying the OAuth flow. - Empty tool list — check the URL is exactly
https://pagelet.link/mcp, then /api/capabilities forservice.mcp. - Want it for one agent only — disable globally (
"tools": { "pagelet*": false }) and re-enable per agent in theagentconfig.
Source: opencode MCP servers docs (remote shape, headers and oauth: false verified there).