一键导入
mcp-server-management
// Use when configuring or troubleshooting MCP servers for OpenCode/Kilo environments
// Use when configuring or troubleshooting MCP servers for OpenCode/Kilo environments
Three-layer bootstrap flow, dotbot patterns, and deployment order for Win dotfiles. Use when editing bootstrap.ps1, install.conf.yaml, or Setup-Dotfiles.ps1.
Use when working on PowerShell scripts, registry tweaks, or dotfile deployment in the Win repo. Covers conventions, Common.ps1 helpers, and path rules.
Use when validating changes in the Win repo. Per-change-type checks for PowerShell, dotbot, autounattend.xml, and guidance files.
Use to run the mandatory end-of-session workflow — file issues, run quality gates, push to remote, verify clean state, hand off context.
Use when orchestrating complex tasks across specialized agents with proper context handoff
Use when migrating AI assistant configurations from Claude Code, Cursor, and other tools to OpenCode/Kilo
| name | mcp-server-management |
| description | Use when configuring or troubleshooting MCP servers for OpenCode/Kilo environments |
| compatibility | opencode |
Use this skill when adding, configuring, debugging, or optimizing MCP servers in OpenCode or Kilo. Covers local and remote servers, authentication, context budgeting, and per-agent scoping.
MCP servers are defined in opencode.json (project or global ~/.config/opencode/opencode.json) under the mcp key.
Use type: local for servers that run as a local process.
{
"mcp": {
"my-local-mcp": {
"type": "local",
"command": ["bun", "x", "my-mcp-command"],
"enabled": true
}
}
}
command must be an array of strings (executable + args)bun, node, python, etc.) is installed and in PATHUse type: remote for servers hosted over HTTP/S.
{
"mcp": {
"my-remote-mcp": {
"type": "remote",
"url": "https://api.example.com/mcp",
"headers": {
"X-Custom-Header": "value"
},
"enabled": true
}
}
}
url must be the MCP server endpointheaders are optional and passed with every requestOpenCode automatically handles OAuth for remote MCP servers that require it. When the server signals an auth challenge, OpenCode opens a browser flow and stores tokens securely.
To disable automatic OAuth (e.g., when using API keys instead):
{
"mcp": {
"jira": {
"type": "remote",
"url": "https://jira.example.com/mcp",
"oauth": false,
"enabled": true
}
}
}
For servers that accept API keys, pass them through environment variables rather than hardcoding in config:
{
"mcp": {
"exa": {
"type": "remote",
"url": "https://mcp.exa.ai/sse",
"oauth": false,
"enabled": true
}
}
}
# In shell profile or CI env
export EXA_API_KEY="your-key"
In PowerShell (Windows):
$env:EXA_API_KEY = "your-key"
For local MCP servers that read env vars, set them before starting OpenCode/Kilo or prefix the command:
{
"mcp": {
"context7": {
"type": "local",
"command": ["env", "CONTEXT7_API_KEY=xxx", "node", "./mcp-server.js"],
"enabled": true
}
}
}
Each enabled MCP server consumes context budget. Disable servers that are not needed for the current task.
{
"mcp": {
"jira": {
"enabled": false
}
}
}
Disable groups of servers by glob:
{
"tools": {
"jira*": false,
"github*": false
}
}
If you have many MCP servers, disable them globally and enable only for specific agents:
{
"mcp": {
"exa": {
"type": "remote",
"url": "https://mcp.exa.ai/sse",
"enabled": true
}
},
"tools": {
"exa*": false
},
"agent": {
"researcher": {
"tools": {
"exa*": true
}
}
}
}
This keeps the default agent lean while giving the researcher agent full search capability.
opencode.json with jsonlint or an IDEcurl -fsSL <url>/health or ping the endpointcommand[0] exists in PATH (Get-Command in PowerShell, which in bash)oauth: false if using API keystools permission for the MCP namespace (e.g., exa*)| Symptom | Cause | Fix |
|---|---|---|
Connection refused | Local server not running | Start the server or check command path |
401 Unauthorized | Missing API key or OAuth disabled | Set env var or enable oauth: true |
MCP tool not found | Tool disabled globally and not enabled per-agent | Add "mcp-name*": true to agent tools |
Timeout | Server slow or network issue | Increase timeout in MCP config or check URL |
Restart the OpenCode/Kilo session. MCP servers initialize once per session; there is no hot-reload.
opencode.json$env: or shell env vars for secretspermission block of opencode.jsonopencode-migration — migrating MCP configs from other toolsagent-delegation — scoping MCP access per agent