feat(mcp): add config command reporting resolved configuration provenance#335
Open
glorydavid03023 wants to merge 2 commits into
Open
feat(mcp): add config command reporting resolved configuration provenance#335glorydavid03023 wants to merge 2 commits into
glorydavid03023 wants to merge 2 commits into
Conversation
…ance Add a `config` command to the gittensory-mcp CLI that prints the resolved effective configuration and the source that supplied each value (environment, profile, config file, or default): the active API URL and its source, the active profile and profile count, whether a config file is present and which environment variable steers its location, the cache-dir source, whether a token is configured and where it came from, and the source-upload posture. This fills a real diagnostic gap. `status` reports health and version, `doctor` runs checks, and `whoami` shows session identity, but none of them answer "what configuration is actually in effect and which source supplied it?" — the common question when an API URL or profile is not picked up as expected. Output prints provenance labels only: it never includes token values or local absolute paths, preserving the CLI's redaction invariant. A `--json` form is provided for tooling. Tests cover default resolution, environment overrides (with token/path non-leak assertions), named-profile resolution from the config file, and a global config file reached through a config-path override. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
JSONbored
requested changes
Jun 3, 2026
Owner
JSONbored
left a comment
There was a problem hiding this comment.
@glorydavid03023 this is a useful MCP diagnostic command, but it needs validation evidence before merge.
A few notes:
- Showing config provenance without printing token values or local paths is the right behavior.
- The
--jsonshape is useful for tooling. - The blocker is validation evidence, not the command idea.
Required changes:
- Run the relevant MCP gate locally or clearly state any environment blocker with exact skipped checks.
- Keep the token/path redaction assertions in the tests.
- Make sure README output examples match the final command output.
Validation expected:
npm run build:mcpnpm run test:mcp-packnpm run typecheck- Focused
test/unit/mcp-cli.test.ts
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.
Summary
Adds a
configcommand to thegittensory-mcpCLI that prints the resolved effective configuration and where each value came from:Each value is attributed to its source —
environment,profile,config(file), ordefault.Why this is useful (and not a duplicate of existing commands)
This fills a real diagnostic gap.
statusreports health/version,doctorruns check-style diagnostics, andwhoamishows session identity — but none answer the common question "what configuration is actually in effect, and which source supplied it?" That question comes up whenever an API URL, profile, or config-file location is not being picked up as expected (env vs profile vs global config vs default).configmakes that resolution explicit in one place.Why no linked issue
Additive, low-risk CLI ergonomics only. No public-behavior, auth/session, schema, deploy, or frontend-architecture change, so per CONTRIBUTING this does not require an issue first. Happy to file one if maintainers prefer.
Privacy
Output prints provenance labels only — never token values or local absolute paths — preserving the CLI's existing redaction invariant. A test asserts that neither a configured token nor the config directory path appears in output.
Changes
packages/gittensory-mcp/bin/gittensory-mcp.js—configdispatch inrunCli,configCommand()withresolvedApiUrlSource()/resolvedConfigPathSource()/resolvedTokenSource()helpers, and a help-text usage line.test/unit/mcp-cli.test.ts— cover default resolution, environment overrides (with token/path non-leak assertions), named-profile resolution from the config file, and a global config file reached through a config-path override.packages/gittensory-mcp/README.md— document the command, its sources, and the--jsonform.Contract notes
No MCP tool or HTTP/OpenAPI contract changes. Adds a local CLI command surface only; the
--jsonpayload is additive and parseable.Validation
Intended gate (CONTRIBUTING required checks):
Transparency note: my local authoring environment had no Node runtime available, so I could not execute the gate locally before opening this PR. The change was prepared against the existing CLI dispatch/config-resolution/test patterns and is intended to be validated by CI on this PR (I will also run the full gate locally). I aimed for thorough branch coverage of the new provenance helpers; if any check needs adjustment I'll follow up promptly.
Security / privacy
No auth, cookie, CORS, GitHub App output, identity, or contributor-evidence changes. The command exposes only provenance labels, the public API URL, and the user's own profile state — no tokens, local paths, wallet/hotkey, or scoring context.