chore: update deps and listTools paging

This commit is contained in:
Peter Steinberger 2025-11-22 01:56:27 +01:00
parent 7d4d8e3c57
commit b1cbecfa83
4 changed files with 502 additions and 660 deletions

View File

@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.3/schema.json",
"$schema": "https://biomejs.dev/schemas/2.3.7/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",

View File

@ -42,30 +42,30 @@
},
"dependencies": {
"@iarna/toml": "^2.2.5",
"@modelcontextprotocol/sdk": "^1.10.1",
"@modelcontextprotocol/sdk": "~1.21.2",
"acorn": "^8.15.0",
"commander": "^12.1.0",
"es-toolkit": "^1.41.0",
"commander": "^14.0.2",
"es-toolkit": "^1.42.0",
"jsonc-parser": "^3.3.1",
"ora": "^8.0.1",
"rolldown": "^1.0.0-beta.47",
"ora": "^9.0.0",
"rolldown": "1.0.0-beta.51",
"zod": "^3.25.76"
},
"devDependencies": {
"@biomejs/biome": "^2.3.3",
"@biomejs/biome": "^2.3.7",
"@types/estree": "^1.0.8",
"@types/express": "^5.0.5",
"@types/node": "^24.10.0",
"@typescript/native-preview": "7.0.0-dev.20251104.1",
"bun-types": "^1.3.2",
"@types/node": "^24.10.1",
"@typescript/native-preview": "7.0.0-dev.20251121.1",
"bun-types": "^1.3.3",
"cross-env": "^10.1.0",
"express": "^5.1.0",
"oxlint": "^1.25.0",
"oxlint-tsgolint": "^0.5.0",
"rimraf": "^6.0.1",
"tsx": "^4.16.5",
"typescript": "^5.6.3",
"vitest": "^4.0.7"
"oxlint": "^1.29.0",
"oxlint-tsgolint": "^0.8.0",
"rimraf": "^6.1.2",
"tsx": "^4.20.6",
"typescript": "^5.9.3",
"vitest": "^4.0.13"
},
"engines": {
"node": ">=20.11.0"

1107
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -154,13 +154,22 @@ class McpRuntime implements Runtime {
skipCache: !autoAuthorize,
});
try {
const response = await context.client.listTools({ server: {} });
return (response.tools ?? []).map((tool) => ({
name: tool.name,
description: tool.description ?? undefined,
inputSchema: options.includeSchema ? tool.inputSchema : undefined,
outputSchema: options.includeSchema ? tool.outputSchema : undefined,
}));
const tools: ServerToolInfo[] = [];
let cursor: string | undefined;
do {
const response = await context.client.listTools(cursor ? { cursor } : undefined);
tools.push(
...(response.tools ?? []).map((tool) => ({
name: tool.name,
description: tool.description ?? undefined,
inputSchema: options.includeSchema ? tool.inputSchema : undefined,
outputSchema: options.includeSchema ? tool.outputSchema : undefined,
}))
);
cursor = response.nextCursor ?? undefined;
} while (cursor);
return tools;
} catch (error) {
// Keep-alive STDIO transports often die when Chrome closes; drop the cached client
// so the next call spins up a fresh process instead of reusing the broken handle.