You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: mcp --project-ref is parsed but never used to find the project #5139
trigger.dev mcp --project-ref <ref> started in a directory without a trigger.config.ts (for example a monorepo root whose config is in apps/<app>/) still answers "No project ref found. Please provide a projectRef." from tools such as list_runs. The tools' projectRef description says the ref is detected when you pass the --project-ref option to the MCP server.
Cause: toMcpContextOptions (packages/cli-v3/src/mcp/contextOptions.ts) forwards projectRef into the context options, but McpContext.getProjectRef (packages/cli-v3/src/mcp/context.ts) checks only the tool call's projectRef and then a trigger.config.ts loaded from the call's configPath or the client's first root. It never reads this.options.projectRef. getProjectRef is unchanged from 4.5.11, and both files are the same in 4.8.6 as on main (context.ts last changed in c8ee9e3).
To reproduce (seen with 4.5.11, Node 24, macOS, with a stdio MCP client that supports roots and reports an empty directory as its root):
In an empty directory, start npx trigger.dev@4.5.11 mcp --project-ref <your project ref>.
Call list_runs with environment: "dev" and no projectRef.
Expected: a run list (possibly empty). Actual: "No project ref found. Please provide a projectRef."
Passing projectRef in the call works.
Suggested fix: in getProjectRef, use this.options.projectRef when the call passes none.
Activity