MCPcopy Index your code
hub / github.com/codeaashu/claude-code / main

Function main

mcp-server/src/http.ts:138–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136// ---------------------------------------------------------------------------
137
138async function main(): Promise<void> {
139 await validateSrcRoot();
140
141 const app = express();
142 app.use(express.json());
143 app.use(authMiddleware);
144
145 // Health check
146 app.get("/health", (_req, res) => {
147 res.json({
148 status: "ok",
149 server: "claude-code-explorer",
150 version: "1.1.0",
151 srcRoot: SRC_ROOT,
152 });
153 });
154
155 // Register both transports
156 await startStreamableHTTP(app);
157 await startLegacySSE(app);
158
159 app.listen(PORT, () => {
160 console.log(`Claude Code Explorer MCP (HTTP) listening on port ${PORT}`);
161 console.log(` Streamable HTTP: POST/GET http://localhost:${PORT}/mcp`);
162 console.log(` Legacy SSE: GET http://localhost:${PORT}/sse`);
163 console.log(` Health: GET http://localhost:${PORT}/health`);
164 console.log(` Source root: ${SRC_ROOT}`);
165 if (API_KEY) console.log(" Auth: Bearer token required");
166 });
167}
168
169main().catch((err) => {
170 console.error("Fatal error:", err);

Callers 1

http.tsFile · 0.70

Calls 4

validateSrcRootFunction · 0.85
startStreamableHTTPFunction · 0.85
startLegacySSEFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected