MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / cmdMcp

Function cmdMcp

apps/desktop/src/cli/commands/mcp.ts:11–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9import { runMcpServer } from '../../mcp/server.js'
10
11export async function cmdMcp(): Promise<void> {
12 await runMcpServer()
13 // The MCP SDK's connect() returns once stdin/stdout listeners are
14 // wired up. Node's event loop keeps the process alive while those
15 // listeners exist — but the CLI dispatcher would otherwise see this
16 // promise resolve and call process.exit(0), tearing down stdin
17 // before the client can send any requests. Awaiting indefinitely
18 // here pins the process to whatever lifetime the parent client
19 // (Claude Code / Desktop / Codex) chooses to give it.
20 await new Promise<void>(() => {})
21}

Callers 1

mainFunction · 0.85

Calls 1

runMcpServerFunction · 0.85

Tested by

no test coverage detected