feat(mcp): add 'codeburn mcp' stdio command with stdout guard

This commit is contained in:
iamtoruk 2026-06-02 02:18:00 -07:00
parent 1e54967d97
commit 94e6b77672

View file

@ -958,4 +958,14 @@ program
await runAgyStatusLineHook()
})
program
.command('mcp')
.description('Run a Model Context Protocol server (stdio) exposing usage + savings to AI agents')
.action(async () => {
// stdout MUST carry only JSON-RPC; route stray logs to stderr.
console.log = ((...args: unknown[]) => process.stderr.write(args.join(' ') + '\n')) as typeof console.log
const { startStdioServer } = await import('./mcp/server.js')
await startStdioServer(version)
})
program.parse()