@@ -3,7 +3,7 @@ import { LayerNode } from "@opencode-ai/core/effect/layer-node"
33import { type Tool } from "ai"
44import { ConfigV1 } from "@opencode-ai/core/v1/config/config"
55import { serviceUse } from "@opencode-ai/core/effect/service-use"
6- import { Client } from "@modelcontextprotocol/sdk/client/index.js"
6+ import { Client , type ClientOptions } from "@modelcontextprotocol/sdk/client/index.js"
77import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
88import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js"
99import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"
@@ -35,6 +35,18 @@ import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
3535import { McpCatalog } from "./catalog"
3636
3737const DEFAULT_TIMEOUT = 30_000
38+ const CLIENT_OPTIONS = {
39+ capabilities : {
40+ // https://github.com/anomalyco/opencode/issues/11948
41+ // sampling: {},
42+ // https://github.com/anomalyco/opencode/issues/23066
43+ // elicitation: {},
44+ // https://github.com/anomalyco/opencode/issues/2308
45+ // roots: {},
46+ // https://github.com/anomalyco/opencode/issues/28567
47+ // tasks: {},
48+ } ,
49+ } satisfies ClientOptions
3850
3951export const Resource = Schema . Struct ( {
4052 name : Schema . String ,
@@ -186,7 +198,7 @@ export const layer = Layer.effect(
186198 ( t ) =>
187199 Effect . tryPromise ( {
188200 try : ( ) => {
189- const client = new Client ( { name : "opencode" , version : InstallationVersion } )
201+ const client = new Client ( { name : "opencode" , version : InstallationVersion } , CLIENT_OPTIONS )
190202 return withTimeout ( client . connect ( t ) , timeout ) . then ( ( ) => client )
191203 } ,
192204 catch : ( e ) => ( e instanceof Error ? e : new Error ( String ( e ) ) ) ,
@@ -768,7 +780,7 @@ export const layer = Layer.effect(
768780
769781 return yield * Effect . tryPromise ( {
770782 try : ( ) => {
771- const client = new Client ( { name : "opencode" , version : InstallationVersion } )
783+ const client = new Client ( { name : "opencode" , version : InstallationVersion } , CLIENT_OPTIONS )
772784 return client
773785 . connect ( transport )
774786 . then ( ( ) => ( { authorizationUrl : "" , oauthState, client } ) satisfies AuthResult )
0 commit comments