fix(mcp): serve /api/v1/mcp/info publicly by duyet · Pull Request #3211 · chmonitor/chmonitor · GitHub
Skip to content

fix(mcp): serve /api/v1/mcp/info publicly - #3211

Merged
duyet merged 3 commits into
mainfrom
feat/enable-ai-demo-dashboard
Aug 21, 2026
Merged

fix(mcp): serve /api/v1/mcp/info publicly#3211
duyet merged 3 commits into
mainfrom
feat/enable-ai-demo-dashboard

Conversation

@duyet

@duyet duyet commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #3210: production routes GET /api/v1/mcp/info to the standalone MCP worker (chmonitor-mcp, via Workers Routes), whose defaultAuthenticator 401s anonymous callers whenever CHM_API_KEY_SECRET/CLERK_SECRET_KEY is set — exactly the 401 Unauthorized seen on dash.chmonitor.dev.

The info payload is static tools/resources metadata (names + descriptions only — no secrets, no ClickHouse access), matching:

  • the dashboard's own /api/v1/mcp/info route (calls buildServerInfo() with no auth gate), and
  • the mcp feature's public access in /api/v1/config.

Fix: pass a no-op authenticate for the info handler in apps/mcp/src/index.ts. The actual MCP protocol endpoint /api/mcp (whose tools can query ClickHouse) stays authenticated. Added a regression test for the no-op-authenticator case in packages/mcp-server.

Tests

  • packages/mcp-server/src/__tests__/http.test.ts — new "serves info publicly when a no-op authenticator is injected" test; all 25 pass.
  • wrangler deploy --minify --dry-run succeeds.

duyet and others added 3 commits August 21, 2026 11:59
Allow anonymous cloud visitors to generate AI insights on the public demo
host (host=0) via a carve-out in POST /api/v1/insights/generate, mirroring
the agent guest path. Signed-in cloud users still get the demo hidden.

Exempt GET /api/v1/mcp/info from the global API guard so the agents sidebar
can render MCP tools for unsigned visitors.

Show friendly model names in the agent model picker instead of raw model
ids, backed by a new `name` field in the model registry.

Co-Authored-By: duyetbot <bot@duyet.net>
Production routes /api/v1/mcp/info to the standalone MCP worker, whose
default authenticator 401s anonymous callers (CHM_API_KEY_SECRET set).
The payload is static tools/resources metadata — no secrets, no ClickHouse
access — matching the dashboard's own public info route and the `mcp`
feature's `public` access. Pass a no-op authenticator for the info handler
only; /api/mcp stays authenticated.

Co-Authored-By: duyetbot <bot@duyet.net>
@github-actions github-actions Bot added area: packages Shared packages/* app: dashboard Changes to the apps/dashboard TanStack Start app labels Aug 21, 2026
@duyet
duyet enabled auto-merge (squash) August 21, 2026 05:20
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

☁️ Cloudflare Preview Deployment

App Preview URL
Dashboard https://preview.dash.chmonitor.dev
MCP https://preview.dash.chmonitor.dev/api/mcp
Landing https://preview.chmonitor.dev
Docs https://preview.docs.chmonitor.dev
Property Value
Commit be6a1c1
Deployed at 2026-08-21T05:23:46.435Z

Previews are automatically updated on every push to this PR.
Unchanged apps keep their previous preview (path-filtered deploys).

@duyet
duyet merged commit 85ad406 into main Aug 21, 2026
23 checks passed
@duyet
duyet deleted the feat/enable-ai-demo-dashboard branch August 21, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: dashboard Changes to the apps/dashboard TanStack Start app area: packages Shared packages/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant