Skip to content

Support overriding the MCP server name in config - #49

Open
pete-woods wants to merge 1 commit into
njayp:mainfrom
pete-woods:server-name
Open

Support overriding the MCP server name in config#49
pete-woods wants to merge 1 commit into
njayp:mainfrom
pete-woods:server-name

Conversation

@pete-woods

@pete-woods pete-woods commented Jul 20, 2026

Copy link
Copy Markdown

What does this PR do?

Adds support to set the default server name for your app in config.

It means we'll be able to revert this PR CircleCI-Public/circleci-cli#1631 :)

Checklist

  • Tests added or updated
  • Docs added or updated

Comment thread internal/cfgmgr/cmd/claude/root.go Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review: Support overriding the MCP server name in config

Nicely scoped change — the flag → config → executable precedence is implemented consistently across all three editors, and the test coverage is strong (golden files for help/usage output plus behavioral tests for all three resolution branches). Docs and the ServerNameUsage helper are a good touch.

One design issue

ServerName is wired into enable but not disable, which breaks the enable→disable round-trip.

With Config.ServerName = "my-cli":

  • enable writes a server entry named my-cli.
  • disable (without --server-name) still derives the name from the executable, doesn't match my-cli, and silently no-ops (⚠️ MCP server "my-cli" does not exist) — leaving the stale entry behind.

Before this PR both commands derived from the executable, so the round-trip was symmetric. Now anyone using the new config must remember to pass --server-name to disable. Recommend threading serverName into disableCommand too (same precedence), across claude/vscode/cursor. Inline comment left on claude/root.go:21.

If leaving disable out is intentional for this PR, a note in the Config.ServerName doc comment (and the ServerName docs section) that disable isn't covered would save users the surprise.

Looks good

  • Precedence logic in each enable.go run is correct and readable.
  • ServerNameUsage correctly reflects the configured default in --help.
  • Build and go test ./test/ pass locally.

Happy to approve once the enable/disable asymmetry is addressed or explicitly documented as out of scope.

@pete-woods

pete-woods commented Jul 23, 2026

Copy link
Copy Markdown
Author

Happy to approve once the enable/disable asymmetry is addressed or explicitly documented as out of scope.

I don't know how I missed that, PR updated!

Comment thread internal/cfgmgr/cmd/claude/enable.go Outdated
- Add some golden tests for the help / usage text, as they are affected by this change.
@pete-woods

Copy link
Copy Markdown
Author

Okay, have updated the PR again, addressing that feedback

@pete-woods

Copy link
Copy Markdown
Author

Hi @njayp - is there anything else I need to change about this PR? Thanks

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.

2 participants