opencode-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENCODE_MCP_MODE | No | managed 또는 attach | URL 설정 시 attach, 아니면 managed |
| CLAUDE_PROJECT_DIR | No | 기본 cwd fallback, 지정 시 절대 경로 | |
| OPENCODE_MCP_AIRGAP | No | managed 자식에 air-gap 기본값 적용 | true |
| OPENCODE_MCP_ON_EXIT | No | abort 또는 end | abort |
| OPENCODE_MCP_LOG_LEVEL | No | debug, info, warn, error | info |
| OPENCODE_MCP_END_ACTION | No | delete 또는 archive | delete |
| OPENCODE_MCP_SERVER_URL | No | attach 필수; 유효 http(s), userinfo 금지, 비-loopback은 HTTPS 기본 | |
| OPENCODE_MCP_SERVE_ARGS | No | 공백 구분 인자; --hostname, --port, --mdns*, --cors 금지 | |
| OPENCODE_MCP_DEFAULT_CWD | No | 절대 경로 | CLAUDE_PROJECT_DIR, 아니면 프로세스 cwd |
| OPENCODE_SERVER_PASSWORD | No | attach 암호; managed 자식에는 임의 암호 생성 | |
| OPENCODE_SERVER_USERNAME | No | OpenCode server 사용자명 | opencode |
| OPENCODE_MCP_MAX_SESSIONS | No | 동시 추적 세션(활성+quarantined) 상한, 양의 정수 ≤ 10000 | 256 |
| OPENCODE_MCP_OPENCODE_BIN | No | 실행 파일 경로/이름 | opencode |
| OPENCODE_MCP_REMOTE_PATHS | No | 원격 경로의 local realpath 검사 생략 | false |
| OPENCODE_MCP_ALLOWED_ROOTS | No | path.delimiter 구분 허용 루트; 각 항목은 trim되며 절대 경로여야 함; 명시적으로 설정했는데 유효 항목이 0개면 시작 실패 | 기본 cwd |
| OPENCODE_MCP_DEFAULT_AGENT | No | 기본 agent | |
| OPENCODE_MCP_DEFAULT_MODEL | No | 기본 provider/model; 설정 시 반드시 provider/model 형식이어야 함(아니면 시작 실패) | |
| OPENCODE_MCP_DEFAULT_SANDBOX | No | read-only, workspace-write, danger-full-access | workspace-write |
| OPENCODE_MCP_MAX_OUTPUT_CHARS | No | 양의 정수 content 제한 | 20000 |
| OPENCODE_MCP_HEARTBEAT_SECONDS | No | 진행 heartbeat 간격 초; 최대 600(Claude Code의 30분 idle 중단을 이 heartbeat로 막으므로 더 큰 값은 거부됩니다) | 15 |
| OPENCODE_MCP_SSE_STALL_SECONDS | No | SSE 무응답 제한 초 | 35 |
| OPENCODE_MCP_ALLOW_INSECURE_HTTP | No | loopback 외 HTTP 허용 | false |
| OPENCODE_MCP_CHILD_ENV_ALLOWLIST | No | 쉼표 구분 이름/`PREFIX_*`; 비면 환경 상속 후 scrub | |
| OPENCODE_MCP_READ_RETRY_ATTEMPTS | No | admission GET 시도 횟수(최초 포함), 1–3 정수 | 3 |
| OPENCODE_MCP_RESPONSE_LOOP_LIMIT | No | 10초 안의 연속 응답 루프 임계값, 3–20 정수; 0은 비활성화 | 6 |
| OPENCODE_MCP_STATUS_POLL_SECONDS | No | 상태 polling 간격 초 | 30 |
| OPENCODE_MCP_TURN_TIMEOUT_SECONDS | No | 기본 turn 제한 초 | 3600 |
| OPENCODE_MCP_CLEANUP_TIMEOUT_SECONDS | No | 취소/정리 제한 초 | 15 |
| OPENCODE_MCP_DEFAULT_APPROVAL_POLICY | No | never, on-request | never |
| OPENCODE_MCP_REQUEST_TIMEOUT_SECONDS | No | HTTP 요청 제한 초. Node fetch/undici의 headers/body timeout으로 실제 HTTP 대기는 최대 300초 | 30 |
| OPENCODE_MCP_STARTUP_TIMEOUT_SECONDS | No | 시작 제한 초. Node fetch/undici의 headers/body timeout으로 실제 HTTP 대기는 최대 300초 | 60 |
| OPENCODE_MCP_APPROVAL_TIMEOUT_SECONDS | No | 승인 대기 제한 초 | 600 |
| OPENCODE_MCP_MAX_TURN_TIMEOUT_SECONDS | No | 최대 turn 제한 초; 기본값 이상 | 21600 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| opencodeA | Use this to delegate a new coding task to OpenCode and run its first turn. Blocks until the turn finishes (or wait-seconds elapses, up to the turn timeout). The final answer and status are in structuredContent.content / structuredContent.status; the text response mirrors the same content. Returns a session id (also usable as threadId/conversationId) to continue with opencode-reply. |
| opencode-replyA | Use this to continue an existing OpenCode session started with opencode, after reading its previous result from structuredContent.content. Requires exactly one of sessionId, threadId or conversationId, plus a new prompt. Blocks until the turn finishes (or wait-seconds elapses, up to the turn timeout); the answer is in structuredContent.content. |
| opencode-statusA | Use this to check on or wait for a running OpenCode turn, or — with no id — to list the sessions tracked by this server. With an id it can block up to wait-seconds (max 600) and will also relay any pending approval prompts to you, so it is not purely read-only: it can act on the session while waiting. Without an id it returns the tracked session list in structuredContent.sessions and structuredContent.content. Pass |
| opencode-cancelA | Use this to stop the turn currently running on an OpenCode session without ending the session, so a new opencode-reply can be sent afterwards. Requires exactly one of sessionId, threadId or conversationId. Idempotent when the session is already idle; the result is in structuredContent.content. |
| opencode-outputA | Page through a turn's full retained answer, tool-call log, structured output, or the OpenCode-reported file diff for that turn. Use |
| opencode-infoA | Discover this server's configuration and OpenCode's current catalogs without starting a session. |
| opencode-endA | Use this to finish working with an OpenCode session: it stops any running turn, rejects any leftover permission prompts, then deletes or archives the session and forgets it (action, default 'delete' — this server's configured OPENCODE_MCP_END_ACTION). Requires exactly one of sessionId, threadId or conversationId. Idempotent: ending an unknown or already-ended session returns structuredContent.status "not_found" without contacting OpenCode. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 7 tools
Each tool maps to a distinct stage of the session lifecycle (start, reply, status, cancel, output, info, end), so most are easy to tell apart. The only friction points are opencode-cancel vs opencode-end (both stop a running turn, though only end deletes the session) and opencode-status vs opencode-output (both surface turn content, though output pages the full retained text).
All tools share a clear `opencode-` prefix in consistent kebab-case, which reads cleanly as a family. The only deviation is the bare `opencode` create tool and the fact that suffixes mix nouns (status, output, info) with verbs (reply, cancel, end), but the pattern is still predictable.
Seven tools is well-scoped for a coding-agent delegation server, with each tool earning its place across session creation, continuation, monitoring, cancellation, output retrieval, discovery, and teardown. Nothing seems redundant or filler.
The surface covers a full session lifecycle: create, reply, status/list, cancel, output paging, config/catalog discovery, and end/cleanup. Coverage is strong; only minor conveniences (e.g. a dedicated session-list beyond the status-without-id path) are absent, which agents can work around.