Skip to content

feat: show estimated context size for tool groups, products, and API users (#73) - #127

Merged
MarcusK00 merged 6 commits into
v18/devfrom
feat/tool-context-size-v18
Nov 18, 2026
Merged

MarcusK00 merged 6 commits into
v18/devfrom
feat/tool-context-size-v18

Conversation

@MarcusK00

@MarcusK00 MarcusK00 commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

What and why

Ports #126 (closes #73) to v18/dev, portraying context size visually with zero new buttons or text clutter:

  • MCP server (npm/): Measures the exact UTF-8 byte length of each tool as tools/list sends it (via useDraft202012ToolSchemas on an in-memory McpServer) and reports sizeBytes per tool plus sizeBytes, readOnlySizeBytes, and nonDestructiveSizeBytes per collection in POST /mcp/catalogue. get-mcp-health reports sizeBytes per product and adds a Largest tool groups note.
  • .NET add-on (src/Umbraco.Mcp/): Stores nullable size fields on McpCollectionInfo and McpToolInfo (deriving/clamping in McpToolSettingsValidation and merging in McpCatalogueFallback), computes McpToolCounts.EffectiveSizeBytes (respecting groups, access levels, and per-tool exclusions), and exposes sizeBytes on McpOverviewAccess and McpOverviewApiUser.
  • Dashboard (src/Umbraco.Mcp/wwwroot/App_Plugins/Umbrella/):
    • Keeps the Overview access table, Tool Permissions product tabs, group row text, and individual tool rows untouched (zero new buttons or extra numbers).
    • Turns the existing product meter bar in umbrella-product-card.js into a segmented footprint bar (top 4 largest active groups + muted tail, sized proportionally by bytes): hovering shows Group · % (~Xk tokens), and clicking any slice jumps straight to that group.
    • Adds a subtle 2px proportional hairline bar along the bottom edge of each group row (color-matched to the top 4 meter segments, dimmed when off) so heavy groups stand out immediately while scanning, with exact token/KB details in native hover tooltips.
    • Shows clean ~Xk tokens figures in the Overview API user Info modal.
    • Pure segment and token formatting helpers live in umbrella-tool-size.js.

Breaking change?

No

Checklist

  • If npm dependencies, a module, npm/src/core/ or the capabilities/catalogue handling changed: scripts/e2e.sh and scripts/pack-check.sh passed against the running demo site.
  • If a detector id, the capabilities payload or the tool-settings/catalogue shapes changed: both the C# and the npm side are updated (cross-language contract in CLAUDE.md).
  • If behaviour or configuration changed: README.md, npm/README.md, src/Umbraco.Mcp/README.md, docs/architecture.md (and docs/architecture-map.html) and CLAUDE.md are updated, with dates as DD-MM-YYYY. (Updated CLAUDE.md and docs/architecture.md.)
  • If a product package version changed: npm ls @umbraco-cms/mcp-server-sdk shows one deduped copy locally. (n/a — no package versions changed)

@MarcusK00 MarcusK00 added enhancement New feature or request area: add-on NuGet package: detection, capabilities endpoint, health checks area: dashboard Umbrella dashboard: Overview, Tool Permissions area: npm server umbrella-mcp: startup, filters, tool names, get-mcp-health v18 labels Nov 18, 2026
@MarcusK00
MarcusK00 merged commit 1c292da into v18/dev Nov 18, 2026
4 checks passed
@MarcusK00
MarcusK00 deleted the feat/tool-context-size-v18 branch November 18, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: add-on NuGet package: detection, capabilities endpoint, health checks area: dashboard Umbrella dashboard: Overview, Tool Permissions area: npm server umbrella-mcp: startup, filters, tool names, get-mcp-health enhancement New feature or request v18

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant