mcp-server-opencode 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/index.js +6 -0
- package/build/src/index.js.map +1 -1
- package/build/src/modules/resources/delegate-task-instructions.d.ts +1 -0
- package/build/src/modules/resources/delegate-task-instructions.d.ts.map +1 -1
- package/build/src/modules/resources/delegate-task-instructions.js +1 -1
- package/build/src/modules/resources/delegate-task-instructions.js.map +1 -1
- package/package.json +1 -1
package/build/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { DELEGATE_TASK_INSTRUCTIONS } from "./modules/resources/delegate-task-instructions.js";
|
|
4
5
|
import { registerResources } from "./modules/resources/index.js";
|
|
5
6
|
import { killAllServers } from "./modules/shared/server-registry.js";
|
|
6
7
|
import { registerTools } from "./modules/tools/index.js";
|
|
@@ -8,6 +9,11 @@ import { registerTools } from "./modules/tools/index.js";
|
|
|
8
9
|
const server = new McpServer({
|
|
9
10
|
name: "opencode-mcp",
|
|
10
11
|
version: "1.0.0",
|
|
12
|
+
title: "OpenCode MCP",
|
|
13
|
+
description: "MCP server that drives an OpenCode instance and delegates work asynchronously to its agents",
|
|
14
|
+
websiteUrl: "https://opencode-mcp.alejandrotechnology.com",
|
|
15
|
+
}, {
|
|
16
|
+
instructions: DELEGATE_TASK_INSTRUCTIONS,
|
|
11
17
|
});
|
|
12
18
|
function shutdown(signal) {
|
|
13
19
|
console.error(`Received ${signal}, stopping tracked OpenCode servers...`);
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,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B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAChC,mFAAmF;AACnF,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAEnC,KAAK,UAAU,IAAI;IACjB,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,aAAa,CAAC,MAAM,CAAC,CAAC;IACtB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;AACxD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
export declare const DELEGATE_TASK_INSTRUCTIONS = "You have access to the opencode-mcp server, which lets you delegate work to OpenCode agents. Follow this workflow whenever you delegate tasks:\n\nModel selection guide \u2014 pick the model per task via the optional \"model\" input of opencode_start_task ('providerID/modelID'). Match the model tier to the task's difficulty; do not burn a scarce frontier model on work a cheap model handles well. Usage quotas (requests per 5h) are noted as a scarcity signal \u2014 lower quota means reserve it for harder work.\n\nFrontier tier (scarce \u2014 architecture, hard debugging, critical decisions):\n- Grok 4.5 (~80 req/5h): top-end reasoning and coding; reserve for the hardest problems, cross-cutting refactors, and tasks where a wrong answer is expensive.\n- Kimi K3 (~140 req/5h): frontier reasoning with very strong agentic stability and tool calling over long sessions; best for long-horizon multi-step tasks that must not derail.\n\nHigh tier (strong daily drivers \u2014 feature implementation, non-trivial debugging, review):\n- GLM-5.2 (~880 req/5h): open-weight leader on coding and agentic-coding benchmarks (SWE-bench Pro ~62%); best default for substantial implementation and refactoring work.\n- Qwen3.7 Max (~950 req/5h): near-tie with GLM-5.2 on real-world software engineering; strong multilingual and long-context work.\n- Kimi K2.7 Code (~1,150 req/5h): coding-specialized; ~30% fewer thinking tokens, excellent precise tool invocation (MCP-heavy pipelines) and 4,000+ tool-call sequences; best for long agentic coding runs.\n\nMid tier (high volume \u2014 standard features, tests, medium complexity):\n- MiniMax M3 (~3,200 req/5h): frontier-adjacent coding plus 1M context and native multimodality; best for large-codebase context ingestion or tasks involving images/video.\n- MiMo-V2.5-Pro (~3,250 req/5h): strong general agentic capability and complex software engineering (high SWE-bench Pro rankings); good GLM alternative at higher volume.\n- DeepSeek V4 Pro (~3,450 req/5h): solid all-round flagship; good balance of capability and quota for everyday implementation tasks.\n- Qwen3.7 Plus (~4,300 req/5h): capable mid-range generalist; good for standard features and tests at volume.\n\nFast tier (near-unlimited \u2014 mechanical work, boilerplate, formatting, simple fixes, docs, exploration):\n- MiMo-V2.5 (~30,100 req/5h): lightweight reasoning model; better than Flash on agentic tasks, at some latency/token cost.\n- DeepSeek V4 Flash (~31,650 req/5h): cheapest and fastest, non-reasoning; best for mechanical edits, boilerplate, renames, doc updates, and quick lookups where latency matters.\n\nRule of thumb: exploration/mechanical \u2192 Fast tier; standard implementation \u2192 Mid tier; complex features and long agentic runs \u2192 High tier; architecture or hardest debugging \u2192 Frontier tier.\n\nWorkflow:\n1. Ensure an OpenCode server is running. If you don't already have a server_id from a previous opencode_start_server call, call opencode_start_server first.\n2. Call opencode_list_agents with the server_id to discover the available agents (native and custom) and models. Agents may have a pre-assigned model (\"provider/model\"); you can still override it per task.\n3. For each task, call opencode_start_task with the server_id and the task's prompt. Optionally pass an agent name and/or a model override. Collect the returned task_id for every call.\n4. Wait for completion with opencode_wait_for_task:\n - Single task: mode \"all\" with the single task_id.\n - Multiple tasks, incremental results: call it repeatedly with mode \"any\", removing completed task_ids each time.\n - Multiple tasks, all at once: call it once with mode \"all\" and every task_id.\n5. Once a task is reported finished, call opencode_get_task_result for that task_id to retrieve its output.\n6. Use opencode_get_task_status only for quick, non-blocking checks on a task's progress (e.g. to report status to the user) \u2014 it does not replace opencode_wait_for_task or opencode_get_task_result.\n\nDo not call opencode_get_task_result before the task has finished, and prefer opencode_wait_for_task over polling opencode_get_task_status in a loop.";
|
|
2
3
|
export declare function registerDelegateTaskResource(server: McpServer): void;
|
|
3
4
|
//# sourceMappingURL=delegate-task-instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate-task-instructions.d.ts","sourceRoot":"","sources":["../../../../src/modules/resources/delegate-task-instructions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"delegate-task-instructions.d.ts","sourceRoot":"","sources":["../../../../src/modules/resources/delegate-task-instructions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,eAAO,MAAM,0BAA0B,6lIAoC+G,CAAC;AAEvJ,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,QAoB7D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const DELEGATE_TASK_INSTRUCTIONS = `You have access to the opencode-mcp server, which lets you delegate work to OpenCode agents. Follow this workflow whenever you delegate tasks:
|
|
1
|
+
export const DELEGATE_TASK_INSTRUCTIONS = `You have access to the opencode-mcp server, which lets you delegate work to OpenCode agents. Follow this workflow whenever you delegate tasks:
|
|
2
2
|
|
|
3
3
|
Model selection guide — pick the model per task via the optional "model" input of opencode_start_task ('providerID/modelID'). Match the model tier to the task's difficulty; do not burn a scarce frontier model on work a cheap model handles well. Usage quotas (requests per 5h) are noted as a scarcity signal — lower quota means reserve it for harder work.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate-task-instructions.js","sourceRoot":"","sources":["../../../../src/modules/resources/delegate-task-instructions.ts"],"names":[],"mappings":"AAEA,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"delegate-task-instructions.js","sourceRoot":"","sources":["../../../../src/modules/resources/delegate-task-instructions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sJAoC4G,CAAC;AAEvJ,MAAM,UAAU,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,CAAC,gBAAgB,CACrB,4BAA4B,EAC5B,uCAAuC,EACvC;QACE,KAAK,EAAE,2BAA2B;QAClC,WAAW,EACT,gGAAgG;QAClG,QAAQ,EAAE,YAAY;KACvB,EACD,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,uCAAuC;gBAC5C,IAAI,EAAE,0BAA0B;gBAChC,QAAQ,EAAE,YAAY;aACvB;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-server-opencode",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "MCP server that lets any MCP host (Claude Code, Codex CLI, Cursor, etc.) drive OpenCode and delegate tasks asynchronously to its agents",
|
|
5
5
|
"main": "./build/src/index.js",
|
|
6
6
|
"types": "./build/src/index.d.ts",
|