MCPcopy
hub / github.com/codeaashu/claude-code / getServerKey

Function getServerKey

src/services/mcp/auth.ts:325–341  ·  view source on GitHub ↗
(
  serverName: string,
  serverConfig: McpSSEServerConfig | McpHTTPServerConfig,
)

Source from the content-addressed store, hash-verified

323 * with the same name or different configurations
324 */
325export function getServerKey(
326 serverName: string,
327 serverConfig: McpSSEServerConfig | McpHTTPServerConfig,
328): string {
329 const configJson = jsonStringify({
330 type: serverConfig.type,
331 url: serverConfig.url,
332 headers: serverConfig.headers || {},
333 })
334
335 const hash = createHash('sha256')
336 .update(configJson)
337 .digest('hex')
338 .substring(0, 16)
339
340 return `${serverName}|${hash}`
341}
342
343/**
344 * True when we have probed this server before (OAuth discovery state is

Callers 15

revokeServerTokensFunction · 0.85
performMCPXaaAuthFunction · 0.85
performMCPOAuthFlowFunction · 0.85
clientInformationMethod · 0.85
saveClientInformationMethod · 0.85
tokensMethod · 0.85
saveTokensMethod · 0.85
xaaRefreshMethod · 0.85
invalidateCredentialsMethod · 0.85

Calls 2

jsonStringifyFunction · 0.85
updateMethod · 0.65

Tested by

no test coverage detected