-
Notifications
You must be signed in to change notification settings - Fork 968
docs(mcp): use @nuxtjs/mcp-toolkit
#5548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9afe5bd
2abe56b
5ff50f5
a9cf1f1
96c698d
14f06e5
7289831
7a6c42e
4a1f1ea
ba28103
7b9404a
b243742
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { z } from 'zod' | ||
| import { queryCollection } from '@nuxt/content/server' | ||
|
|
||
| export default defineMcpPrompt({ | ||
| description: 'Find the best Nuxt UI component for a specific use case', | ||
| inputSchema: { | ||
| usecase: z.string().describe('Describe what you want to build (e.g., "user login form", "data table", "navigation menu")') | ||
| }, | ||
| async handler({ usecase }) { | ||
| const event = useEvent() | ||
|
|
||
| const components = await queryCollection(event, 'docs') | ||
| .where('path', 'LIKE', '%/components/%') | ||
| .where('extension', '=', 'md') | ||
| .select('path', 'title', 'description', 'category') | ||
| .all() | ||
|
|
||
| return { | ||
| messages: [ | ||
| { | ||
| role: 'user' as const, | ||
| content: { | ||
| type: 'text' as const, | ||
| text: `Help me find the best Nuxt UI component for this use case: "${usecase}". Here are all available components: ${JSON.stringify(components, null, 2)}` | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| }) |
Uh oh!
There was an error while loading. Please reload this page.