feat: add vercel-mcp to nuxi (admin only)#2343
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds admin-gated Vercel MCP and AI Gateway integrations with environment-backed authorization and session instructions. Introduces an analytics digest skill, Monday schedule, Slack delivery runner, and authenticated operations trigger. Expands weekly digest data collection and output rules with analytics, agent, and AI Gateway metrics. Updates weekly and firehose schedule times, runtime documentation, preview commands, and environment-file ignore patterns. Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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: 5
🧹 Nitpick comments (2)
.gitignore (1)
29-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExclude the checked-in environment template from this broad rule.
.env*also matches.env.example; add!.env.exampleafter this rule, or use narrower local-only patterns, so future template changes are not silently ignored.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.gitignore at line 29, Update the .gitignore environment rule by adding an exception for .env.example immediately after .env*, ensuring the checked-in template remains trackable while other environment files stay ignored..env.example (1)
50-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep the new dotenv keys in linter order.
dotenv-linterreports thatNUXI_VERCEL_PROJECT_IDshould precedeNUXI_VERCEL_TEAM_ID; reorder them to keep configuration checks clean. As reported bydotenv-linter4.0.0.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.env.example around lines 50 - 53, Reorder the environment variable declarations in the .env.example file so that NUXI_VERCEL_PROJECT_ID appears before NUXI_VERCEL_TEAM_ID, following the alphabetical order expected by dotenv-linter. Keep the shared comment above both variables unchanged.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@layers/nuxi/agent/connections/vercel-mcp.ts`:
- Around line 19-22: Add validation to ensure VERCEL_TEAM_ID and
VERCEL_PROJECT_ID are defined before exporting VERCEL_MCP_INSTRUCTIONS. If
either value is missing, either throw an error at startup to make these
variables required, or conditionally skip exporting the VERCEL_MCP_INSTRUCTIONS
constant and disable the connection when the IDs are unavailable. This prevents
the instructions from telling the agent to pass undefined values for teamId and
projectId.
In `@layers/nuxi/agent/skills/analytics-digest/SKILL.md`:
- Line 33: Update the sample date range in the Nuxt traffic digest heading to
represent exactly seven days, keeping it consistent with the “last 7 days”
wording and avoiding an eight-date inclusive span.
In `@layers/nuxi/agent/skills/weekly-digest/SKILL.md`:
- Around line 16-26: Update the authorization description for steps 6-9 (the
connection__vercel_mcp__get_web_analytics, ai_gateway__report, and
connection__vercel_mcp__list_agent_runs calls) to accurately reflect which
identity contexts are permitted. Either change the phrasing from
"admin/Slack-only" to "admin/Slack/schedule-only" to acknowledge that scheduled
runs with app auth are allowed, or explicitly document the exact trusted
identities that the authorization helper in admin-mcp-access.ts permits,
ensuring the documented access requirements align with what the code actually
enforces.
In `@layers/nuxi/agent/tools/ai-gateway.ts`:
- Around line 19-34: Update gatewayFetch to apply a timeout to the fetch request
by creating an AbortController or equivalent timeout signal and passing it
through the fetch options. Ensure the signal cancels stalled AI Gateway calls
within the intended request timeout while preserving the existing response and
error handling.
- Around line 49-60: Update the report tool’s inputSchema date validation so it
rejects requests where startDate is later than endDate, while preserving the
existing YYYY-MM-DD validation and inclusive boundary behavior. Add the
cross-field validation at the schema level so invalid windows fail locally
before the /report request is constructed.
---
Nitpick comments:
In @.env.example:
- Around line 50-53: Reorder the environment variable declarations in the
.env.example file so that NUXI_VERCEL_PROJECT_ID appears before
NUXI_VERCEL_TEAM_ID, following the alphabetical order expected by dotenv-linter.
Keep the shared comment above both variables unchanged.
In @.gitignore:
- Line 29: Update the .gitignore environment rule by adding an exception for
.env.example immediately after .env*, ensuring the checked-in template remains
trackable while other environment files stay ignored.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a001a466-a824-472e-bf58-56f96d05c442
📒 Files selected for processing (15)
.env.example.gitignorelayers/nuxi/README.mdlayers/nuxi/agent/channels/ops.tslayers/nuxi/agent/connections/vercel-mcp.tslayers/nuxi/agent/instructions.tslayers/nuxi/agent/lib/base-instructions.tslayers/nuxi/agent/lib/vercel-connect.tslayers/nuxi/agent/schedules/analytics-digest.tslayers/nuxi/agent/schedules/firehose-summary.tslayers/nuxi/agent/schedules/weekly-digest.tslayers/nuxi/agent/skills/analytics-digest/SKILL.mdlayers/nuxi/agent/skills/weekly-digest/SKILL.mdlayers/nuxi/agent/tools/admin-mcp.tslayers/nuxi/agent/tools/ai-gateway.ts
- guard VERCEL_MCP_INSTRUCTIONS when team/project ids are unset - add fetch timeout + startDate<=endDate validation to ai-gateway report tool - fix admin/Slack/schedule-only wording in weekly-digest skill - fix 7-day sample date range in analytics-digest skill - alphabetize NUXI_VERCEL_* in .env.example, track .env.example despite .env*
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
layers/nuxi/agent/skills/weekly-digest/SKILL.md (1)
48-48: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winBack the “sessions saved” metric with a data query.
The workflow requests web chat counts and vote quality, but no step retrieves saved-session counts. As written,
2 sessions savedhas no documented source and may be fabricated, violating the rule against invented metrics. Add an explicit data source or remove this field from the template.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@layers/nuxi/agent/skills/weekly-digest/SKILL.md` at line 48, Update the weekly digest workflow and its output template so “sessions saved” is either populated by an explicit query/data-retrieval step or removed entirely. Do not emit a saved-session count without a documented source; preserve the existing web chat and vote-quality metrics.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@layers/nuxi/agent/skills/weekly-digest/SKILL.md`:
- Line 48: Update the weekly digest workflow and its output template so
“sessions saved” is either populated by an explicit query/data-retrieval step or
removed entirely. Do not emit a saved-session count without a documented source;
preserve the existing web chat and vote-quality metrics.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f0ea3c53-f761-4d86-8948-023a3f2e66a6
📒 Files selected for processing (7)
.env.example.gitignorelayers/nuxi/agent/connections/vercel-mcp.tslayers/nuxi/agent/instructions.tslayers/nuxi/agent/skills/analytics-digest/SKILL.mdlayers/nuxi/agent/skills/weekly-digest/SKILL.mdlayers/nuxi/agent/tools/ai-gateway.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- .gitignore
- layers/nuxi/agent/instructions.ts
- layers/nuxi/agent/connections/vercel-mcp.ts
- layers/nuxi/agent/tools/ai-gateway.ts
Add a lot of new capabilities and improve current workflows