MCPcopy Create free account
hub / github.com/codeaashu/claude-code / main

Function main

scripts/test-auth.ts:11–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9})
10
11async function main() {
12 try {
13 const msg = await client.messages.create({
14 model: process.env.ANTHROPIC_MODEL || 'claude-sonnet-4-20250514',
15 max_tokens: 50,
16 messages: [{ role: 'user', content: 'Say "hello" and nothing else.' }],
17 })
18 console.log('✅ API connection successful!')
19 console.log('Response:', msg.content[0].type === 'text' ? msg.content[0].text : msg.content[0])
20 } catch (err: any) {
21 console.error('❌ API connection failed:', err.message)
22 process.exit(1)
23 }
24}
25
26main()

Callers 1

test-auth.tsFile · 0.70

Calls 2

createMethod · 0.65
errorMethod · 0.45

Tested by

no test coverage detected