mcp: sorting tools, fixed cloudflare example, fixed some styling

This commit is contained in:
dswbx
2025-08-20 18:26:48 +02:00
parent 8ec03afbe8
commit bc1ab0f6d3
10 changed files with 63 additions and 24 deletions

View File

@@ -16,9 +16,13 @@ export function getSystemMcp(app: App) {
...middlewareServer.tools,
// tools added from ctx
...app.modules.ctx().mcp.tools,
// tools from app schema
...nodes.flatMap((n) => n.schema.getTools(n)),
];
].sort((a, b) => a.name.localeCompare(b.name));
// tools from app schema
tools.push(
...nodes.flatMap((n) => n.schema.getTools(n)).sort((a, b) => a.name.localeCompare(b.name)),
);
const resources = [...middlewareServer.resources, ...app.modules.ctx().mcp.resources];
return new McpServer(