Skip to content

fix(cli-v3): fallback to context projectRef option in getProjectRef (#5139) - #5140

Closed
aftab8052tech wants to merge 1 commit into
triggerdotdev:mainfrom
aftab8052tech:fix/issue-5139-mcp-project-ref
Closed

aftab8052tech wants to merge 1 commit into
triggerdotdev:mainfrom
aftab8052tech:fix/issue-5139-mcp-project-ref

Conversation

@aftab8052tech

Copy link
Copy Markdown

Overview

Fixes #5139

When running trigger.dev mcp --project-ref <ref> from a directory without a trigger.config.ts, toMcpContextOptions forwards projectRef to McpContextOptions. However, McpContext.getProjectRef only checked the tool call's options.projectRef and then attempted to load trigger.config.ts. It never checked this.options.projectRef.

As a result, tools like list_runs failed with "No project ref found. Please provide a projectRef." even when --project-ref was supplied on startup.

Changes

  • In McpContext.getProjectRef, fall back to this.options.projectRef when the tool invocation provides no projectRef.

@changeset-bot

changeset-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2daa101

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Hi @aftab8052tech, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Nov 19, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

Comment on lines +149 to +151
if (this.options.projectRef) {
return this.options.projectRef;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Missing changeset for MCP fix

The getProjectRef fix changes published CLI behavior, but the PR contains no changeset. Release requirements require one for user-facing package fixes, leaving this fix outside the changeset release plan.

Learn more

The published trigger.dev package uses Changesets for package releases. This PR fixes MCP tools failing when a startup project reference is provided without a local config, which meets the user-facing fix criteria. No changeset is included in the diff.

Example: A user running trigger.dev mcp --project-ref proj_example outside a configured project can now use project tools, but no release entry communicates that fix.

Recommended fix: Add a changeset with "trigger.dev": patch and a user-facing sentence explaining that MCP tools now honor --project-ref without requiring a local project config.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: mcp --project-ref is parsed but never used to find the project

1 participant