opencode-mcp
Version:
MCP server for OpenCode coding workflows, durable async jobs, project resources, and explicit user input
33 lines (32 loc) • 1.24 kB
TypeScript
export interface ServerManagerOptions {
baseUrl: string;
autoServe?: boolean;
/**
* HTTP Basic auth credentials forwarded to the `/global/health` probe.
* Required when the OpenCode server is configured with
* `OPENCODE_SERVER_PASSWORD` — without these, the probe would receive 401
* and `ensureServer` would falsely treat a healthy server as down.
*/
username?: string;
password?: string;
/** Full `Authorization` header value; takes precedence over Basic credentials. */
authorization?: string;
}
export interface ServerStatus {
running: boolean;
version?: string;
managedByUs: boolean;
url?: string;
}
export declare function resetShutdownRegisteredForTests(): void;
export declare function registerShutdownHandlers(): void;
export declare function isServerRunning(baseUrl: string, username?: string, password?: string, authorization?: string): Promise<{
healthy: boolean;
version?: string;
}>;
export declare function startServer(baseUrl: string, timeoutMs?: number): Promise<{
url: string;
version?: string;
}>;
export declare function stopServer(): void;
export declare function ensureServer(opts: ServerManagerOptions): Promise<ServerStatus>;