MCPcopy Create free account
hub / github.com/anomalyco/opencode / createClient

Function createClient

packages/opencode/src/mcp/index.ts:76–82  ·  view source on GitHub ↗
(directory: string)

Source from the content-addressed store, hash-verified

74type MCPClient = Client
75
76function createClient(directory: string) {
77 const client = new Client({ name: "opencode", version: InstallationVersion }, CLIENT_OPTIONS)
78 client.setRequestHandler(ListRootsRequestSchema, () =>
79 Promise.resolve({ roots: [{ uri: pathToFileURL(directory).href }] }),
80 )
81 return client
82}
83
84const StatusConnected = Schema.Struct({ status: Schema.Literal("connected") }).annotate({
85 identifier: "MCPStatusConnected",

Callers 1

index.tsFile · 0.70

Calls 1

setRequestHandlerMethod · 0.45

Tested by

no test coverage detected