Skip to content

Add a live social image for /mcp-server/stats - #6840

Merged
andrelandgraf merged 2 commits into
mainfrom
mcp-stats-social-image
Nov 18, 2026
Merged

andrelandgraf merged 2 commits into
mainfrom
mcp-stats-social-image

Conversation

@andrelandgraf

@andrelandgraf andrelandgraf commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Problem

/mcp-server/stats shares with the site's default social image, so a link to the leaderboard on X, LinkedIn or Slack shows nothing about the page.

Change

/mcp-server/stats/og returns a 1200×630 PNG titled "Neon MCP Stats" with the top five agents from the latest published week, drawn as labeled bars:

Social image

The page's og:image points at it:

export const metadata = getMetadata({
  ...SEO_DATA.mcpServerStats,
  imagePath: `${VERCEL_URL}${LINKS.mcpServerStats}/og`,
});
  • Live data: the route reads the same getMcpStats() data as the page and revalidates hourly, so the card always shows the current week. Grouped buckets (Other, Custom code) are left out.
  • Bars: bars are scaled to the leading agent so the ranking reads at thumbnail size. Every bar carries its exact share.
  • Without the stats database: the route answers 404 wherever the page does (local and preview builds without STATS_DATABASE_URL). Any other error fails the request.
  • Reuse: it follows the Function Registry template OG route: next/og, the same fonts and the same logo asset.
  • Bundling: next.config.js gets an outputFileTracingIncludes entry for /mcp-server/stats/og with the two fonts and the logo. The config excludes ./public/** from serverless bundles, so every OG route that reads assets from disk lists them, like the Function Registry route.

Verification

  • Vercel preview build: /mcp-server/stats/og returns the PNG from the bundled route.
  • next dev against the production stats tables: /mcp-server/stats/og returns 200 image/png at 1200×630 (the image above), and the page HTML carries <meta property="og:image" content=".../mcp-server/stats/og">.
  • ESLint and Prettier are clean on the changed files. The two no-img-element warnings are the same ones the existing OG route has, since next/og needs plain img tags.

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
neon-next Ready Ready Preview Nov 18, 2026 11:34pm UTC

Request Review

@andrelandgraf
andrelandgraf merged commit da59123 into main Nov 18, 2026
4 checks passed
@andrelandgraf
andrelandgraf deleted the mcp-stats-social-image branch November 18, 2026 23:37

This branch was successfully deployed

1 active deployment
Preview – neon-next — fc7e1613 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant