Skip to content

Conversation

ericallam
Copy link
Member

  • Fix the search docs MCP tool
  • When installing the MCP server, using the @latest tag instead of @<current version>

Copy link

changeset-bot bot commented Aug 27, 2025

🦋 Changeset detected

Latest commit: ab59db8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
trigger.dev Patch
d3-chat Patch
references-d3-openai-agents Patch
references-nextjs-realtime Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/python Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/zod-worker Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Walkthrough

  • Adds a changeset for a patch release describing a new wait_for_run_to_complete tool.
  • Updates CLI install command default tag logic to use cliTag ("v4-beta" if cliVersion includes "v4-beta", else "latest").
  • Extends toolsMetadata with wait_for_run_to_complete and updates trigger_task description to reference it.
  • Introduces formatRunShape(run: AnyRunShape) to format run summaries.
  • Changes Mintlify client tool call name from "Search" to "SearchTriggerDev".
  • Registers a new waitForRunToCompleteTool in the MCP tools registry.
  • Implements waitForRunToCompleteTool to stream subscribe to a run until completion and output a formatted summary.
  • Adjusts trigger task guidance text to suggest waiting then fetching details.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Rationale: Mix of small text/config tweaks and a new streaming-based tool with API client usage, event loop handling, and new formatter. Changes span multiple files but most are straightforward; primary reasoning needed is in runs.ts implementation and formatter correctness.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mcp-improvements-round-1

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/cli-v3/src/commands/install-mcp.ts (1)

154-156: Fix typo in user-facing help text ("effect" → "affect").

Minor but visible in CLI help.

-      "The CLI log level to use (debug, info, log, warn, error, none). This does not effect the log level of your trigger.dev tasks.",
+      "The CLI log level to use (debug, info, log, warn, error, none). This does not affect the log level of your trigger.dev tasks.",
🧹 Nitpick comments (4)
.changeset/eleven-games-relate.md (1)

1-5: Expand the changeset summary to cover all user-facing tweaks (docs search + install tag).

Currently only mentions the new tool. Consider briefly noting the docs search tool fix and the default install tag change to make the patch notes self-contained.

Apply this tweak:

-add wait_for_run_to_complete tool so agents don't spam the get_run_details call after triggering
+Add wait_for_run_to_complete MCP tool so agents don't spam get_run_details after triggering.
+
+- Fix docs search MCP tool name.
+- Default MCP install uses @latest (or @v4-beta when applicable).
packages/cli-v3/src/mcp/config.ts (1)

67-72: Add long-running operation note and progress token hint to wait_for_run_to_complete

Please update the tool metadata in packages/cli-v3/src/mcp/config.ts to call out that this operation can take time and that clients should pass a progress token:

• File: packages/cli-v3/src/mcp/config.ts
Lines: ~67–72

   wait_for_run_to_complete: {
     name: "wait_for_run_to_complete",
     title: "Wait for Run to Complete",
-    description:
-      "Wait for a run to complete. The run ID is the ID of the run that was triggered. It starts with run_",
+    description:
+      "Wait for a run to complete. The run ID is the ID of the run that was triggered (starts with run_). This is a long-running operation; include a progress token to surface progress to the user.",
   },
packages/cli-v3/src/mcp/tools/runs.ts (2)

111-113: Optional: include dashboard URL in the output

Adding the run URL improves UX parity with get_run_details.

-    return {
-      content: [{ type: "text", text: formatRunShape(run) }],
-    };
+    const runUrl = await ctx.getDashboardUrl(
+      `/projects/v3/${projectRef}/runs/${run.id}`
+    );
+    return {
+      content: [
+        {
+          type: "text",
+          text: `${formatRunShape(run)}\n\n[View in dashboard](${runUrl})`,
+        },
+      ],
+    };

64-115: Optionally emit progress notifications while waiting

Leverage createProgressTracker to signal “subscribing” and “waiting for completion,” improving agent UX for long waits.

-  handler: toolHandler(CommonRunsInput.shape, async (input, { ctx, signal }) => {
+  handler: toolHandler(CommonRunsInput.shape, async (input, { ctx, signal, createProgressTracker }) => {
+    const progress = createProgressTracker(2);
+    await progress.next("Subscribing to run stream…");
@@
-    try {
+    try {
+      await progress.next("Waiting for run to complete…");
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 688b108 and ab59db8.

📒 Files selected for processing (8)
  • .changeset/eleven-games-relate.md (1 hunks)
  • packages/cli-v3/src/commands/install-mcp.ts (1 hunks)
  • packages/cli-v3/src/mcp/config.ts (1 hunks)
  • packages/cli-v3/src/mcp/formatters.ts (2 hunks)
  • packages/cli-v3/src/mcp/mintlifyClient.ts (1 hunks)
  • packages/cli-v3/src/mcp/tools.ts (2 hunks)
  • packages/cli-v3/src/mcp/tools/runs.ts (2 hunks)
  • packages/cli-v3/src/mcp/tools/tasks.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Always prefer using isomorphic code like fetch, ReadableStream, etc. instead of Node.js specific code
For TypeScript, we usually use types over interfaces
Avoid enums
No default exports, use function declarations

Files:

  • packages/cli-v3/src/mcp/tools/tasks.ts
  • packages/cli-v3/src/mcp/mintlifyClient.ts
  • packages/cli-v3/src/mcp/formatters.ts
  • packages/cli-v3/src/mcp/tools.ts
  • packages/cli-v3/src/mcp/config.ts
  • packages/cli-v3/src/mcp/tools/runs.ts
  • packages/cli-v3/src/commands/install-mcp.ts
🧠 Learnings (2)
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Define tasks using task({ id, run, ... }) with a unique id per project

Applied to files:

  • packages/cli-v3/src/mcp/tools/tasks.ts
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Import Trigger.dev APIs from "trigger.dev/sdk/v3" when writing tasks or related utilities

Applied to files:

  • packages/cli-v3/src/mcp/tools/runs.ts
🧬 Code graph analysis (4)
packages/cli-v3/src/mcp/tools/tasks.ts (1)
packages/cli-v3/src/mcp/config.ts (1)
  • toolsMetadata (12-103)
packages/cli-v3/src/mcp/formatters.ts (2)
packages/core/src/v3/apiClient/index.ts (1)
  • AnyRunShape (130-130)
apps/webapp/app/components/primitives/DateTime.tsx (1)
  • formatDateTime (64-80)
packages/cli-v3/src/mcp/tools.ts (1)
packages/cli-v3/src/mcp/tools/runs.ts (1)
  • waitForRunToCompleteTool (64-115)
packages/cli-v3/src/mcp/tools/runs.ts (4)
packages/cli-v3/src/mcp/config.ts (1)
  • toolsMetadata (12-103)
packages/cli-v3/src/mcp/schemas.ts (2)
  • CommonRunsInput (120-122)
  • CommonRunsInput (124-124)
packages/cli-v3/src/mcp/utils.ts (2)
  • toolHandler (43-63)
  • respondWithError (5-15)
packages/cli-v3/src/mcp/formatters.ts (1)
  • formatRunShape (104-130)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (22)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (8)
packages/cli-v3/src/commands/install-mcp.ts (1)

115-115: Default tag now uses cliTag (latest/v4-beta) — aligns with PR goal.

Nice improvement for DX and stability.

packages/cli-v3/src/mcp/config.ts (1)

59-60: Good guidance to prefer waiting before fetching run details.

Clearer agent behavior; reduces polling.

packages/cli-v3/src/mcp/formatters.ts (1)

104-130: Ignore defensive date handling suggestion

The createdAt and finishedAt fields in AnyRunShape are guaranteed to be Date objects, not raw strings:

  • In the zod schema for incoming shapes, both RawShapeDate and RawOptionalShapeDate transform any string timestamps into Date instances before they ever reach the client code.
  • The RunShape type defines
    createdAt: Date
    finishedAt?: Date
    (packages/core/src/v3/apiClient/runStream.ts)

Since all date strings are parsed into Date by the schema and the TypeScript types reflect that, formatDateTime will always receive a Date and cannot throw on a string input. No coercion or widening of formatDateTime is necessary.

Likely an incorrect or invalid review comment.

packages/cli-v3/src/mcp/tools/tasks.ts (1)

133-134: Good: dynamic guidance references registered tool names

Switching to toolsMetadata for tool names keeps the message in sync with actual registrations. No action needed.

packages/cli-v3/src/mcp/tools.ts (2)

11-16: Tool import wiring looks correct

Importing waitForRunToCompleteTool alongside existing run tools is consistent with the current pattern.


31-32: Registration order is fine

Adding waitForRunToCompleteTool to the registry maintains discoverability and doesn’t affect existing tools.

packages/cli-v3/src/mcp/tools/runs.ts (2)

1-1: Type import aligns with downstream usage

AnyRunShape is the right choice for formatting and completion checks.


3-3: Formatter import is appropriate

Using formatRunShape keeps output consistent with other run formatters.

@samejr samejr merged commit 6f6ca01 into main Aug 28, 2025
55 of 57 checks passed
@samejr samejr deleted the mcp-improvements-round-1 branch August 28, 2025 09:13
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.

2 participants