MCPcopy
hub / github.com/codeaashu/claude-code / mcpServeHandler

Function mcpServeHandler

src/cli/handlers/mcp.tsx:42–71  ·  view source on GitHub ↗
({
  debug,
  verbose
}: {
  debug?: boolean;
  verbose?: boolean;
})

Source from the content-addressed store, hash-verified

40
41// mcp serve (lines 4512–4532)
42export async function mcpServeHandler({
43 debug,
44 verbose
45}: {
46 debug?: boolean;
47 verbose?: boolean;
48}): Promise<void> {
49 const providedCwd = cwd();
50 logEvent('tengu_mcp_start', {});
51 try {
52 await stat(providedCwd);
53 } catch (error) {
54 if (isFsInaccessible(error)) {
55 cliError(`Error: Directory ${providedCwd} does not exist`);
56 }
57 throw error;
58 }
59 try {
60 const {
61 setup
62 } = await import('../../setup.js');
63 await setup(providedCwd, 'default', false, false, undefined, false);
64 const {
65 startMCPServer
66 } = await import('../../entrypoints/mcp.js');
67 await startMCPServer(providedCwd, debug ?? false, verbose ?? false);
68 } catch (error) {
69 cliError(`Error: Failed to start MCP server: ${error}`);
70 }
71}
72
73// mcp remove (lines 4545–4635)
74export async function mcpRemoveHandler(name: string, options: {

Callers 1

runFunction · 0.85

Calls 7

cwdFunction · 0.85
logEventFunction · 0.85
statFunction · 0.85
isFsInaccessibleFunction · 0.85
cliErrorFunction · 0.85
startMCPServerFunction · 0.85
setupFunction · 0.50

Tested by

no test coverage detected