mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
switch to node api for generate-mcp for cf builds
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import type { Tool, Resource } from "jsonv-ts/mcp";
|
import type { Tool, Resource } from "jsonv-ts/mcp";
|
||||||
import { rimraf } from "rimraf";
|
import { rimraf } from "rimraf";
|
||||||
|
import { writeFile, readFile } from "node:fs/promises";
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
mcpConfig: "./mcp.json",
|
mcpConfig: "./mcp.json",
|
||||||
@@ -9,9 +10,9 @@ const config = {
|
|||||||
async function generate() {
|
async function generate() {
|
||||||
console.info("Generating MCP documentation...");
|
console.info("Generating MCP documentation...");
|
||||||
await cleanup();
|
await cleanup();
|
||||||
const mcpConfig = await Bun.file(config.mcpConfig).json();
|
const mcpConfig = JSON.parse(await readFile(config.mcpConfig, "utf-8"));
|
||||||
const document = await generateDocument(mcpConfig);
|
const document = await generateDocument(mcpConfig);
|
||||||
await Bun.write(config.outFile, document);
|
await writeFile(config.outFile, document, "utf-8");
|
||||||
console.info("MCP documentation generated.");
|
console.info("MCP documentation generated.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user