opencode
Connect opencode to Fluxner's MCP server with OAuth or an API key
Connecting opencode to Fluxner lets it pull analytics into your terminal workflow — verifying an error fix in production, checking a route's traffic before removing it, or wiring up goals and funnels as you ship.
This page covers client setup only. The MCP overview covers the endpoint, API keys and scopes, the full tool list, and troubleshooting.
Connect with OAuth
Add the server to opencode.json at your project root (or your global opencode config):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"fluxner": {
"type": "remote",
"url": "https://fluxner.com/api/mcp",
"enabled": true
}
}
}For a self-hosted installation, replace the host with your configured BASE_URL.
Then authenticate:
opencode mcp auth fluxnerYour browser opens Fluxner's OAuth flow — log in and approve access. The connection acts with your user's role, and the committed config carries no secret. opencode mcp logout fluxner removes the stored credential.
Connect with an API key
To use an API key instead — for non-interactive runs or a narrower, scoped credential — add a headers block that reads the key from the environment, so the config stays committable:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"fluxner": {
"type": "remote",
"url": "https://fluxner.com/api/mcp",
"enabled": true,
"headers": {
"Authorization": "Bearer {env:FLUXNER_API_KEY}"
}
}
}
}Verify
Run opencode mcp list to see the server and its authentication status (opencode mcp debug fluxner gives detailed diagnostics), then try:
List my Fluxner sites and summarize last week's traffic for each.