Skip to content

feat(evi): connect agent to telemetry mcp - #539

Merged
HugoRCD merged 4 commits into
mainfrom
feat/telemetry-connection
Aug 9, 2026
Merged

feat(evi): connect agent to telemetry mcp#539
HugoRCD merged 4 commits into
mainfrom
feat/telemetry-connection

Conversation

@evlogai

@evlogai evlogai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Gives the agent read-only access to production evlog CLI telemetry through the telemetry dashboard's existing MCP endpoint, so the digest can report CLI usage and Hugo can ask questions about what is happening in the CLI. The agent authenticates with its own Vercel OIDC token: no shared password, no new env var.

What it adds

  • Connection (agent/connections/telemetry.ts): MCP client to https://telemetry.evlog.cloud/mcp (the same host the CLI ingests to, per packages/cli/src/lib/constants.ts), allowlisting the four existing dashboard tools: telemetry-stats (aggregates with period-over-period, source/environment/tool breakdowns, top commands, top error codes, percentiles), telemetry-adoption (version rollout, new vs returning machines, punchcard, flag/custom-field breakdown), telemetry-runs (raw event list), telemetry-run (full per-run flags and fields). All read-only.
  • Auth via Vercel OIDC: the connection sends process.env.VERCEL_OIDC_TOKEN, the token Vercel injects into the evi deployment (the same one the turbo remote-cache tool already uses). Nothing to configure, no password to share. Locally there is no OIDC token; the dashboard's soft auth keeps a password-less local dashboard open.
  • Server side (apps/telemetry): /mcp now authorizes a bearer token when it matches ANALYTICS_PASSWORD (human MCP clients like Cursor) or is a valid Vercel OIDC token. Verification (server/utils/vercel-oidc.ts) checks the signature against Vercel's team JWKS and pins iss to https://oidc.vercel.com/hrcd and sub to owner:hrcd:project:evi:environment:production, so only the evi project's production deployments pass. jose added as a direct dependency (already in the tree at the same version; lockfile delta is 3 lines).
  • Skill (agent/skills/telemetry/SKILL.md): how to query and what is worth surfacing: version adoption, source mix, flag and custom-field usage, error-code trends, period-over-period shifts.
  • Digest (agent/skills/daily-digest/SKILL.md): new "CLI usage (last 7d)" section between Visitors and Worth reading, one or two lines so the digest stays scannable.
  • Notes (docs/notes.md): the OIDC auth mapping under a new Telemetry section.

Capability placement checklist (per docs/capability-placement.md)

  1. Connection + skill: the remote API is already an MCP server, so defineMcpClientConnection with an allowlist is the cheapest wiring; the skill carries the "what is interesting" procedure. No authored tool needed, no new cadence (the digest schedule already exists).
  2. Trust gate: the connection is gated to canAccessAdminTools (maintainer + schedule app turns); community and autonomous turns are denied. On the server, the OIDC sub claim pins team, project and environment, so no other Vercel project can mint an accepted token.
  3. Logic: vercel-oidc.ts on the telemetry side with an injectable keyset for hermetic tests; the gate reuses the tested canAccessAdminTools on the evi side.
  4. Docs: notes.md updated; digest skill updated; new telemetry skill.

Checks

  • pnpm run lint: 22/22 tasks pass
  • pnpm run typecheck: 27/27 tasks pass
  • pnpm run test: pass (telemetry 187 tests, +6 new auth/OIDC cases)
  • Changeset: none, confined to apps/*

No deployment step: OIDC is already enabled on the evi project (the turbo remote-cache tool depends on it).

@changeset-bot

changeset-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a212567

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

@evlogai
evlogai Bot requested a review from HugoRCD August 9, 2026 16:58
@vercel

vercel Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evi Ready Ready Preview Aug 9, 2026 5:40pm
evlog-docs Ready Ready Preview, v0 Aug 9, 2026 5:40pm
evlog-render-lab Ready Ready Preview Aug 9, 2026 5:40pm
evlog-telemetry Ready Ready Preview Aug 9, 2026 5:40pm
just-use-evlog Ready Ready Preview Aug 9, 2026 5:40pm

Request Review

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@pkg-pr-new

pkg-pr-new Bot commented Aug 9, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@evlog/cli@539
npm i https://pkg.pr.new/evlog@539
npm i https://pkg.pr.new/@evlog/nuxthub@539
npm i https://pkg.pr.new/@evlog/telemetry@539

commit: a212567

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant