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

Function writeAuthStore

src/mcp/auth.ts:81–90  ·  view source on GitHub ↗

Write a server's OAuth store (best-effort).

(serverName: string, store: McpAuthStore)

Source from the content-addressed store, hash-verified

79
80/** Write a server's OAuth store (best-effort). */
81function writeAuthStore(serverName: string, store: McpAuthStore): void {
82 try {
83 fs.mkdirSync(authDir(), { recursive: true })
84 fs.writeFileSync(authFilePath(serverName), JSON.stringify(store, null, "\t") + "\n", {
85 mode: 0o600,
86 })
87 } catch {
88 // best-effort; auth will just re-prompt next time
89 }
90}
91
92/** A filesystem-backed OAuthClientProvider for one MCP server. */
93class FileOAuthProvider implements OAuthClientProvider {

Callers 5

saveClientInformationMethod · 0.85
saveTokensMethod · 0.85
saveCodeVerifierMethod · 0.85
saveDiscoveryStateMethod · 0.85
invalidateCredentialsMethod · 0.85

Calls 2

authDirFunction · 0.85
authFilePathFunction · 0.85

Tested by

no test coverage detected