OpenCode
Configure Runstack MCP in OpenCode (SST) via opencode.json — local stdio or remote HTTP.
Source: https://runstack.engineer/docs/mcp-opencode
opencode
OpenCode is a terminal-based AI coding agent. Add Runstack as an MCP server in opencode.json to expose the four MCP tools (search_tools, check_authentication, initiate_connection, execute_tool) backed by https://app.runstack.engineer/mcp.
Config file
OpenCode reads JSON/JSONC from:
- Global:
~/.config/opencode/opencode.jsonoropencode.jsonc - Project:
opencode.json/opencode.jsoncat project root
Add $schema for editor hints: "$schema": "https://opencode.ai/config.json".
Get a Runstack key at API Keys (rnsk_…).
Local (stdio) — via @rnsk/mcp
Most reliable when your environment has Node.js available:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"runstack": {
"type": "local",
"command": ["npx", "-y", "@rnsk/mcp"],
"environment": {
"RUNSTACK_API_KEY": "rnsk_YOUR_API_KEY"
},
"enabled": true
}
}
}
You can also write command as ["bun", "x", "@rnsk/mcp"] if using Bun.
Remote (Streamable HTTP)
No local command — connects directly to the hosted endpoint:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"runstack": {
"type": "remote",
"url": "https://app.runstack.engineer/mcp",
"headers": {
"Authorization": "Bearer rnsk_YOUR_API_KEY"
},
// Disable OAuth auto-detection — Runstack uses Bearer keys
"oauth": false,
"enabled": true
}
}
}
Use {env:RUNSTACK_API_KEY} syntax if you prefer env indirection: "Authorization": "Bearer {env:RUNSTACK_API_KEY}". For headers + API keys, set oauth: false to avoid the OAuth discovery flow.
Per-agent scoping (optional)
Disable globally, enable per agent when you have many MCP servers:
{
"mcp": { "runstack": { "type": "local", "command": ["npx", "-y", "@rnsk/mcp"], "environment": { "RUNSTACK_API_KEY": "rnsk_YOUR_API_KEY" } } },
"tools": { "runstack*": false },
"agent": { "my-agent": { "tools": { "runstack*": true } } }
}
Tools are registered as runstack_*; glob runstack* matches them.
Verify
opencode mcp list
# should show runstack enabled/active
In an OpenCode session: “Use the runstack tool to search for GitHub issue tools”. Confirm search_tools returns matches; complete OAuth via initiate_connection link when check_authentication reports token_missing.
For auth debugging: opencode mcp debug runstack.