Skip to content

Commit 2f60210

Browse files
authored
Merge pull request #100 from kernel/hypeship/mcp-project-support
Add project scoping support
2 parents 88d5c46 + 8a7abb7 commit 2f60210

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/app/[transport]/route.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@ interface MintlifySearchResult {
1616
}
1717

1818
function createKernelClient(apiKey: string) {
19+
const headers: Record<string, string> = {
20+
"X-Source": "mcp-server",
21+
"X-Referral-Source": "mcp.onkernel.com",
22+
};
23+
24+
const projectId = process.env.KERNEL_PROJECT;
25+
if (projectId) {
26+
headers["X-Kernel-Project-Id"] = projectId;
27+
}
28+
1929
return new Kernel({
2030
apiKey,
2131
baseURL: process.env.API_BASE_URL,
22-
defaultHeaders: {
23-
"X-Source": "mcp-server",
24-
"X-Referral-Source": "mcp.onkernel.com",
25-
},
32+
defaultHeaders: headers,
2633
});
2734
}
2835

0 commit comments

Comments
 (0)