MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / isOAuthServer

Method isOAuthServer

src/mcp/manager.ts:294–302  ·  view source on GitHub ↗

True if a server uses OAuth (explicitly configured or auto-detected from * a 401/needs-auth state). Remote servers in needs-auth state are treated * as OAuth so the detail panel shows "not authenticated".

(name: string)

Source from the content-addressed store, hash-verified

292 * a 401/needs-auth state). Remote servers in needs-auth state are treated
293 * as OAuth so the detail panel shows "not authenticated". */
294 isOAuthServer(name: string): boolean {
295 const cfg = this.configs.get(name)
296 if (!cfg) return false
297 if (isOAuthConfig(cfg)) return true
298 // Auto-detect: a remote server in needs-auth state requires OAuth.
299 const state = this.states.get(name)
300 if (state?.status === "needs-auth" && (cfg.type === "http" || cfg.type === "sse")) return true
301 return false
302 }
303
304 /** True if a server has persisted OAuth tokens (already authenticated). */
305 isAuthenticated(name: string): boolean {

Callers 1

DetailPanelFunction · 0.80

Calls 1

isOAuthConfigFunction · 0.85

Tested by

no test coverage detected