Skip to content

feat: automate MCP client documentation - #179

Closed
Rodriguespn wants to merge 18 commits into
mainfrom
ai-274-automate-mcp-client-docs
Closed

feat: automate MCP client documentation#179
Rodriguespn wants to merge 18 commits into
mainfrom
ai-274-automate-mcp-client-docs

Conversation

@Rodriguespn

@Rodriguespn Rodriguespn commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

Automate MCP Client Documentation

This PR implements an automated system for managing MCP client documentation in the README.

Linear Issue: https://linear.app/supabase/issue/AI-274/automate-mcp-client-documentation-in-readmemd

Overview

The system uses TypeScript constants and a template-based approach to generate consistent client documentation, eliminating manual markdown editing and ensuring the README stays in sync with client metadata.

Changes

Documentation System:

  • Added packages/mcp-server-supabase/docs/clients.ts - TypeScript constants with client metadata (exported from package for external use)
  • Added docs/clients/_template.md - Handlebars-style template for generating docs
  • Added support for custom manual configuration snippets (YAML) via manualSnippet
  • No runtime validation needed - TypeScript provides compile-time safety
  • Client metadata is exported from @supabase/mcp-server-supabase package for use in external projects

Scripts:

  • npm run docs:generate-clients - Generates client docs from TypeScript constants + template

Existing Client Configs

  • Cursor - AI-powered code editor with deeplink installation
  • VS Code - Visual Studio Code with GitHub Copilot (stable + insiders)
  • Factory - AI-powered code assistant with CLI installation

New Client Configs

  • Claude Code - Claude's code editor with CLI installation
  • Goose - Desktop & CLI, supports streamable_http extension with deeplink, CLI command, and YAML manual configuration

Testing

# Generate client documentation
npm run docs:generate-clients

# Type check the constants file
pnpm exec tsc --noEmit packages/mcp-server-supabase/docs/clients.ts

@github-actions

Copy link
Copy Markdown

✅ Client documentation validated. No changes needed.

@Rodriguespn Rodriguespn self-assigned this Nov 13, 2025
@github-actions

Copy link
Copy Markdown

✅ Client documentation validated. No changes needed.

Use configFilePath directly in template to generate consistent instructions
@github-actions

Copy link
Copy Markdown

✅ Client documentation validated. No changes needed.

…stants

Per Matt's feedback, removed over-engineered validation system in favor of
compile-time TypeScript validation similar to the main Supabase docs.

Changes:
- Replace clients.json with constants.ts (TypeScript data file)
- Remove Zod validation and types.ts
- Remove interactive CLI tool (add-client.ts)
- Update generate-clients.ts to use imported constants directly
- Update GitHub workflow to use tsc for type checking
- Remove Zod dependency from package.json
- Update documentation to reflect TypeScript-only approach

Benefits:
- Simpler mental model (just TypeScript)
- Compile-time validation instead of runtime
- No additional dependencies beyond TypeScript
- Easier to maintain and contribute to
@github-actions

Copy link
Copy Markdown

✅ Client documentation validated. No changes needed.

…aring

Moved client metadata from docs/clients/constants.ts to
packages/mcp-server-supabase/src/clients.ts and exported from the package.

This allows:
- Documentation scripts to import client data
- External Node.js projects to import from the published npm package
- Single source of truth for client configurations

Changes:
- Created packages/mcp-server-supabase/src/clients.ts with client data
- Export clients and types from package index
- Updated docs/clients/constants.ts to re-export from package
- Updated GitHub workflow to check the new path
- Updated documentation to reflect the new architecture
- Built package to verify exports work correctly
@github-actions

Copy link
Copy Markdown

✅ Client documentation validated. No changes needed.

@Rodriguespn
Rodriguespn force-pushed the ai-274-automate-mcp-client-docs branch from a654128 to a4a647c Compare November 13, 2025 15:37
Added Claude Code as a supported MCP client with:
- CLI installation command
- Manual configuration instructions
- OAuth authentication flow guidance
… custom config format

- Added Goose with deeplink and CLI install command
- Manual config path set to ~/.config/goose/config.yaml (custom format)
- Updated types to allow 'custom' configFormat
- Regenerated docs and README
Comment thread docs/scripts/generate-clients.ts Outdated
Comment thread docs/scripts/generate-clients.ts Outdated
Comment thread packages/mcp-server-supabase/tsconfig.json
…ded manualSnippet to ManualConfig\n- Updated Goose client with YAML configuration snippet and new button image\n- Updated template to render YAML when custom format used\n- Regenerated client docs
The template uses {{#each installation.deeplink}} which requires an array. Changed Cursor and Goose deeplink objects to single-element arrays to match VS Code's structure and enable button rendering.
Per Greg's code review feedback on PR #179:

- Move packages/mcp-server-supabase/docs/clients.ts to src/clients.ts

- Add export path './clients' in package.json

- Add src/clients.ts to tsup entry points for building

- Update imports to use @supabase/mcp-server-supabase/clients

- Remove empty docs/ directory from package

This creates a clean package subpath export that external consumers

can use to import client definitions without reaching into internals.
Per Greg's code review feedback on PR #179:

- Move clients.ts to src/integrations/ directory

- Create integrations/index.ts as the export entry point

- Add package.json subpath export: @supabase/mcp-server-supabase/integrations

- Update tsup config to build integrations/index.ts

- Update imports throughout to use the new integrations path

- Remove old docs/ directory from package

This mirrors the pattern used for platform exports and provides a clean,

documented way for external projects to import client metadata.
Fix workflow to reference packages/mcp-server-supabase/src/integrations/clients.ts instead of the old docs/clients.ts path
- Add build step before type checking so dist/ types are available

- Change Handlebars import to namespace import for better TS compatibility
- Change docs/clients/constants.ts to use relative path import

- Remove build step from workflow since we don't need dist/ types

- This avoids circular dependency issues during development
@github-actions

Copy link
Copy Markdown

✅ Client documentation validated. No changes needed.

@Rodriguespn
Rodriguespn requested a review from gregnr November 13, 2025 19:56
Comment thread docs/clients/README.md Outdated
The client metadata is defined in `packages/mcp-server-supabase/src/integrations/clients.ts` and exported from the `@supabase/mcp-server-supabase/integrations` subpath. This allows:

- **Documentation generation**: This repo's scripts import the data to generate docs
- **External integrations**: Other Node.js projects can import client metadata from the published package using `import { clients } from '@supabase/mcp-server-supabase/integrations'`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **External integrations**: Other Node.js projects can import client metadata from the published package using `import { clients } from '@supabase/mcp-server-supabase/integrations'`
- **External integrations**: Other JS projects can import client metadata from the published package using `import { clients } from '@supabase/mcp-server-supabase/integrations'`

Comment thread docs/clients/README.md Outdated

1. Open `packages/mcp-server-supabase/src/integrations/clients.ts`
2. Add a new client object to the `clients` array following the `Client` interface
3. Run `npm run docs:generate-clients` to generate documentation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Run `npm run docs:generate-clients` to generate documentation
3. Run `pnpm docs:generate-clients` to generate documentation

@gregnr gregnr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you have reviewed these already, but this is where this logic lives in the current URL builder. Worth double checking that our schema supports everything they will need there if the goal is for URL builder to import client info from this.

Comment thread docs/clients/README.md Outdated
Comment on lines +131 to +133
## Future Enhancements

This data structure can be published as an npm package (e.g., `@supabase/mcp-clients-registry`) to share client metadata with the Supabase documentation website and other tools.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer relevant?

Comment thread docs/clients/README.md
Comment on lines +108 to +116
The `_template.md` file uses Handlebars-style syntax:

- `{{variable}}` - Variable substitution
- `{{#if condition}}...{{/if}}` - Conditional blocks
- `{{#if condition}}...{{else if condition2}}...{{else}}...{{/if}}` - Else-if chains
- `{{#each array}}...{{/each}}` - Loop over arrays
- `{{#unless condition}}...{{/unless}}` - Negative conditional
- `{{@last}}` - Special variable in loops (true for last item)
- `(eq a b)` - Helper function for equality comparison

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of date? Reference handlebars docs?

Comment thread packages/mcp-server-supabase/tsconfig.json
@@ -0,0 +1,111 @@
import { readFileSync, writeFileSync } from 'node:fs';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use node:fs/promises import and make these async

Comment thread docs/scripts/generate-clients.ts Outdated
Comment on lines +82 to +89
// Optionally write individual client markdown files
const clientDocPath = join(
process.cwd(),
'docs/clients',
`${client.id}.md`
);
writeFileSync(clientDocPath, content, 'utf-8');
console.log(` Wrote ${client.id}.md`);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the benefit to this?

}

// Update README.md
console.log('\nUpdating README.md...');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these \n prefixes intentional?

Comment thread docs/clients/README.md
Comment on lines +57 to +104
### Generating Documentation

After adding or modifying a client, regenerate the documentation:

```bash
npm run docs:generate-clients
```

This will:
1. Read `constants.ts`
2. Type-check the TypeScript file
3. Generate individual `{client-id}.md` files from the template
4. Update the client documentation section in `README.md`
5. Format all files with Biome

## Client Data Schema

The schema is defined as TypeScript interfaces in `constants.ts`:

```typescript
interface Client {
id: string; // Unique identifier (lowercase-kebab-case)
name: string; // Display name
description?: string; // Short description
officialDocs?: string; // URL to official MCP documentation
installation: {
deeplink?: { // One-click installation button
url: string;
buttonImage: string;
buttonAlt: string;
} | Array<...>; // Can be single or array for multiple buttons
command?: { // CLI installation
command: string;
description?: string;
};
manual: { // Manual config (always required)
configFilePath: string;
configFormat: "mcpServers" | "servers";
};
};
registry?: { // Registry listing info
listed: boolean;
listingUrl?: string;
};
}
```

TypeScript provides compile-time validation, so any schema errors will be caught before generating documentation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be just me but a lot of these docs feel duplicated and verbose. Embedding the schema makes it harder to maintain later if we need to update it. Worth keeping this doc minimal?

Comment thread .gitignore
Comment on lines +8 to +9
# Generated client documentation (keep _template.md and clients.json)
docs/clients/*.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this already lives in the main README is there much benefit to including these?

* Update README.md with generated client documentation
*/
function updateReadme(clients: Client[], generatedDocs: string[]): void {
const readmePath = join(process.cwd(), 'README.md');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use import.meta.resolve to find the README.md relative to this file so that it doesn't matter which CWD the user is in

Comment on lines +44 to +47
/**
* List of all MCP clients that support the Supabase MCP server
*/
export const clients: Client[] = [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we intentionally omitting Windsurf (which is currently listed in our docs)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not intentionally but I haven't yet tried Windsurf out. Mainly because on our documentation, we have that they don't support remote, which according with their documentation, seems to be outdated

I plan to add support for Windsurf and Codex on this PR and then we should be good to go

@github-actions

Copy link
Copy Markdown

✅ Client documentation validated. No changes needed.

@Rodriguespn

Copy link
Copy Markdown
Contributor Author

After internal deliberation, we've decided to keep a single source of truth about how to configure the Supabase MCP server for different clients on our docs page. I've opened supabase/supabase#40525 with the client configurations there instead. Thanks for the discussion and exploration on this approach!

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.

2 participants