File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " shadcn " : major
3+ ---
4+
5+ add new mcp server and command
Original file line number Diff line number Diff line change 6060 "pub:next" : " pnpm build && pnpm publish --no-git-checks --access public --tag next" ,
6161 "pub:release" : " pnpm build && pnpm publish --access public" ,
6262 "test" : " vitest run" ,
63- "test:dev" : " REGISTRY_URL=http://localhost:4000/r vitest run"
63+ "test:dev" : " REGISTRY_URL=http://localhost:4000/r vitest run" ,
64+ "mcp:inspect" : " pnpm dlx @modelcontextprotocol/inspector node dist/index.js mcp"
6465 },
6566 "dependencies" : {
6667 "@antfu/ni" : " ^25.0.0" ,
7172 "@modelcontextprotocol/sdk" : " ^1.17.2" ,
7273 "commander" : " ^14.0.0" ,
7374 "cosmiconfig" : " ^9.0.0" ,
75+ "dedent" : " ^1.6.0" ,
7476 "deepmerge" : " ^4.3.1" ,
7577 "diff" : " ^8.0.2" ,
7678 "execa" : " ^9.6.0" ,
Original file line number Diff line number Diff line change 1+ import { server } from "@/src/mcp"
2+ import { handleError } from "@/src/utils/handle-error"
3+ import { logger } from "@/src/utils/logger"
4+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
5+ import { Command } from "commander"
6+
7+ export const mcp = new Command ( )
8+ . name ( "mcp" )
9+ . description ( "starts the registry MCP server" )
10+ . option (
11+ "-c, --cwd <cwd>" ,
12+ "the working directory. defaults to the current directory." ,
13+ process . cwd ( )
14+ )
15+ . action ( async ( ) => {
16+ try {
17+ const transport = new StdioServerTransport ( )
18+ await server . connect ( transport )
19+ } catch ( error ) {
20+ logger . break ( )
21+ handleError ( error )
22+ }
23+ } )
Original file line number Diff line number Diff line change 1- import { server } from "@/src/mcp"
2- import { handleError } from "@/src/utils/handle-error"
1+ import { highlighter } from "@/src/utils/highlighter"
32import { logger } from "@/src/utils/logger"
4- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
53import { Command } from "commander"
64
75export const mcp = new Command ( )
86 . name ( "registry:mcp" )
9- . description ( "starts the registry MCP server [EXPERIMENTAL ]" )
7+ . description ( "starts the registry MCP server [DEPRECATED ]" )
108 . option (
119 "-c, --cwd <cwd>" ,
1210 "the working directory. defaults to the current directory." ,
1311 process . cwd ( )
1412 )
1513 . action ( async ( ) => {
16- try {
17- const transport = new StdioServerTransport ( )
18- await server . connect ( transport )
19- } catch ( error ) {
20- logger . break ( )
21- handleError ( error )
22- }
14+ logger . warn (
15+ `The ${ highlighter . info (
16+ "shadcn registry:mcp"
17+ ) } command is deprecated. Use the ${ highlighter . info (
18+ "shadcn mcp"
19+ ) } command instead.`
20+ )
21+ logger . break ( )
2322 } )
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ const searchOptionsSchema = z.object({
2323
2424export const search = new Command ( )
2525 . name ( "search" )
26+ . alias ( "list" )
2627 . description ( "search items from registries" )
2728 . argument (
2829 "<registries...>" ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { build } from "@/src/commands/build"
44import { diff } from "@/src/commands/diff"
55import { info } from "@/src/commands/info"
66import { init } from "@/src/commands/init"
7+ import { mcp } from "@/src/commands/mcp"
78import { migrate } from "@/src/commands/migrate"
89import { build as registryBuild } from "@/src/commands/registry/build"
910import { mcp as registryMcp } from "@/src/commands/registry/mcp"
@@ -35,7 +36,7 @@ async function main() {
3536 . addCommand ( migrate )
3637 . addCommand ( info )
3738 . addCommand ( build )
38-
39+ . addCommand ( mcp )
3940 // Registry commands
4041 program . addCommand ( registryBuild ) . addCommand ( registryMcp )
4142
You can’t perform that action at this time.
0 commit comments