Conversation
Read KERNEL_PROJECT or KERNEL_PROJECT_ID env var and inject the X-Kernel-Project-Id header into all SDK requests. This mirrors the CLI approach and allows org-scoped API keys to target a specific project.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR modifies the MCP server client setup, not the kernel API endpoints (packages/api/cmd/api/) or Temporal workflows (packages/api/lib/temporal) specified in the filter. To monitor this PR anyway, reply with |
Projects is a brand new feature — KERNEL_PROJECT_ID was never in production, so there's no legacy to preserve. Only read KERNEL_PROJECT. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8a7abb7. Configure here.
| const projectId = process.env.KERNEL_PROJECT; | ||
| if (projectId) { | ||
| headers["X-Kernel-Project-Id"] = projectId; | ||
| } |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 8a7abb7. Configure here.


Adds support for project-scoped API requests in the MCP server.
What changed
createKernelClient()now readsKERNEL_PROJECTorKERNEL_PROJECT_IDenv vars and injects theX-Kernel-Project-Idheader into all SDK requests. This allows org-scoped API keys to target a specific project, matching the approach used in the CLI and dashboard.How it works
KERNEL_PROJECTtakes priority overKERNEL_PROJECT_ID(same as CLI)createKernelClient()so no call-site changes neededRelated
Note
Medium Risk
Adds an optional
X-Kernel-Project-Idheader to all Kernel SDK calls whenKERNEL_PROJECTis set, which could change which project data is accessed for org-scoped API keys.Overview
Adds project scoping to outbound Kernel SDK requests by building
defaultHeadersincreateKernelClient()and conditionally injectingX-Kernel-Project-Idfromprocess.env.KERNEL_PROJECT.When the env var is unset, requests remain unchanged (existing
X-Source/X-Referral-Sourceheaders only).Reviewed by Cursor Bugbot for commit 8a7abb7. Bugbot is set up for automated code reviews on this repo. Configure here.