docs(cli): Expand and improve the MCP server and dev CLI command#3225
docs(cli): Expand and improve the MCP server and dev CLI command#3225
Conversation
|
WalkthroughThis 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)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (7)
docs/docs.jsondocs/management/query/dashboards.mdxdocs/management/query/schema.mdxdocs/mcp-introduction.mdxdocs/mcp-tools.mdxdocs/observability/query.mdxdocs/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.yamldocs/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/sdkin 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.mdxdocs/management/query/dashboards.mdxdocs/mcp-introduction.mdxdocs/mcp-tools.mdxdocs/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.mdxdocs/management/query/dashboards.mdxdocs/mcp-introduction.mdxdocs/mcp-tools.mdxdocs/management/query/schema.mdx
docs/**/docs.json
📄 CodeRabbit inference engine (docs/CLAUDE.md)
docs/**/docs.json: Main documentation config must be defined indocs.jsonwhich includes navigation structure, theme, and metadata
Navigation structure indocs.jsonshould be organized usingnavigation.dropdownswith 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.mdxdocs/management/query/dashboards.mdxdocs/mcp-introduction.mdxdocs/mcp-tools.mdxdocs/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.mdxdocs/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--readonlyexists 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, andpackages/cli-v3/src/mcp/tools.ts:1-40still show no--readonlyoption and no readonly tool filtering, so Lines 310-345 are ahead of the shipped CLI unless#3224adds 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-40still 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#3224adds 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 themetricsschema rename before updating all of these queries.The current ClickHouse schema in
internal-packages/clickhouse/schema/019_create_metrics_v1.sql:1-45and writer contract ininternal-packages/clickhouse/src/metrics.ts:1-31still usevalue, with the extra run/machine fields underattributes, so the newmetric_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#3224ships 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.jsonkeeps them discoverable under the right section.Based on learnings, "New documentation pages must be added to the navigation structure in
docs.jsonunder the correct group after creating the MDX file."
| --- | ||
| title: "List dashboards" | ||
| openapi: "v3-openapi GET /api/v1/query/dashboards" | ||
| --- |
There was a problem hiding this comment.
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.
| --- | |
| 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.
| --- | ||
| title: "Get query schema" | ||
| openapi: "v3-openapi GET /api/v1/query/schema" | ||
| --- |
There was a problem hiding this comment.
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.
| --- | |
| 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.
Depends on #3224