Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions packages/opencode/src/cli/cmd/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const McpListCommand = cmd({

for (const [name, serverConfig] of Object.entries(mcpServers)) {
const status = statuses[name]
const hasOAuth = serverConfig.type === "remote" && !!serverConfig.oauth
const hasOAuth = await MCP.supportsOAuth(name)
const hasStoredTokens = await MCP.hasStoredTokens(name)

let statusIcon: string
Expand Down Expand Up @@ -109,7 +109,12 @@ export const McpAuthCommand = cmd({
const mcpServers = config.mcp ?? {}

// Get OAuth-enabled servers
const oauthServers = Object.entries(mcpServers).filter(([_, cfg]) => cfg.type === "remote" && !!cfg.oauth)
const oauthServers: Array<[string, Config.Mcp]> = []
for (const [name, cfg] of Object.entries(mcpServers)) {
if (await MCP.supportsOAuth(name)) {
oauthServers.push([name, cfg])
}
}

if (oauthServers.length === 0) {
prompts.log.warn("No OAuth-enabled MCP servers configured")
Expand Down Expand Up @@ -149,7 +154,7 @@ export const McpAuthCommand = cmd({
return
}

if (serverConfig.type !== "remote" || !serverConfig.oauth) {
if (!(await MCP.supportsOAuth(serverName))) {
prompts.log.error(`MCP server ${serverName} does not have OAuth configured`)
prompts.outro("Done")
return
Expand Down
Loading