GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore(mcp): declare client capabilities (#32222) · ildella/opencode@11fd6f8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/opencode/src/mcp
    • index.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/opencode/src/mcp/index.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/mcp/index.ts
+15-3Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { LayerNode } from "@opencode-ai/core/effect/layer-node"
33
import { type Tool } from "ai"
44
import { ConfigV1 } from "@opencode-ai/core/v1/config/config"
55
import { 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"
77
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
88
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js"
99
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"
@@ -35,6 +35,18 @@ import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
3535
import { McpCatalog } from "./catalog"
3636

3737
const 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

3951
export 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

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.