Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 12 additions & 4 deletions src/app/[transport]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ function createAuthErrorResponse(
);
}

async function listProfiles(client: ReturnType<typeof createKernelClient>) {
const profiles: Awaited<ReturnType<typeof client.profiles.retrieve>>[] = [];
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
Expand All @@ -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);
Comment thread
cursor[bot] marked this conversation as resolved.
return {
contents: [
{
uri: "profiles://",
mimeType: "application/json",
text: profiles
text: profiles.length > 0
? JSON.stringify(profiles, null, 2)
: "No profiles found",
},
Expand Down Expand Up @@ -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,
);
Expand Down Expand Up @@ -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: [
{
Expand Down
Loading