Files
bknd/app/internal/docs.build-assets.ts
2025-10-28 11:09:37 +01:00

40 lines
893 B
TypeScript

import { createApp } from "bknd/adapter/bun";
async function generate() {
console.info("Generating MCP documentation...");
const app = await createApp({
connection: {
url: ":memory:",
},
config: {
server: {
mcp: {
enabled: true,
path: "/mcp2",
},
},
auth: {
enabled: true,
},
media: {
enabled: true,
adapter: {
type: "local",
config: {
path: "./",
},
},
},
},
});
await app.build();
await app.getMcpClient().ping();
const { tools, resources } = app.mcp!.toJSON();
await Bun.write("../docs/mcp.json", JSON.stringify({ tools, resources }, null, 2));
console.info("MCP documentation generated.");
}
void generate();