Skip to content

MCP: working /mcp endpoint (P1) + discovery consistency (P2/P4)#1

Open
LimaDevBTC wants to merge 1 commit into
mainfrom
feat/mcp-discovery-consistency
Open

MCP: working /mcp endpoint (P1) + discovery consistency (P2/P4)#1
LimaDevBTC wants to merge 1 commit into
mainfrom
feat/mcp-discovery-consistency

Conversation

@LimaDevBTC

Copy link
Copy Markdown
Owner

Addresses the MCP audit (mcpupdate.md, 2026-06-10). P1 is fully resolved; this PR carries the P2/P4 follow-ups (P1 itself already landed on main via the hourly auto-update commit 94afbde66).

P1 — /mcp 404 → working (already on main)

Root cause: the MCP server existed only as a standalone Express app (mcp-server/, port 3002) that never deploys on Vercel serverless, so www.dogdata.xyz/mcp 404'd.

Fix (files app/mcp/route.ts + lib/mcp/*, already in main):

  • New Next.js route using mcp-handler + @modelcontextprotocol/sdk@1.26.0, basePath:"/" → exact /mcp match, Node runtime, CORS (Authorization / Content-Type / Mcp-Session-Id).
  • Tools/resources/prompts proxy the app's own REST endpoints (single source of truth) + direct external fetches for DEX/CoinGecko — no big data files bundled into the function.
  • Verified locally: POST /mcp initialize→200, GET /mcp405 (not 404), tools/list17, resources→8, prompts→4, real-data execution, CORS preflight→204; next build exit 0 (ƒ /mcp). get_metrics_history upgraded from placeholder to real Supabase series.

P4 — count inconsistencies (this PR)

Endpoints said 40 (/api) vs 35 (/api/status); the OpenAPI contract documents 54. MCP tool count was 15 (/api) / 16 (capabilities + llms.txt) while the live endpoint exposes 17.

  • lib/api-metadata.ts: API_ENDPOINT_COUNT derived from openapi.json paths; MCP_TOOL_COUNT/RESOURCE/PROMPT constants.
  • Consumed in /api, /api/status, /api/agent/capabilities — drift-proof.

P2 — unpublished npm package de-advertised (this PR)

npx @dogdata/mcp-server is unpublished (npm 404) and, being disk-backed, wouldn't work for end users. Per the audit's golden rule (never advertise what errors), discovery now points at the working endpoint + the published mcp-remote bridge:

  • llms.txt, robots.txt, ai-agent.json, /api, capabilities, docs page → https://www.dogdata.xyz/mcp and npx mcp-remote https://www.dogdata.xyz/mcp.

Not in scope

  • P3 (price/stats pipeline freeze) — needs node-box access (systemd/logs), not code.
  • P5/P6 (freshness envelope, monitoring) — separate follow-up.

🤖 Generated with Claude Code

…se unpublished npm package

P4 — counts were inconsistent across the discovery layer: /api said 40 endpoints,
/api/status said 35, the OpenAPI contract documents 54; MCP tool count was variously
15 (/api), 16 (capabilities + llms.txt) while the live /mcp endpoint exposes 17.

- Add lib/api-metadata.ts: API_ENDPOINT_COUNT derived from openapi.json paths (54),
  plus MCP_TOOL_COUNT (17) / RESOURCE (8) / PROMPT (4) constants.
- Consume in /api, /api/status, /api/agent/capabilities — no more hardcoded drift.

P2 — the discovery layer advertised `npx @dogdata/mcp-server`, which is unpublished on
npm (404) and, being disk-backed, would not work for end users anyway. Per the audit's
golden rule (never advertise what returns an error), point everything at the now-working
remote endpoint + the published `mcp-remote` bridge for stdio clients:

- llms.txt, robots.txt, ai-agent.json, /api, capabilities, docs page now advertise
  https://www.dogdata.xyz/mcp and `npx mcp-remote https://www.dogdata.xyz/mcp`.
- Fix mcp-server/server.ts tool-count comment (16 -> 17).

Note: P1 (the /mcp Next.js route itself — app/mcp/route.ts + lib/mcp/*) already landed
on main via the hourly auto-update commit 94afbde.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
dog-data Ready Ready Preview, Comment Jun 10, 2026 9:08pm

Request Review

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