mirror of
https://github.com/nuxt/ui.git
synced 2026-09-14 19:51:10 +08:00
41e5a18f21
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
25 lines
687 B
TypeScript
25 lines
687 B
TypeScript
import { queryCollection } from '@nuxt/content/server'
|
|
|
|
export default defineMcpResource({
|
|
uri: 'resource://nuxt-ui/components',
|
|
description: 'Complete list of available Nuxt UI v4 components with metadata and categories',
|
|
cache: '1h',
|
|
async handler(uri: URL) {
|
|
const event = useEvent()
|
|
|
|
const components = await queryCollection(event, 'docs')
|
|
.where('path', 'LIKE', '%/components/%')
|
|
.where('extension', '=', 'md')
|
|
.select('path', 'title', 'description', 'category')
|
|
.all()
|
|
|
|
return {
|
|
contents: [{
|
|
uri: uri.toString(),
|
|
mimeType: 'application/json',
|
|
text: JSON.stringify(components, null, 2)
|
|
}]
|
|
}
|
|
}
|
|
})
|