MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / getClient

Function getClient

server/src/utils/llm.ts:19–28  ·  view source on GitHub ↗

* Get or create the shared Anthropic client

()

Source from the content-addressed store, hash-verified

17 * Get or create the shared Anthropic client
18 */
19function getClient(): Anthropic {
20 if (!client) {
21 const apiKey = process.env.ADDIE_ANTHROPIC_API_KEY || process.env.ANTHROPIC_API_KEY;
22 if (!apiKey) {
23 throw new Error('ANTHROPIC_API_KEY or ADDIE_ANTHROPIC_API_KEY not configured');
24 }
25 client = new Anthropic({ apiKey });
26 }
27 return client;
28}
29
30/**
31 * Check if the API key is configured

Callers 2

completeFunction · 0.70
createCatalogApiRouterFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected