Repository navigation
MCP: cloudpin_doctor, a read-only cloudpin doctor --json (#112, part 1) - #138
Merged
Merged
Conversation
A third MCP tool returns what `cloudpin doctor --json` returns for the project folder (optional cwd, like the other tools), so an agent can say why a hook isn't guarding: missing or out-of-date hooks, and on Windows the execution-policy and PATH warnings. Account IDs stay shortened, as doctorJson does. The terminal doctor checks the identity cache by creating the cache folder and a probe file in it. That probe moves to src/paths.ts (probeWritable) and the MCP tool never calls it: it hands doctor a stub that writes nothing, and reports the cache check as "not checked" (#15: no MCP tool changes anything). With CLOUDPIN_NO_CACHE=1 the check needs no write and stays as it was. Tests in test/mcp-doctor.test.ts run against a real temporary folder: listed with its schema, same JSON as doctor, IDs shortened, a missing and an out-of-date hook, a bad cwd, and a folder listing that must not change, with a control showing the terminal probe does change it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README's MCP paragraph still says two tools: README is over the size limit on main, so it is updated on the release branch instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/mcp.md # src/cli.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
paureis
marked this pull request as ready for review
November 2, 2026 18:07
paureis
added a commit
that referenced
this pull request
Nov 2, 2026
paureis
added a commit
that referenced
this pull request
Nov 2, 2026
* Test: explain and the MCP check tool hide credential values (#134) Every credential form block messages already hide (--token, --password, --kube-token, Vercel's -t VALUE, -t=VALUE, -tVALUE and -dt VALUE) is checked in explain's text output, its --json and the MCP cloudpin_check result. Controls: other words stay as typed, the --json argv keeps its length and positions, and the verdict still comes from the real token. Fails until explain masks the words it repeats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Explain: mask credential values in the command it repeats (#134) cloudpin explain (text and --json) and the MCP cloudpin_check tool repeated a command's words unmasked, so a --token value reached the terminal or the agent transcript. The word-level masking behind block and confirmation messages (#123) is now maskArgv in src/format.ts, and explain uses it when it builds each call, after the guard has decided on the real words. The --json argv array keeps its length and positions; only the values change to ***. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test: explain-secrets gives the MCP tools a doctor host (#134, #112) cloudpin_doctor (#138) made ToolContext.doctor required; this test builds the tools without it, which typecheck rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * CHANGELOG and ROADMAP: explain masks credentials (#134) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #112 (the
cloudpin_doctorhalf).cloudpin_switch_planfollows once #14 (#102) merges. Draft until the v1.2.0 tag; the CHANGELOG, ROADMAP and README lines get added then. README's MCP section still says "two tools", but README is over the size cap on main, and the raised limit is in release PR #132.cloudpin_doctorreturnscloudpin doctor --jsonfor a project folder (optionalcwd, like the other tools), so an agent can say why the hook isn't guarding. Account IDs come back shortened, as indoctorJson.Read-only. Doctor had one write: the cache-folder probe (
writableinsrc/cli.ts, nowprobeWritableinsrc/paths.ts), which creates the cache folder and a probe file. The MCP tool gives doctor a stub that writes nothing, and the cache check then reads "not checked", pointing atcloudpin doctorin a terminal. Everything else doctor runs only reads.Checks
test/mcp-doctor.test.ts(new, 10 tests): before the code existed, 9 failed.npm run typecheck: exit 0.npm test: 1277 passed, 8 skipped.initialize,tools/list,tools/call cloudpin_doctor): three tools, allreadOnlyHint; the result matches its structured content; the folder is unchanged afterwards.🤖 Generated with Claude Code