ui icon indicating copy to clipboard operation
ui copied to clipboard

feat(mcp): add options to fetch only sections of docs to save tokens

Open BerzinsU opened this issue 1 month ago โ€ข 2 comments

โ“ Type of change

  • [x] ๐Ÿ“– Documentation (updates to the documentation or readme)
  • [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • [x] ๐Ÿ‘Œ Enhancement (improving an existing functionality)
  • [x] โœจ New feature (a non-breaking change that adds functionality)
  • [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

Added additional tools to MCP, so it can retrieve only sections for components, like, theme, or slots.

  • list_component_sections - lists available sections for a component
  • get_component_sections - fetches only specified sections
  • Enhanced get_component with optional sections parameter

I'm in a middle of a large migration and tried to connect MCP server to help me out with it, but it fetches whole docs for components, when it actually needs to learn the new slot names, or how themes structure has changed for specific components. For example, fetching table docs alone throws warnings about token count.

Claude says it could save him 70-90% of tokens. :sweat_smile:

๐Ÿ“ Checklist

  • [ ] I have linked an issue or discussion.
  • [x] I have updated the documentation accordingly.

BerzinsU avatar Nov 04 '25 20:11 BerzinsU

npm i https://pkg.pr.new/@nuxt/ui@5386

commit: bc06052

pkg-pr-new[bot] avatar Nov 04 '25 20:11 pkg-pr-new[bot]

@BerzinsU I totally agree that some components are extremely long and probably overload the context of some models. However, I don't think the solution is to add more tools, but rather to modify and improve the existing ones. I'll try to investigate this!

HugoRCD avatar Nov 04 '25 23:11 HugoRCD