Skip to content

docs: add hosted MCP server config generator#4599

Draft
andrelandgraf wants to merge 9 commits intomainfrom
docs/mcp-server-config-generator
Draft

docs: add hosted MCP server config generator#4599
andrelandgraf wants to merge 9 commits intomainfrom
docs/mcp-server-config-generator

Conversation

@andrelandgraf
Copy link
Copy Markdown
Contributor

Summary

  • replace the old MCP setup tabs in neon-mcp-server docs with a new interactive MCP Server Config Generator
  • generate hosted Neon MCP JSON + add-mcp command snippets from auth/transport/access selections
  • preview selected and excluded tools via list-tools, with loading/error/retry states and graceful fallback behavior

Test plan

  • run website locally and verify /docs/ai/neon-mcp-server renders the configurator
  • run local mcp-server-neon and verify /api/list-tools returns 200
  • verify generated output behavior:
    • omit X-Neon-Read-Only when read-only is disabled
    • omit X-Neon-Scopes when none or all categories are selected
    • include expected headers for API key mode and project-scoped mode

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 5, 2026

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

Project Deployment Actions Updated (UTC)
neon-next Ready Ready Preview, Comment May 3, 2026 4:57am

Request Review

@andrelandgraf
Copy link
Copy Markdown
Contributor Author

Updated configurator: query-param-based config + UI polish

The hosted Neon MCP server recently moved from X-Neon-* custom headers to URL query params (readonly, projectId, category) on the /mcp endpoint. The configurator has been rewritten against that contract and polished visually.

What changed

  • Generated URL now encodes access controls as query params (e.g. https://mcp.neon.tech/mcp?readonly=true&projectId=proj_123&category=projects,branches,schema,querying) — matches resolveGrantFromSearchParams in mcp-server-neon.
  • Only Authorization header is emitted, and only in API Key mode. The X-Neon-* allow-list / header validation is gone.
  • List-tools preview uses the same query params so the tool diff is always consistent with the generated URL.
  • Dropped the next/dynamic({ ssr: false }) wrapper — Next.js 16 disallows it from Server Components, and the component is already 'use client'.

UI polish

  • Segmented Auth mode control with inline descriptions.
  • Custom read-only switch and compact access card.
  • Tool categories as 2-column cards with descriptions + Select/Clear all toggle.
  • Live Server URL preview with highlighted query params.
  • Tool pills split into enabled (colored) and hidden (struck-through) groups with counts.
  • Responsive classes flipped to match the repo's desktop-first Tailwind variants.

Screenshots (hosted on screenshots/pr-4599 branch; delete that branch after review)

1. Default — OAuth, all scopes enabled

OAuth default

2. API Key mode

API key is plumbed into both the add-mcp command and JSON config headers.Authorization.

API Key mode

3. Fully restricted — read-only + single project + subset of categories

Note the live URL preview with highlighted readonly, projectId, and category query params, and the enabled/hidden tool split (11 enabled · 18 hidden).

Restricted config

4. Dark mode

Dark mode

Replace legacy MCP setup tabs with an interactive configurator.
It generates valid hosted Neon MCP snippets and previews selected tools.
Map NEXT_PUBLIC_MCP_API_URL values like /mcp or /sse to /api/list-tools.
This lets PR previews use preview MCP hosts without touching prod defaults.
Use NEXT_PUBLIC_MCP_API_URL directly when set.
Fallback defaults to the production list-tools endpoint.
Make the API key input visible.
Keep add-mcp Authorization output aligned with the generated JSON config.
Update MCP scope selection in docs and configurator.
Use one querying category for SQL querying and optimization tools.
Document that project-scoped mode excludes search and fetch.
Align configurator guidance text with scoped tool behavior.
Remove the SSE selector and always generate Streamable HTTP config and commands.
Fix configurator copy buttons by passing explicit copy text to code blocks.
…olish UI

The hosted Neon MCP server now consumes access controls (readonly,
projectId, category) via URL query params rather than custom
X-Neon-* headers. Update the configurator to match the new contract:

- Generate URLs like https://mcp.neon.tech/mcp?readonly=true&category=...
  instead of emitting custom request headers.
- Drop the header validation and X-Neon-* allowlist; only Authorization
  remains (API key mode).
- Fetch the list-tools preview with the same query params.

UI polish:
- New Configuration / Result section split with accent bars.
- Segmented control for auth mode with descriptions.
- Custom toggle switch for read-only.
- Category picker as 2-column cards with descriptions and a
  Select/Clear all toggle.
- Live Server URL preview card with highlighted query params.
- Tool pills with a colored enabled group and a struck-through hidden
  group, plus enabled/hidden counts.
- Dropped next/dynamic { ssr: false } wrapper which is no longer
  allowed from Server Components in Next.js 16; the component is
  already marked use client.

Responsive classes use the repo's desktop-first tailwind variants.
Drop the hosted/streamable HTTP badge, the visible "Configuration"
heading (now sr-only), the OAuth re-authorize warning, and the
Server URL preview block (already shown in the copy-pastable
add-mcp command and JSON config below).
@andrelandgraf
Copy link
Copy Markdown
Contributor Author

Follow-up: further UI trim

The configurator was further simplified in 143415d4. Screenshots in the comment above have been refreshed to match.

Removed

  • HOSTED · STREAMABLE HTTP badge in the header
  • Visible CONFIGURATION section label (kept as sr-only <h4>)
  • OAuth re-authorize warning block
  • Server URL preview block (the URL is already visible in the add-mcp command and JSON config below)

The branch was also rebased onto latest main (linear history, no merge commits).

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