From 732bb9c3cb56436989e941d4791ae8178c8af00d Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Wed, 5 Aug 2026 17:20:13 -0400 Subject: [PATCH] refactor(core): remove discarded MCP connection details (#40726) --- packages/core/src/mcp/index.ts | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/packages/core/src/mcp/index.ts b/packages/core/src/mcp/index.ts index a325311ade8..ef8aa09941f 100644 --- a/packages/core/src/mcp/index.ts +++ b/packages/core/src/mcp/index.ts @@ -12,7 +12,6 @@ import { Credential } from "../credential" import { Bus } from "../bus" import { Form } from "../form" import { Integration } from "../integration" -import { IntegrationConnection } from "../integration/connection" import { KeyedMutex } from "../effect/keyed-mutex" import { Location } from "../location" import { waitForAbort } from "@opencode-ai/util/process" @@ -31,7 +30,6 @@ export class ServerInfo extends Schema.Class("MCP.ServerInfo")({ name: ServerName, status: Status, integrationID: Integration.ID.pipe(Schema.optional), - connection: IntegrationConnection.Info.pipe(Schema.optional), }) {} export class ServerInstructions extends Schema.Class("MCP.ServerInstructions")({ @@ -247,14 +245,6 @@ export const layer = (options?: Options) => Layer.effect( return { name, entry } }) - const info = (name: ServerName, entry: ServerEntry, connection: IntegrationConnection.Info | undefined) => - new ServerInfo({ - name, - status: entry.status, - integrationID: entry.integrationID, - connection, - }) - // Builds the connect-time auth provider for a remote OAuth-integration server. The SDK presents and // refreshes stored tokens, persisting refreshes back to the same credential row. The provider never // opens a browser, so an auth-gated connect ends in UnauthorizedError -> needs_auth rather than a redirect. @@ -603,15 +593,12 @@ export const layer = (options?: Options) => Layer.effect( ) return Service.of({ servers: Effect.fn("MCP.servers")(function* () { - const entries = Array.from(runtime).toSorted(([a], [b]) => a.localeCompare(b)) - return yield* Effect.forEach(entries, ([name, entry]) => - Effect.gen(function* () { - const connection = entry.integrationID - ? yield* integration.connection.active(entry.integrationID) - : undefined - return info(name, entry, connection) - }), - ) + return Array.from(runtime) + .toSorted(([a], [b]) => a.localeCompare(b)) + .map( + ([name, entry]) => + new ServerInfo({ name, status: entry.status, integrationID: entry.integrationID }), + ) }), add: Effect.fn("MCP.add")(function* (server, config) { const name = ServerName.make(server)