opencode-mcp
Version:
MCP server for OpenCode coding workflows, durable async jobs, project resources, and explicit user input
17 lines • 692 B
JavaScript
import { toolResult, toolError, directoryParam, readOnly } from "../helpers.js";
export function registerGlobalTools(server, client) {
server.tool("opencode_health", "Check server health and version", {
directory: directoryParam,
}, readOnly, async ({ directory }) => {
try {
const raw = await client.get("/global/health", undefined, directory);
const status = raw.healthy ? "healthy" : "unhealthy";
const version = raw.version ?? "unknown";
return toolResult(`Status: ${status}\nVersion: ${version}`);
}
catch (e) {
return toolError(e);
}
});
}
//# sourceMappingURL=global.js.map