feat(config-audit): MCP tool-count detection with manifest fallback (v5 M1) [skip-docs]
readActiveMcpServers now resolves tool count via:
1. In-config tools array
2. Cached tools/list at \$HOME/.claude/config-audit/mcp-cache/<name>.json
3. node_modules/<pkg>/package.json (resolved from npx <pkg>)
4. Fallback: { toolCount: null, toolCountUnknown: true }
estimateTokens uses detected toolCount (heavy server > light server).
New fixture: mcp-tool-heavy/ with mocked node_modules/mcp-heavy/package.json (20 tools).
576 → 580 tests, all green.
This commit is contained in:
parent
9a44df22ac
commit
1422daf895
3 changed files with 148 additions and 7 deletions
6
plugins/config-audit/tests/fixtures/mcp-tool-heavy/.mcp.json
vendored
Normal file
6
plugins/config-audit/tests/fixtures/mcp-tool-heavy/.mcp.json
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"mcpServers": {
|
||||
"heavy": { "command": "npx", "args": ["mcp-heavy"] },
|
||||
"light": { "command": "npx", "args": ["mcp-light"] }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue