Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { createServer } from "node:http";
|
||||
|
||||
import { loadMcpRuntimeConfig } from "./config.js";
|
||||
import { writeJson } from "./http.js";
|
||||
import { mcpLogger } from "./logger.js";
|
||||
import { handleMcpRequest } from "./transport.js";
|
||||
|
||||
const config = loadMcpRuntimeConfig();
|
||||
|
||||
const server = createServer(async (req, res) => {
|
||||
try {
|
||||
const pathname = new URL(req.url ?? "/", "http://localhost").pathname;
|
||||
if (req.method === "GET" && pathname === "/healthz") {
|
||||
writeJson(res, 200, { status: "ok", service: "mcp", revision: config.revision });
|
||||
return;
|
||||
}
|
||||
if (req.method === "GET" && pathname === "/readyz") {
|
||||
writeJson(res, 200, { status: "ready", service: "mcp", revision: config.revision });
|
||||
return;
|
||||
}
|
||||
await handleMcpRequest(req, res, config);
|
||||
} catch (error) {
|
||||
mcpLogger.error({ err: error }, "MCP request failed");
|
||||
writeJson(res, 500, { error: { code: "internal_error", message: "HiveGrid MCP request failed." } });
|
||||
}
|
||||
});
|
||||
|
||||
server.listen(config.listen.port, config.listen.host, () => {
|
||||
mcpLogger.info({ port: config.listen.port, host: config.listen.host }, "MCP listening");
|
||||
});
|
||||
Reference in new issue
Block a user