Skip to content

feat: add mcpd config volumes list command#249

Merged
peteski22 merged 2 commits intomainfrom
feature/config-volumes-list
Mar 3, 2026
Merged

feat: add mcpd config volumes list command#249
peteski22 merged 2 commits intomainfrom
feature/config-volumes-list

Conversation

@peteski22
Copy link
Contributor

@peteski22 peteski22 commented Feb 27, 2026

Summary

  • Add mcpd config volumes list <server-name> command to list all user-supplied volume mappings for a given MCP server
  • Follows the same patterns as the existing volumes set command (options pattern, cobra.ExactArgs, OutOrStdout(), sorted output)
  • Uses flags.RuntimeFile dynamically in help text so users see their actual configured path

Test plan

  • Unit tests for happy path (single volume, multiple sorted, empty, nil)
  • Unit tests for error paths (server not found, loader error, validation)
  • All existing tests pass (make test)
  • Linter clean (golangci-lint run --fix -v ./cmd/config/volumes/...)

Closes #198

Summary by CodeRabbit

  • New Features

    • Added a list sub-command to display volume mappings for a specified server. Shows configured volumes in a formatted list, with appropriate messaging for servers without volumes.
  • Tests

    • Added comprehensive test coverage for the volumes list command, including volume retrieval, error handling, and argument validation scenarios.

Allow users to list all configured volume mappings for a given MCP
server from the runtime context configuration file.

Closes #198
@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 557fc34 and ebbebf3.

📒 Files selected for processing (3)
  • cmd/config/volumes/cmd.go
  • cmd/config/volumes/list.go
  • cmd/config/volumes/list_test.go

Walkthrough

Implements a new "list" sub-command for the volumes CLI to display volume mappings for a specified MCP server. The command reads runtime configuration, validates server existence, and outputs volumes in a sorted, formatted manner. Sub-command registration order has been adjusted.

Changes

Cohort / File(s) Summary
Command Registration
cmd/config/volumes/cmd.go
Reorders sub-command constructor registration slice to place NewListCmd before NewSetCmd, establishing the initialisation sequence for CLI sub-commands.
List Command Implementation
cmd/config/volumes/list.go
Introduces listCmd type and NewListCmd constructor that creates a Cobra command to list volume mappings for a specified MCP server. Loads runtime configuration, validates server existence, and outputs sorted volumes with appropriate formatting and error handling.
List Command Tests
cmd/config/volumes/list_test.go
Adds comprehensive test suite covering command creation, volume listing scenarios (single, multiple, none), argument validation, server not-found errors, and loader error propagation.

Possibly related PRs

Suggested reviewers

  • agpituk
  • dpoulopoulos
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a new 'list' sub-command for the volumes CLI, which is the primary objective of this PR.
Linked Issues check ✅ Passed The PR fully implements the requested feature from issue #198: a new 'mcpd config volumes list ' command that lists volume mappings, with comprehensive tests and error handling.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the volumes list command and its tests; no unrelated modifications to other features or systems are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/config-volumes-list

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@peteski22 peteski22 requested a review from javiermtorres March 2, 2026 20:21
Copy link

@javiermtorres javiermtorres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion, otherwise lgtm


out := cobraCmd.OutOrStdout()

if _, err := fmt.Fprintf(out, "Volumes for '%s':\n", serverName); err != nil {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to use string consts here and reuse them in the tests to avoid false positives, unless we want to verify the string contents themselves.

@peteski22 peteski22 merged commit ba86830 into main Mar 3, 2026
3 checks passed
@peteski22 peteski22 deleted the feature/config-volumes-list branch March 3, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcpd config volumes list

2 participants