MCPcopy Create free account
hub / github.com/TanStack/ai / generate

Function generate

packages/ai-mcp/src/cli/bin.ts:8–20  ·  view source on GitHub ↗
(cwd = process.cwd())

Source from the content-addressed store, hash-verified

6import type { EmitInput } from './emit'
7
8async function generate(cwd = process.cwd()): Promise<void> {
9 const config = await loadConfig(cwd)
10 const input: EmitInput = {}
11 for (const [name, server] of Object.entries(config.servers)) {
12 process.stderr.write(`Introspecting MCP server "${name}"…\n`)
13 const surface = await introspectServer(server)
14 input[name] = { prefix: server.prefix, surface }
15 }
16 const out = await emitDescriptors(input)
17 const outPath = resolve(cwd, config.outFile)
18 writeFileSync(outPath, out, 'utf8')
19 process.stderr.write(`Wrote ${outPath}\n`)
20}
21
22const cmd = process.argv[2]
23if (cmd === 'generate') {

Callers 9

viaGenerateFunction · 0.90
viaGenerateFunction · 0.90
bin.tsFile · 0.70
handleSummarizeFunction · 0.50
handleFileUploadFunction · 0.50
handleGenerateFunction · 0.50
handleGenerateFunction · 0.50
handleGenerateFunction · 0.50
handleGenerateFunction · 0.50

Calls 4

loadConfigFunction · 0.90
introspectServerFunction · 0.90
emitDescriptorsFunction · 0.90
writeMethod · 0.80

Tested by

no test coverage detected