Skip to content
Open
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
15 changes: 11 additions & 4 deletions src/app/[transport]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ interface MintlifySearchResult {
}

function createKernelClient(apiKey: string) {
const headers: Record<string, string> = {
"X-Source": "mcp-server",
"X-Referral-Source": "mcp.onkernel.com",
};

const projectId = process.env.KERNEL_PROJECT;
if (projectId) {
headers["X-Kernel-Project-Id"] = projectId;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing KERNEL_PROJECT_ID environment variable fallback

High Severity

The PR description states that KERNEL_PROJECT takes priority over KERNEL_PROJECT_ID, matching the CLI behavior. However, the implementation only reads process.env.KERNEL_PROJECT and never falls back to process.env.KERNEL_PROJECT_ID. Users who configure project scoping via KERNEL_PROJECT_ID (instead of KERNEL_PROJECT) will silently get no project scoping applied to their requests, which could lead to API calls hitting the wrong project scope.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8a7abb7. Configure here.


return new Kernel({
apiKey,
baseURL: process.env.API_BASE_URL,
defaultHeaders: {
"X-Source": "mcp-server",
"X-Referral-Source": "mcp.onkernel.com",
},
defaultHeaders: headers,
});
}

Expand Down
Loading