diff --git a/bun.lock b/bun.lock index f292c43..32f8101 100644 --- a/bun.lock +++ b/bun.lock @@ -10,7 +10,7 @@ "@clerk/themes": "^2.4.19", "@mcp-ui/server": "^5.10.0", "@modelcontextprotocol/sdk": "1.26.0", - "@onkernel/sdk": "^0.35.0", + "@onkernel/sdk": "^0.58.0", "@types/jsonwebtoken": "^9.0.10", "@types/redis": "^4.0.11", "builtin-modules": "^5.0.0", @@ -145,7 +145,7 @@ "@next/swc-win32-x64-msvc": ["@next/swc-win32-x64-msvc@16.0.10", "", { "os": "win32", "cpu": "x64" }, "sha512-E+njfCoFLb01RAFEnGZn6ERoOqhK1Gl3Lfz1Kjnj0Ulfu7oJbuMyvBKNj/bw8XZnenHDASlygTjZICQW+rYW1Q=="], - "@onkernel/sdk": ["@onkernel/sdk@0.35.0", "", {}, "sha512-EnTEyTm85WwOOXZziDTySNHl46ZO+DSJjVDJDJNarwkD+kv623TzXDLpgH7vwy4LfQjQ4DzOQe0hHKgCYrAv5A=="], + "@onkernel/sdk": ["@onkernel/sdk@0.58.0", "", {}, "sha512-eJNydQ8WzZWq837EX+V2QMUhK4O8feVnj9EXZukOvOHXH9PfIr40IQXUxIZ1ic/s08witQ6hQmtlCqY7VeF2aQ=="], "@redis/bloom": ["@redis/bloom@5.6.0", "", { "peerDependencies": { "@redis/client": "^5.6.0" } }, "sha512-l13/d6BaZDJzogzZJEphIeZ8J0hpQpjkMiozomTm6nJiMNYkoPsNOBOOQua4QsG0fFjyPmLMDJFPAp5FBQtTXg=="], diff --git a/package.json b/package.json index 72027ff..dca4937 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@clerk/themes": "^2.4.19", "@mcp-ui/server": "^5.10.0", "@modelcontextprotocol/sdk": "1.26.0", - "@onkernel/sdk": "^0.35.0", + "@onkernel/sdk": "^0.58.0", "@types/jsonwebtoken": "^9.0.10", "@types/redis": "^4.0.11", "builtin-modules": "^5.0.0", diff --git a/src/app/[transport]/route.ts b/src/app/[transport]/route.ts index 74c5e19..00973fa 100644 --- a/src/app/[transport]/route.ts +++ b/src/app/[transport]/route.ts @@ -67,6 +67,14 @@ function createAuthErrorResponse( ); } +async function listProfiles(client: ReturnType) { + const profiles: Awaited>[] = []; + for await (const profile of client.profiles.list()) { + profiles.push(profile); + } + return profiles; +} + // Create MCP handler with tools const handler = createMcpHandler((server) => { // Register MCP resources @@ -80,13 +88,13 @@ const handler = createMcpHandler((server) => { if (uriString === "profiles://") { // List all profiles - const profiles = await client.profiles.list(); + const profiles = await listProfiles(client); return { contents: [ { uri: "profiles://", mimeType: "application/json", - text: profiles + text: profiles.length > 0 ? JSON.stringify(profiles, null, 2) : "No profiles found", }, @@ -915,7 +923,7 @@ Based on your issue "${issue_description}", start with: }, ], }; - const existingProfiles = await client.profiles.list(); + const existingProfiles = await listProfiles(client); const existingProfile = existingProfiles?.find( (p) => p.name === params.profile_name, ); @@ -973,7 +981,7 @@ Based on your issue "${issue_description}", start with: }; } case "list": { - const profiles = await client.profiles.list(); + const profiles = await listProfiles(client); return { content: [ {