Skip to content

Add: Base UI support via --ui-library flag#45

Merged
Jpisnice merged 5 commits into
Jpisnice:masterfrom
thisavoropaev:feat/base-ui-support
Feb 10, 2026
Merged

Add: Base UI support via --ui-library flag#45
Jpisnice merged 5 commits into
Jpisnice:masterfrom
thisavoropaev:feat/base-ui-support

Conversation

@thisavoropaev

@thisavoropaev thisavoropaev commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

Problem

Currently the MCP server only supports Radix UI primitives. However, shadcn/ui now supports both Radix and Base UI as primitive libraries. Users who prefer Base UI cannot use this MCP server effectively.

Solution

Add --ui-library radix|base CLI arg and UI_LIBRARY env var to switch between primitive libraries (React only, default: radix).

Changes

  • Add UiLibrary type and getUiLibrary() in framework.ts
  • Dynamic registry paths in axios.ts (bases/base/ vs new-york-v4/)
  • Handle demo naming (-example vs -demo suffix)
  • Base UI fallback component list
  • Update directory structure handler for dynamic path
  • Document in README

Test Plan

  • npm run build passes
  • npm test passes
  • Test with --ui-library radix (default)
  • Test with --ui-library base

shadcn v4 supports Radix and Base UI as primitive libraries.
Add --ui-library radix|base CLI arg and UI_LIBRARY env var
to switch between them (React only, default: radix).

- Add UiLibrary type and getUiLibrary() in framework.ts
- Dynamic registry paths in axios.ts (bases/base/ vs new-york-v4/)
- Handle demo naming (-example vs -demo suffix)
- Base UI fallback component list
- Base UI metadata from bases/base/ui/_registry.ts
- Update directory structure handler for dynamic path
- Document in README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the pr,it's now under review

thisavoropaev and others added 2 commits February 1, 2026 19:01
- Fix empty catch block in getBlockCode (re-throw non-404 errors)
- Update Base UI fallback list: 25 → 54 components
- Memoize getFramework/getUiLibrary (eliminate log spam)
- Warn when --ui-library used with non-React framework

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Jpisnice

Jpisnice commented Feb 1, 2026

Copy link
Copy Markdown
Owner

hey @thisavoropaev thanks for the PR,will this also work with react native and the other implementations for shadcn ui?

thisavoropaev and others added 2 commits February 1, 2026 22:22
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@thisavoropaev

thisavoropaev commented Feb 1, 2026

Copy link
Copy Markdown
Contributor Author

hey @Jpisnice !

Re: Will this work with React Native and other implementations?

--ui-library (or UI_LIBRARY env var) is React-only because Base UI is a React library.

Background: In December 2025, shadcn/ui added Base UI support for React as an alternative to Radix UI primitives (changelog).

Note on Radix: While Radix is still supported, it's not actively maintained — the original team moved on to create Base UI. For new projects, Base UI is recommended. Base UI was specifically designed for easy migration from Radix.

The registry structure reflects this:

  • registry/new-york-v4/ — Radix UI components
  • registry/bases/base/ — Base UI components

For other frameworks:

These have only one implementation each, so no --ui-library flag is needed.

If someone tries FRAMEWORK=svelte UI_LIBRARY=base, the server will warn and ignore the flag.

@Jpisnice

Jpisnice commented Feb 3, 2026

Copy link
Copy Markdown
Owner

hey @Jpisnice !

Re: Will this work with React Native and other implementations?

--ui-library (or UI_LIBRARY env var) is React-only because Base UI is a React library.

Background: In December 2025, shadcn/ui added Base UI support for React as an alternative to Radix UI primitives (changelog).

Note on Radix: While Radix is still supported, it's not actively maintained — the original team moved on to create Base UI. For new projects, Base UI is recommended. Base UI was specifically designed for easy migration from Radix.

The registry structure reflects this:

  • registry/new-york-v4/ — Radix UI components
  • registry/bases/base/ — Base UI components

For other frameworks:

These have only one implementation each, so no --ui-library flag is needed.

If someone tries FRAMEWORK=svelte UI_LIBRARY=base, the server will warn and ignore the flag.

oh,okay..I will review and get back on this,if I have any doubts or need assistance

@Jpisnice Jpisnice merged commit 40d2540 into Jpisnice:master Feb 10, 2026
1 of 2 checks passed
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