summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoropencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>2026-05-03 03:04:40 +0000
committeropencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>2026-05-03 03:04:40 +0000
commita3d282a4c2a4ae9a7fb21d9802f82979458dac4e (patch)
treef488ab0c7767f106c692f346b3fda7d0355b40c7
parentdb24f893137c545768adaf493da1bb541106cc6c (diff)
downloadopencode-a3d282a4c2a4ae9a7fb21d9802f82979458dac4e.tar.gz
opencode-a3d282a4c2a4ae9a7fb21d9802f82979458dac4e.zip
chore: generate
-rw-r--r--packages/opencode/src/cli/cmd/mcp.ts53
1 files changed, 26 insertions, 27 deletions
diff --git a/packages/opencode/src/cli/cmd/mcp.ts b/packages/opencode/src/cli/cmd/mcp.ts
index c220cbbdd..a2a956c3b 100644
--- a/packages/opencode/src/cli/cmd/mcp.ts
+++ b/packages/opencode/src/cli/cmd/mcp.ts
@@ -268,17 +268,16 @@ export const McpAuthCommand = effectCmd({
}
})
- yield* MCP.Service.use((mcp) => mcp.authenticate(serverName))
- .pipe(
- Effect.tap((status) =>
- Effect.sync(() => {
- if (status.status === "connected") {
- spinner.stop("Authentication successful!")
- } else if (status.status === "needs_client_registration") {
- spinner.stop("Authentication failed", 1)
- prompts.log.error(status.error)
- prompts.log.info("Add clientId to your MCP server config:")
- prompts.log.info(`
+ yield* MCP.Service.use((mcp) => mcp.authenticate(serverName)).pipe(
+ Effect.tap((status) =>
+ Effect.sync(() => {
+ if (status.status === "connected") {
+ spinner.stop("Authentication successful!")
+ } else if (status.status === "needs_client_registration") {
+ spinner.stop("Authentication failed", 1)
+ prompts.log.error(status.error)
+ prompts.log.info("Add clientId to your MCP server config:")
+ prompts.log.info(`
"mcp": {
"${serverName}": {
"type": "remote",
@@ -289,23 +288,23 @@ export const McpAuthCommand = effectCmd({
}
}
}`)
- } else if (status.status === "failed") {
- spinner.stop("Authentication failed", 1)
- prompts.log.error(status.error)
- } else {
- spinner.stop("Unexpected status: " + status.status, 1)
- }
- }),
- ),
- Effect.catchCause((cause) =>
- Effect.sync(() => {
+ } else if (status.status === "failed") {
spinner.stop("Authentication failed", 1)
- const error = Cause.squash(cause)
- prompts.log.error(error instanceof Error ? error.message : String(error))
- }),
- ),
- Effect.ensuring(Effect.sync(() => unsubscribe())),
- )
+ prompts.log.error(status.error)
+ } else {
+ spinner.stop("Unexpected status: " + status.status, 1)
+ }
+ }),
+ ),
+ Effect.catchCause((cause) =>
+ Effect.sync(() => {
+ spinner.stop("Authentication failed", 1)
+ const error = Cause.squash(cause)
+ prompts.log.error(error instanceof Error ? error.message : String(error))
+ }),
+ ),
+ Effect.ensuring(Effect.sync(() => unsubscribe())),
+ )
prompts.outro("Done")
}),