opencode/packages/plugin/src/effect/mcp.ts

17 lines
700 B
TypeScript

import type { McpApi } from "@opencode/client/effect/api"
import type { Mcp } from "@opencode/schema/mcp"
import type { Effect, Types } from "effect"
import type { Transform } from "./registration.js"
export interface MCPEditor {
list(): readonly [string, Types.DeepMutable<Mcp.ServerConfig>][]
get(name: string): Types.DeepMutable<Mcp.ServerConfig> | undefined
set(name: string, config: Mcp.ServerConfig): void
update(name: string, update: (config: Types.DeepMutable<Mcp.ServerConfig>) => void): void
remove(name: string): void
}
export interface MCPDomain extends Pick<McpApi<unknown>, "list"> {
readonly transform: Transform<MCPEditor>
readonly reload: () => Effect.Effect<void>
}