-
Notifications
You must be signed in to change notification settings - Fork 908
docs(mcp): add server #4878
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
docs(mcp): add server #4878
Conversation
fda8bbb
to
60ef334
Compare
60ef334
to
9838dbd
Compare
I'm currently having issues getting the correct types on the v4 alpha branch, it's not using the correct type for the Nuxt Content queryCollection. It seems like the fix it to add the newer "references": [
{
"path": "./.nuxt/tsconfig.app.json"
},
{
"path": "./.nuxt/tsconfig.server.json"
},
{
"path": "./.nuxt/tsconfig.shared.json"
},
{
"path": "./.nuxt/tsconfig.node.json"
}
],
// https://nuxt.com/docs/guide/concepts/typescript
"files": [] I've currently marked areas where the code is correct with: |
commit: |
@JosephAnson Hi Joseph, sorry I haven't had time to look at the PR in detail yet but from what little I've seen it looks really good! The focus right now is on releasing v4 of |
Great news, sounds good to me, thanks @HugoRCD. For now I'll keep using it locally unless it's possible to have a test url related to this PR? I'll keep testing and making tweaks if anything can be improved. |
Do you have good local results? |
Locally it's working well, it's not necessary for a deployed dev url for it work, however it would save me running the dev server each time haha. Just trying to be lazy with it. Only problem I could see is you'll need to run the same version of Nuxt UI for it work correctly, as it'll always suggest the changes of the version it's deployed with. |
I was talking more about the quality of the ia's responses and whether there are still many hallucinations with it or not! |
It's working great tbh, code refactors have been much better. Before generally it would try to use old versions of the components, wouldn't understand which v-models to bind, now it's checking directly. With the component meta lookup it's been pretty great, my initial plan was something external but haven't that additional info seems invaluable. Additionally things like having upgrading to v4 for you automatically will work well once the migration guide is populated correctly, as there's a tool for that using the markdown helper used for the /raw endpoint. I've attached some demo screenshots to the pr description for reference. |
docs/server/api/list-examples.get.ts
Outdated
@@ -0,0 +1,11 @@ | |||
import { appendHeader, defineEventHandler } from 'h3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this route not in the mcp/
directory? π€
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure where to put it as /api/component-example was already outside and /api/list-examples is a match with that endpoint. Maybe /list-component-examples or /component-examples would've been a better name also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but this list-examples
endpoint is only used inside the mcp
right? π€
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's true, it's only used by the mcp, I was caught in two minds, I wasn't sure what you'd prefer. We can move it inside the mcp folder.
I'd like to drop the |
@JosephAnson Even better without the |
Tbh I'm not sure, it seems like what you've made should work provided that the embeddings are in the db, you can add the mcp tools to the |
Sorry for a last minute change, added a new tool called |
β¦hs for the get_documentation_page tool
60c8133
to
9d8ff77
Compare
Sure! Let me know when you think this is ready π Doesn't this make the |
I think it's ready now, at least enough to move ahead with as v1. That's a good point, I think it still serves a purpose as it's a direct access for a certain use case, same as the |
No we can keep it I was just wondering, maybe what we're missing is a |
Yeah that's not a bad idea to add another tool for that, generally it's recommended to keep it as atomic as possible. So I think it's not a bad idea. I can also add it as a resource as well. |
f118d2c
to
a596fb7
Compare
Ok I think we're all good to go, unless you see some issues that need fixing i'm happy to consider it ready. Only issue I could see is currently |
β¦ tools to also synergize with the `get_documentation_page`
Regarding the |
Thanks again @JosephAnson for the awesome work π |
Somehow I completely missed this PR π Just wanted to leave a couple of notes I've discovered while building MCP servers with various models, might come handy in future iterations:
I've solved the first one by creating detailed instructions (based on the project) and a small parser of the UI docs to extract relevant information (using the usage, examples, api and theme chapters we have in all components pages) and informing the LLM that it can in a single tool request get one or multiple chapters for one or multiple components. Here is an example of the tool I regularly use (both name, description and descriptions in the jsonSchema are equally important to let the LLM understand what to bet and what to expect), while here is the Nuxt UI doc parser to extract only relevant part (either by letting the LLM decide or directly asking to include/exclude something) While for AI search it is something that I've stopped testing for now, as I did reach most of what I was looking for via MCP tools. I'm starting to think that a vector search is not that much useful in a docs website, or at least not when you have to factor in that most of the meaning (based on vector size) might be constructed from common symbols and common css classes throughout the documentation. But I might just be wrong. |
@JosephAnson Do you have any links to your socials to share with us for the server release post? |
Not sure which one you'd like to share, you can pick what you prefer: Github: https://github.com/JosephAnson |
π Linked issue
Resolves #4841
β Type of change
π Description
This PR implements a comprehensive MCP server that to provide some useful tools, prompts and resources for the Nuxt UI.
Inspiration & Setup:
New Features:
Added:
/server/api/mcp/
/server/routes/mcp/[transport].ts
Note: The implementation currently requires a
redisUrl
configuration to function properly. Vercel team assistance may be needed for proper Redis setup in the deployment environment.Testing
I recommend if you want to test it locally to use: https://github.com/modelcontextprotocol/inspector
Demo
As you can see you can query it to help with adding components, here the ai queries the old version of the component FormGroup (v2) from memory but then corrects itself by querying the mcp server. It's then able to see how it works quickly and provide examples for usage, resulting in a correct refactor.
π Checklist