Skip to content

docs(cli): Expand and improve the MCP server and dev CLI command#3225

Draft
ericallam wants to merge 1 commit intomainfrom
docs/mcp-dev-enhancements
Draft

docs(cli): Expand and improve the MCP server and dev CLI command#3225
ericallam wants to merge 1 commit intomainfrom
docs/mcp-dev-enhancements

Conversation

@ericallam
Copy link
Member

Depends on #3224

@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2026

⚠️ No Changeset found

Latest commit: 9f347ee

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 15, 2026

Walkthrough

This pull request updates documentation and OpenAPI specifications to introduce new query API capabilities. It adds two new REST endpoints (for querying schema and listing dashboards), documents a new --readonly CLI flag for install-mcp to prevent AI-driven modifications, introduces Profile Tools documentation, and revises query observability documentation with a new llm_metrics table and column rename (value → metric_value) with corresponding example updates across TRQL and SQL snippets.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description provides only 'Depends on #3224' with no meaningful content; it is missing all required template sections including Testing, Changelog, and a substantive overview of changes. Complete the PR description by filling in the template sections: Testing (steps taken), Changelog (summary of changes), and optionally Screenshots. Explain what this PR accomplishes beyond its dependency.
Title check ❓ Inconclusive The title describes documentation changes to MCP/CLI, but the changeset includes substantial additions to API documentation endpoints, query schema, dashboards, observability metrics, and OpenAPI spec updates—broader scope than title suggests. Clarify whether 'MCP server and dev CLI command' fully encompasses API documentation additions, or consider a more comprehensive title like 'docs: Expand MCP documentation and add query API endpoints'.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/mcp-dev-enhancements
📝 Coding Plan
  • Generate coding plan for human review comments

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/management/query/dashboards.mdx`:
- Around line 1-4: The frontmatter for the MDX page is missing the required
description field; update the YAML frontmatter at the top of the "List
dashboards" MDX page to include a description key (e.g. description: "Brief
summary of the List dashboards endpoint") alongside the existing title and
openapi entries, and optionally add sidebarTitle if desired so the page conforms
to the docs frontmatter requirements.

In `@docs/management/query/schema.mdx`:
- Around line 1-4: The frontmatter for the "Get query schema" MDX page is
missing the required description field; update the YAML frontmatter that
currently contains title and openapi to also include a description key with a
concise summary of the page's purpose (you may also add sidebarTitle if desired)
so it conforms to the repo's MDX frontmatter rules; locate the metadata block at
the top of the schema.mdx file (the lines with ---, title, openapi) and insert a
description: "..." line describing the page.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f35804cf-8c88-4144-8bb9-c1f25f82eae2

📥 Commits

Reviewing files that changed from the base of the PR and between 7672e8d and 9f347ee.

📒 Files selected for processing (7)
  • docs/docs.json
  • docs/management/query/dashboards.mdx
  • docs/management/query/schema.mdx
  • docs/mcp-introduction.mdx
  • docs/mcp-tools.mdx
  • docs/observability/query.mdx
  • docs/v3-openapi.yaml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,ts,jsx,tsx,json,md,yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier before committing

Files:

  • docs/v3-openapi.yaml
  • docs/docs.json
docs/**/*.mdx

📄 CodeRabbit inference engine (docs/CLAUDE.md)

docs/**/*.mdx: MDX documentation pages must include frontmatter with title (required), description (required), and sidebarTitle (optional) in YAML format
Use Mintlify components for structured content: , , , , , , /, /
Always import from @trigger.dev/sdk in code examples (never from @trigger.dev/sdk/v3)
Code examples must be complete and runnable where possible
Use language tags in code fences: typescript, bash, json

Files:

  • docs/observability/query.mdx
  • docs/management/query/dashboards.mdx
  • docs/mcp-introduction.mdx
  • docs/mcp-tools.mdx
  • docs/management/query/schema.mdx
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (CLAUDE.md)

Documentation in docs/ directory uses Mintlify MDX format - follow docs/CLAUDE.md for conventions

Files:

  • docs/observability/query.mdx
  • docs/management/query/dashboards.mdx
  • docs/mcp-introduction.mdx
  • docs/mcp-tools.mdx
  • docs/management/query/schema.mdx
docs/**/docs.json

📄 CodeRabbit inference engine (docs/CLAUDE.md)

docs/**/docs.json: Main documentation config must be defined in docs.json which includes navigation structure, theme, and metadata
Navigation structure in docs.json should be organized using navigation.dropdowns with groups and pages

Files:

  • docs/docs.json
🧠 Learnings (11)
📓 Common learnings
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 3200
File: docs/config/config-file.mdx:353-368
Timestamp: 2026-03-10T12:44:19.869Z
Learning: In the triggerdotdev/trigger.dev repository, docs PRs are often written as companions to implementation PRs (e.g., PR `#3200` documents features being added in PR `#3196`). When reviewing docs PRs, the documented features may exist in a companion/companion PR branch rather than main. Always check companion PRs referenced in the PR description before flagging missing implementations.
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: packages/cli-v3/CLAUDE.md:0-0
Timestamp: 2026-03-02T12:43:34.140Z
Learning: Applies to packages/cli-v3/src/mcp/**/* : Provide an MCP server implementation in `src/mcp/` for AI-assisted task development
📚 Learning: 2026-03-10T12:44:14.176Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 3200
File: docs/config/config-file.mdx:353-368
Timestamp: 2026-03-10T12:44:14.176Z
Learning: In the trigger.dev repo, docs PRs are often companions to implementation PRs. When reviewing docs PRs (MDX files under docs/), check the PR description for any companion/related PR references and verify that the documented features exist in those companion PRs before flagging missing implementations. This ensures docs stay in sync with code changes across related PRs.

Applied to files:

  • docs/observability/query.mdx
  • docs/management/query/dashboards.mdx
  • docs/mcp-introduction.mdx
  • docs/mcp-tools.mdx
  • docs/management/query/schema.mdx
📚 Learning: 2026-03-02T12:43:02.539Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: docs/CLAUDE.md:0-0
Timestamp: 2026-03-02T12:43:02.539Z
Learning: Applies to docs/**/*.mdx : MDX documentation pages must include frontmatter with title (required), description (required), and sidebarTitle (optional) in YAML format

Applied to files:

  • docs/management/query/dashboards.mdx
  • docs/management/query/schema.mdx
📚 Learning: 2026-03-02T12:43:34.140Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: packages/cli-v3/CLAUDE.md:0-0
Timestamp: 2026-03-02T12:43:34.140Z
Learning: Applies to packages/cli-v3/src/mcp/**/* : Provide an MCP server implementation in `src/mcp/` for AI-assisted task development

Applied to files:

  • docs/mcp-introduction.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `task()` function from `trigger.dev/sdk/v3` to define tasks with id and run properties

Applied to files:

  • docs/mcp-introduction.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Run `npx trigger.devlatest init` to initialize a Trigger.dev project

Applied to files:

  • docs/mcp-introduction.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure Trigger.dev project in `trigger.config.ts` using `defineConfig()` with project ref and task directories

Applied to files:

  • docs/mcp-introduction.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Run `npx trigger.devlatest dev` to start the Trigger.dev development server

Applied to files:

  • docs/mcp-introduction.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Use build extensions in trigger.config.ts (additionalFiles, additionalPackages, aptGet, prismaExtension, etc.) to customize the build

Applied to files:

  • docs/mcp-introduction.mdx
📚 Learning: 2026-03-02T12:43:34.140Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: packages/cli-v3/CLAUDE.md:0-0
Timestamp: 2026-03-02T12:43:34.140Z
Learning: Applies to packages/cli-v3/src/commands/dev.ts : Implement `dev.ts` command in `src/commands/` for local development mode

Applied to files:

  • docs/mcp-introduction.mdx
📚 Learning: 2026-03-02T12:43:02.539Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: docs/CLAUDE.md:0-0
Timestamp: 2026-03-02T12:43:02.539Z
Learning: New documentation pages must be added to the navigation structure in `docs.json` under the correct group after creating the MDX file

Applied to files:

  • docs/management/query/schema.mdx
🪛 Gitleaks (8.30.0)
docs/v3-openapi.yaml

[high] 1210-1214: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.

(curl-auth-header)


[high] 1265-1269: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.

(curl-auth-header)

🪛 LanguageTool
docs/mcp-introduction.mdx

[style] ~310-~310: Consider shortening or rephrasing this to strengthen your wording.
Context: ...r_task, cancel_run) so the AI cannot make changes to your account - --yolo` — Install into ...

(MAKE_CHANGES)

🔇 Additional comments (4)
docs/mcp-introduction.mdx (1)

303-345: Verify --readonly exists end-to-end before publishing these CLI examples.

The current snippets from packages/cli-v3/src/commands/install-mcp.ts:114-158, packages/cli-v3/src/commands/mcp.ts:24-55, and packages/cli-v3/src/mcp/tools.ts:1-40 still show no --readonly option and no readonly tool filtering, so Lines 310-345 are ahead of the shipped CLI unless #3224 adds both pieces.

Based on learnings, "In the trigger.dev repo, docs PRs are often companions to implementation PRs. When reviewing docs PRs (MDX files under docs/), check the PR description for any companion/related PR references and verify that the documented features exist in those companion PRs before flagging missing implementations."

docs/mcp-tools.mdx (1)

131-216: Verify the new MCP tool names against the companion implementation.

packages/cli-v3/src/mcp/tools.ts:1-40 still registers only the existing org/task/run/deploy tools, so the profile/query/dev-server sections on Lines 131-216 will not be discoverable unless #3224 adds and registers them under these exact names.

Based on learnings, "In the trigger.dev repo, docs PRs are often companions to implementation PRs. When reviewing docs PRs (MDX files under docs/), check the PR description for any companion/related PR references and verify that the documented features exist in those companion PRs before flagging missing implementations."

docs/observability/query.mdx (1)

18-27: Double-check the metrics schema rename before updating all of these queries.

The current ClickHouse schema in internal-packages/clickhouse/schema/019_create_metrics_v1.sql:1-45 and writer contract in internal-packages/clickhouse/src/metrics.ts:1-31 still use value, with the extra run/machine fields under attributes, so the new metric_value/top-level column docs on Lines 18-27 and the updated examples on Lines 35-44, 227-235, and 531-554 will fail unless #3224 ships the matching query-layer changes first.

Based on learnings, "In the trigger.dev repo, docs PRs are often companions to implementation PRs. When reviewing docs PRs (MDX files under docs/), check the PR description for any companion/related PR references and verify that the documented features exist in those companion PRs before flagging missing implementations."

Also applies to: 35-44, 227-235, 531-554

docs/docs.json (1)

325-326: Good navigation follow-through.

Wiring the new Query API pages into docs.json keeps them discoverable under the right section.

Based on learnings, "New documentation pages must be added to the navigation structure in docs.json under the correct group after creating the MDX file."

Comment on lines +1 to +4
---
title: "List dashboards"
openapi: "v3-openapi GET /api/v1/query/dashboards"
---
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add the required description frontmatter.

This new page only sets title and openapi, but docs/**/*.mdx pages in this repo require a description.

Proposed fix
 ---
 title: "List dashboards"
+description: "Reference for listing built-in query dashboards and their widgets."
 openapi: "v3-openapi GET /api/v1/query/dashboards"
 ---

As per coding guidelines, "MDX documentation pages must include frontmatter with title (required), description (required), and sidebarTitle (optional) in YAML format."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
title: "List dashboards"
openapi: "v3-openapi GET /api/v1/query/dashboards"
---
---
title: "List dashboards"
description: "Reference for listing built-in query dashboards and their widgets."
openapi: "v3-openapi GET /api/v1/query/dashboards"
---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/management/query/dashboards.mdx` around lines 1 - 4, The frontmatter for
the MDX page is missing the required description field; update the YAML
frontmatter at the top of the "List dashboards" MDX page to include a
description key (e.g. description: "Brief summary of the List dashboards
endpoint") alongside the existing title and openapi entries, and optionally add
sidebarTitle if desired so the page conforms to the docs frontmatter
requirements.

Comment on lines +1 to +4
---
title: "Get query schema"
openapi: "v3-openapi GET /api/v1/query/schema"
---
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add the required description frontmatter.

This new page only sets title and openapi, but docs/**/*.mdx pages in this repo require a description.

Proposed fix
 ---
 title: "Get query schema"
+description: "Reference for retrieving the query schema, including available tables and columns."
 openapi: "v3-openapi GET /api/v1/query/schema"
 ---

As per coding guidelines, "MDX documentation pages must include frontmatter with title (required), description (required), and sidebarTitle (optional) in YAML format."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
title: "Get query schema"
openapi: "v3-openapi GET /api/v1/query/schema"
---
---
title: "Get query schema"
description: "Reference for retrieving the query schema, including available tables and columns."
openapi: "v3-openapi GET /api/v1/query/schema"
---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/management/query/schema.mdx` around lines 1 - 4, The frontmatter for the
"Get query schema" MDX page is missing the required description field; update
the YAML frontmatter that currently contains title and openapi to also include a
description key with a concise summary of the page's purpose (you may also add
sidebarTitle if desired) so it conforms to the repo's MDX frontmatter rules;
locate the metadata block at the top of the schema.mdx file (the lines with ---,
title, openapi) and insert a description: "..." line describing the page.

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.

1 participant