-
Notifications
You must be signed in to change notification settings - Fork 939
docs(mcp): add nuxt ui agent as a mcp tool #5476
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
base: v4
Are you sure you want to change the base?
Conversation
commit: |
|
|
||
| return streamText({ | ||
| // Remove the ask_nuxt_ui_agent tool to avoid infinite loops | ||
| delete tools['ask_nuxt_ui_agent'] |
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.
The ask_nuxt_ui_agent tool is being removed unconditionally, which prevents the main agent from ever accessing it. The deletion should only occur when handling non-streaming requests from the MCP agent itself.
View Details
π Patch Details
diff --git a/docs/server/api/search.ts b/docs/server/api/search.ts
index ab4607c7..4899a046 100644
--- a/docs/server/api/search.ts
+++ b/docs/server/api/search.ts
@@ -14,9 +14,6 @@ export default defineEventHandler(async (event) => {
})
const tools = await httpClient.tools()
- // Remove the ask_nuxt_ui_agent tool to avoid infinite loops
- delete tools['ask_nuxt_ui_agent']
-
const options = {
model: gateway('anthropic/claude-sonnet-4.5'),
maxOutputTokens: 10_000,
@@ -48,6 +45,9 @@ Guidelines:
// If not streaming, it's called from the MCP route as a tool.
if (stream === false) {
+ // Remove the ask_nuxt_ui_agent tool to avoid infinite loops
+ delete tools['ask_nuxt_ui_agent']
+
const { text } = await generateText({
...options,
tools
Analysis
ask_nuxt_ui_agent tool unconditionally removed, blocking main agent delegation
What fails: The main agent cannot delegate Nuxt UI queries to the specialized Nuxt UI agent because the ask_nuxt_ui_agent tool is unconditionally deleted before the streaming/non-streaming path check.
How to reproduce:
- Call
/api/searchendpoint with user query (defaultstream=true) - LLM attempts to use
ask_nuxt_ui_agenttool for Nuxt UI questions - Tool is unavailable in the tools object despite being registered in the MCP server
Result: Main agent cannot delegate - tool deletion on line 18 removes it before the streaming check, preventing streaming requests from accessing it. Tool is missing from both streaming (stream=true) and non-streaming (stream=false) paths when it should only be missing from non-streaming requests.
Expected: The tool deletion should only occur for non-streaming requests (stream=false) from the MCP agent itself. Streaming requests should have full access to all MCP tools including ask_nuxt_ui_agent to enable proper delegation. The tool prevents infinite loops only when the MCP agent calls back with stream=false.
Fix applied: Moved delete tools['ask_nuxt_ui_agent'] from line 18 (unconditional) into the if (stream === false) block (conditional), so the main agent retains tool access while MCP callbacks are protected from recursion.
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.
No, always remove this tool.
When using the MCP, the tool ask_nuxt_ui_agent is available. This tool will fetch /api/search that will connect to the MCP to get tools. In that case, the tool ask_nuxt_ui_agent must be removed.
|
I still think that a parser for the md content would be simpler to both manage and scale. Such as a tool that would request one or multiple docs pages, then extract specific sections like Tho this mostly comes from personal experience when we were on UI v3 and with the old Nuxt MCP which did not correctly stream responses, thus timing out. |
π Linked issue
β Type of change
π Description
Heyyyy π,
This introduce the Nuxt UI Agent as a MCP tool.
When asking an Agent a query like "How to install Nuxt UI in a Vue project", it will list all pages and then read the installation page. This will completely fill the context with a lot of useless content. By using an Agent as a tool, the main Agent will query the second (Nuxt UI Agent) with the user query (or an improved version) and then returned only the useful content.
At the end, I'm sure that most of the tool could be disabled (from a end-user point of view) except the Ask Nuxt UI Agent.
π Checklist