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 |
|
|
||
| - `runs`: contains all task run data including status, timing, costs, and task output. Run metadata (key-value set in your task) is not available on the Query page. | ||
| - `metrics`: contains metrics data for your runs including CPU, memory, and your custom metrics | ||
| - `llm_metrics`: contains LLM/AI metrics including token usage, costs, latency, and model performance data from GenAI spans |
There was a problem hiding this comment.
🚩 llm_metrics table documented as available but not yet in querySchemas
The new line at docs/observability/query.mdx:10 lists llm_metrics as an available table. However, apps/webapp/app/v3/querySchemas.ts:602 shows querySchemas only contains [runsSchema, metricsSchema] — no llm_metrics schema exists anywhere in the codebase. If this docs PR merges before the corresponding feature code, users will see llm_metrics listed as available and attempt to query it, resulting in errors. Worth confirming the feature code lands before or alongside this PR.
Was this helpful? React with 👍 or 👎 to provide feedback.
| ## Profile Tools | ||
|
|
||
| ### whoami | ||
|
|
||
| Show the current authenticated user, active CLI profile, email, and API URL. | ||
|
|
||
| **Example usage:** | ||
| - `"Who am I logged in as?"` | ||
| - `"What profile am I using?"` | ||
|
|
||
| ### list_profiles | ||
|
|
||
| List all configured CLI profiles and which one is currently active. | ||
|
|
||
| **Example usage:** | ||
| - `"What profiles do I have?"` | ||
| - `"Show me my Trigger.dev profiles"` | ||
|
|
||
| ### switch_profile | ||
|
|
||
| Switch the active CLI profile for this MCP session. This changes which Trigger.dev account and API URL are used for all subsequent tool calls. | ||
|
|
||
| **Example usage:** | ||
| - `"Switch to my production profile"` | ||
| - `"Use the staging profile"` | ||
|
|
||
| ## Query and Analytics Tools | ||
|
|
||
| ### get_query_schema | ||
|
|
||
| Get the schema for TRQL queries, including all available tables, their columns, data types, descriptions, and allowed values. Call this before using the query tool to understand what data is available. | ||
|
|
||
| **Example usage:** | ||
| - `"What tables and columns can I query?"` | ||
| - `"Show me the query schema"` | ||
|
|
||
| ### query | ||
|
|
||
| Execute a TRQL query against your Trigger.dev data. TRQL is a SQL-style query language for analyzing runs, metrics, and LLM usage. | ||
|
|
||
| **Example usage:** | ||
| - `"How many runs failed in the last 7 days?"` | ||
| - `"Show me the top 10 most expensive tasks"` | ||
| - `"Query the average execution duration by task"` | ||
|
|
||
| ### list_dashboards | ||
|
|
||
| List available built-in dashboards with their widgets. Each dashboard contains pre-built queries for common metrics. | ||
|
|
||
| **Example usage:** | ||
| - `"What dashboards are available?"` | ||
| - `"Show me the dashboard widgets"` | ||
|
|
||
| ### run_dashboard_query | ||
|
|
||
| Execute a single widget query from a built-in dashboard. Use `list_dashboards` first to see available dashboards and widget IDs. | ||
|
|
||
| **Example usage:** | ||
| - `"Run the total runs widget from the overview dashboard"` | ||
| - `"Show me the LLM cost over time from the AI dashboard"` | ||
|
|
||
| ## Dev Server Tools | ||
|
|
||
| ### start_dev_server | ||
|
|
||
| Start the Trigger.dev dev server (`trigger dev`) in the background. Waits up to 30 seconds for the worker to be ready. | ||
|
|
||
| **Example usage:** | ||
| - `"Start the dev server"` | ||
| - `"Run trigger dev"` | ||
|
|
||
| ### stop_dev_server | ||
|
|
||
| Stop the running Trigger.dev dev server. | ||
|
|
||
| **Example usage:** | ||
| - `"Stop the dev server"` | ||
|
|
||
| ### dev_server_status | ||
|
|
||
| Check the status of the dev server and view recent output. Shows whether it is stopped, starting, ready, or has errors. | ||
|
|
||
| **Example usage:** | ||
| - `"Is the dev server running?"` | ||
| - `"Show me the dev server logs"` | ||
| - `"Are there any build errors?"` |
There was a problem hiding this comment.
🚩 New MCP tools documented but not verified in MCP server code
The docs/mcp-tools.mdx update documents many new MCP tools: whoami, list_profiles, switch_profile, get_query_schema, query, list_dashboards, run_dashboard_query, start_dev_server, stop_dev_server, dev_server_status. A quick check of packages/cli-v3/src/dev/mcpServer.ts shows only limited dashboard references. These tools may exist in a parallel feature branch. Reviewer should confirm these tools are implemented before merging the docs.
Was this helpful? React with 👍 or 👎 to provide feedback.
Depends on #3224