docs: updated mcp tools

This commit is contained in:
dswbx
2025-10-28 11:09:37 +01:00
parent 0a50f9850c
commit 422f7893b5
5 changed files with 175 additions and 28 deletions

View File

@@ -311,8 +311,9 @@ export class App<
throw new Error("MCP is not enabled");
}
const url = new URL(config.path, "http://localhost").toString();
return new McpClient({
url: "http://localhost" + config.path,
url,
fetch: this.server.request,
});
}

View File

@@ -70,12 +70,13 @@ export class SystemController extends Controller {
if (!config.mcp.enabled) {
return;
}
const { permission } = this.middlewares;
const { permission, auth } = this.middlewares;
this.registerMcp();
app.server.all(
config.mcp.path,
auth(),
permission(SystemPermissions.mcp, {}),
mcpMiddleware({
setup: async () => {