You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NPM tools open a separate SSH connection just to log in #162
getNpmToken makes its own execSSH call to fetch a token, then each NPM tool makes a second call with it. certList makes three connections in sequence.
Where
mcp-server/src/utils/service-http.ts:185-196
mcp-server/src/tools/npmProxyHosts.ts:22-27
mcp-server/src/tools/npmCerts.ts:22-27
mcp-server/src/tools/certList.ts:25-29, :46-52
Details
execSSH opens a new ssh2 connection (TCP, key exchange, auth) per call, and no token is cached.
Impact
On a LAN Pi the handshake (about 150-400 ms) dominates a localhost curl, so npmProxyHosts and npmCerts take about twice as long as needed and certList about three times.
Suggested fix
Build one remote script that logs in and queries in the same session, exposed as npmGet(path, port, node) in service-http.ts, and use it from all three tools.
Acceptance criteria
Each NPM tool uses a single SSH round trip (certList: two at most)
How to run tests: cd mcp-server && npm install && npm test (and npm run typecheck); structure tests: pip install -r requirements-test.txt && pytest tests/ -v
Conventions: see CLAUDE.md and CONTRIBUTING.md
Filed by repo-audit/full-audit at 636fefb. Severity: low. Effort: S. audit-key: performance|mcp-server/src/utils/service-http.ts|getNpmToken
Fixed in 4d82568: new npmGet()/npmGetCommand() in service-http.ts logs in and queries in one remote script; npmProxyHosts and npmCerts use one SSH round trip, certList two; getNpmToken removed. Missing token -> exit 65 with a message naming the credentials; curl exit codes still map through curlErrorResponse. Verified with handler tests pinning the call counts and service-http tests that run the script in sh with a stubbed curl; build, typecheck, Vitest and structure tests pass.
Activity
TMHSDigital commentedon Nov 19, 2026
Fixed in 4d82568: new npmGet()/npmGetCommand() in service-http.ts logs in and queries in one remote script; npmProxyHosts and npmCerts use one SSH round trip, certList two; getNpmToken removed. Missing token -> exit 65 with a message naming the credentials; curl exit codes still map through curlErrorResponse. Verified with handler tests pinning the call counts and service-http tests that run the script in sh with a stubbed curl; build, typecheck, Vitest and structure tests pass.
fix: make shared tool parameters consistent (#166)