Skip to content

Align api cli, and mcp#278

Merged
codingcyclist merged 2 commits into
developfrom
fix/align-api-cli-mcp
May 14, 2026
Merged

Align api cli, and mcp#278
codingcyclist merged 2 commits into
developfrom
fix/align-api-cli-mcp

Conversation

@codingcyclist
Copy link
Copy Markdown
Contributor

@codingcyclist codingcyclist commented May 13, 2026

Context:

The API scopes apps, catalogs and secrets to environments, and the CLI tower deploy command already supports --environment / -e (defaulting to "default"). However:

  1. CLI tower apps list — has no --environment flag; always passes environment: None to the API
  2. MCP tower_deploy — hardcodes "default" environment with no way for the caller to specify one
  3. MCP tower_apps_list — has no environment parameter at all
  4. MCP tower_run_remote — hardcodes let env = "default" with no way to override
  5. MCP has not catalog list / show support

Specifically, the shortcomings on the MCP don't allow for critical use cases (deploy apps to specific environments, run apps in specific environments, etc.)

Note: The secrets MCP tools (tower_secrets_list, tower_secrets_create, tower_secrets_delete) already correctly handle environments. There are no
catalog MCP tools currently, and the CLI catalogs list already supports --environment.

The desired behavior:

  1. all list/show/run commands support an optional --environment flag
  2. all list/show/run commands default to None (i.e. all environments) environment unless overridden.
  3. MCP exposes same catalog discovery tools as CLI

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 195c7cc5-46f1-4564-ad88-142b81aa9703

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/align-api-cli-mcp

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

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ WARNING: This PR targets main instead of develop

This PR is targeting main which will trigger a production deployment when merged.

If this is a regular feature/fix PR, please change the base branch to develop.
If this is intentional (e.g., hotfix), you can ignore this warning.

Current base: main
Recommended base: develop

@codingcyclist codingcyclist changed the title Fix/align api cli mcp Align api cli, and mcp May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ WARNING: This PR targets main instead of develop

This PR is targeting main which will trigger a production deployment when merged.

If this is a regular feature/fix PR, please change the base branch to develop.
If this is intentional (e.g., hotfix), you can ignore this warning.

Current base: main
Recommended base: develop

The Tower API scopes apps to environments but the CLI and MCP tools
were not fully exposing this. This commit:

- Adds --environment/-e flag to `tower apps list` and `tower apps show`
  (defaulting to "default")
- Adds environment parameter to MCP tools: tower_deploy, tower_apps_list,
  tower_apps_show, and tower_run_remote
- Adds new MCP tools: tower_catalogs_list and tower_catalogs_show
- Includes CLI arg parsing tests for the new flags

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ WARNING: This PR targets main instead of develop

This PR is targeting main which will trigger a production deployment when merged.

If this is a regular feature/fix PR, please change the base branch to develop.
If this is intentional (e.g., hotfix), you can ignore this warning.

Current base: main
Recommended base: develop

@codingcyclist codingcyclist changed the base branch from main to develop May 13, 2026 21:19
The API returns all apps when environment is omitted, and only filters
when explicitly provided. Updated list_apps to take Option<&str> so
the default behavior shows all apps across environments. The environment
param is still available for explicit filtering. Also added version
field to MCP apps list output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codingcyclist codingcyclist marked this pull request as ready for review May 13, 2026 21:37
@codingcyclist codingcyclist requested a review from bradhe May 13, 2026 21:37
Copy link
Copy Markdown
Contributor

@bradhe bradhe left a comment

Choose a reason for hiding this comment

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

Generally looks good to me!

Comment thread crates/tower-cmd/src/api.rs
@codingcyclist codingcyclist merged commit 4deb0e4 into develop May 14, 2026
30 checks passed
@codingcyclist codingcyclist deleted the fix/align-api-cli-mcp branch May 14, 2026 07:14
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