Fix MCP tools list overflow#2210
Conversation
SummaryReading Code referenceThe core paginate-then-render path at function _renderMcpTools(tools, query){
const list=$('mcpToolList');
const toolbar=$('mcpToolToolbar');
if(!list) return;
const filtered=_filterMcpToolsForSearch(tools, query);
const total=Array.isArray(tools)?tools.length:0;
const pages=Math.max(1,Math.ceil(filtered.length/_mcpToolsPageSize));
_mcpToolsPage=Math.min(Math.max(1,_mcpToolsPage||1),pages);
if(toolbar) toolbar.innerHTML=`<span class="mcp-tool-summary">${esc(_mcpToolsSummary(total,filtered.length,_mcpToolsPage,pages,query))}</span>${_mcpToolPageSizeControl()}`;
_renderMcpToolPager(filtered.length,_mcpToolsPage,pages);
...
const visible=filtered.slice((_mcpToolsPage-1)*_mcpToolsPageSize,_mcpToolsPage*_mcpToolsPageSize);
list.innerHTML=visible.map(tool=>{ ... }).join('');
}and the inactive-server hint surfaced via the existing API field at function _mcpToolsEmptyMessage(query){
const base=esc(t(query?'mcp_tools_no_matches':'mcp_tools_no_tools'));
const unavailable=Array.isArray(_mcpToolsMeta.unavailable_servers)?_mcpToolsMeta.unavailable_servers:[];
if(query||!unavailable.length) return base;
return `${base}<br><span class="mcp-tool-empty-detail">${esc(t('mcp_tools_inactive_configured_servers',unavailable.join(', ')))}</span>`;
}Diagnosis / RecommendationThis is good work — the change is bounded, the new i18n keys (14 of them, all listed in A few small notes for follow-up (none blocking):
Test plan / verificationThe new test file pins eight invariants — index.html mounts, paginate-not-flat rendering, page-size selector contract, search-resets-to-page-1, the inactive-servers hint surface, CSS for the bounded scroll region and pager chrome, the i18n key set, and the CHANGELOG mention. That is enough JS-as-source coverage for a static asset, given the project's convention. Manual checks I would run before merge:
|
|
Pushed f7c50b8 to cover the two small follow-ups worth folding into this PR: the MCP Tools page-size selector now persists across reloads, and the public page setter clamps invalid input before rendering. Updated the PR body/verification; CI is green on 3.11, 3.12, and 3.13. |
|
Shipped to master via stage-351 → v0.51.58. All four substantive changes from this PR (toolbar, pagination, search-with-page-reset, bounded scroll area) are live on master. Why this PR auto-close didn't fire: the rebased-PR-auto-close gotcha — your contributor branch was rebased against an older origin/master than the stage HEAD when it merged, so GitHub's "branch SHA matches stage merge" check didn't trigger. PR contents are 100% in master either way. Thanks for the clean, well-scoped fix! Closing manually. |
Fix MCP tools list overflow with pagination/search (Jordan-SkyLF)
Thinking Path
hermes-agentchanges.What Changed
CHANGELOG.md.Why It Matters
Large MCP setups can expose dozens of tools. Without bounding/pagination, Settings → System becomes dominated by the tool list and adjacent settings are pushed far down the page. This keeps the inventory useful while preserving the settings panel layout and avoiding any new MCP runtime side effects.
Before / After
Before: a synthetic 95-tool runtime inventory rendered as one unbounded list, with no result summary or pager.
After: the same 95-tool inventory renders as a bounded list with a 5-row default page, summary text, remembered page-size control, and pager.
Verification
origin/masterfetched before publish:6aedb7e0cd9879f308b063f84a3c87d86d903230v0.51.57origin/master.hermes-agentrepo changes, no new WebUI dependency, no new agent-side API contract.node --check static/panels.js && node --check static/i18n.jspython -m pytest tests/test_mcp_tools_list_overflow.py tests/test_issue697_mcp_tool_inventory.py tests/test_chinese_locale.py tests/test_japanese_locale.py tests/test_korean_locale.py tests/test_russian_locale.py tests/test_spanish_locale.py -q42 passed in 3.91spython -m pytest tests/ -q5438 passed, 43 skipped, 1 xfailed, 2 xpassed, 8 subtests passed, plus one unrelated/order-dependent failure intests/test_issue1499_keyless_onboarding.py::TestKeylessChatReady::test_lmstudio_keyless_chat_ready_via_full_status1 passed in 3.00sShowing 1-5 of 95 MCP tools. Page 1 of 19.with 5 visible rows, bounded list overflow, working next/page-size controls, persisted page-size preference, search reset to page 1, and no-match empty state.Risks / Follow-ups
Model Used
gpt-5.5via Hermes Agent, with terminal, file, browser, vision, GitHub CLI, and delegated code-review/tooling support.