feat: render the mcp config component as markdown (#47292)

Renders the MCP config component as markdown for static markdown builds.
Currently we have no special case for `<McpConfigPanel />`, so it gets
stripped out during markdown rendering. This adds a static markdown
version of this component that renders all agents/tools consecutively.

Adds a new `McpConfigPanel.md.tsx` component that reuses data structures
used by `McpConfigPanel.tsx` but renders as markdown instead of React.
Instead of building the markdown via string concatenation, we use
[supabase-community/mdast-jsx](https://github.com/supabase-community/mdast-jsx)
which allows you to author markdown using JSX (providing type safety,
better DX, maintainability). E.g.

```jsx
<code lang="json" value='{ "key": "value" }' />
```
produces:
````md
```json
{ "key": "value" }
```
````

## Preview

https://docs-git-feat-mcp-config-markdown-supabase.vercel.app/docs/guides/ai-tools/mcp.md

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Added a docs-only MCP configuration panel with client-specific setup
steps, deep links, and generated configuration snippets.
- Enhanced guide generation to render richer, component-produced
markdown content.

- **Bug Fixes**
- Improved MCP config serialization and display for consistent
JSON/YAML/TOML output.

- **Refactor**
- Centralized MCP client metadata, instruction content, and config
build/serialization logic for reuse.

- **Chores**
- Expanded package exports for MCP URL builder assets and utilities;
improved runtime code-block language validation and updated PNG asset
typing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
This commit is contained in:
authored and GitHub committed 2026-07-02 14:00:33 +02:00
1 parent b59f3ea05b
commit 74881cbb73
18 files changed
+1095 -732

No files matched your search

+1 -1
View File
@@ -140,6 +140,7 @@
"@graphql-codegen/cli": "5.0.5",
"@graphql-codegen/typescript": "4.1.6",
"@graphql-codegen/typescript-resolvers": "4.5.0",
"@redocly/cli": "^2.26.0",
"@supabase/supa-mdx-lint": "0.3.2",
"@testing-library/react": "^16.0.0",
"@types/common-tags": "^1.8.4",
@@ -154,7 +155,6 @@
"@types/react-copy-to-clipboard": "^5.0.4",
"@types/react-dom": "catalog:",
"@types/unist": "^2.0.6",
"@redocly/cli": "^2.26.0",
"amaro": "^1.1.5",
"api-types": "workspace:*",
"cheerio": "^1.0.0-rc.12",