Add --install CLI flag for MCP client auto-registration#54
Merged
danielealbano merged 11 commits intomainfrom Mar 12, 2026
Merged
Add --install CLI flag for MCP client auto-registration#54danielealbano merged 11 commits intomainfrom
danielealbano merged 11 commits intomainfrom
Conversation
Adds plan document covering: --install <target> CLI flag for auto-registering with 6 MCP clients (Claude Code, Claude Desktop, Cursor, VS Code, gemini-cli, Codex CLI), E2E testcontainers tests, and README restructure.
Implements the install module (src/install.rs) with support for 6 targets: claude-code, claude-desktop, cursor, vscode, codex, gemini-cli. Generates correct JSON (mcpServers/servers) or TOML (mcp_servers) config files per target, preserves existing config content, and creates parent directories. Includes comprehensive unit tests for all targets and edge cases.
Adds testcontainers dev-dependency, Dockerfiles for Claude Code, Cursor CLI, and gemini-cli test images, and E2E tests that verify generated configs are recognized by real CLI tools inside containers. Tests are #[ignore] and run via make test-e2e. Updates Makefile with test-e2e-build and test-e2e targets.
Replaces the single Claude Desktop config example with comprehensive documentation covering all 6 supported targets (Claude Code, Claude Desktop, Cursor, VS Code, gemini-cli, Codex CLI). Adds quick setup via --install flag, macOS/Windows binary paths. Updates PROJECT.md with new deps and CLI flag, ARCHITECTURE.md with install.rs and test infrastructure.
Fix mutability and temporary lifetime issues in test_install_e2e.rs. All quality gates pass: fmt, lint, test (84 unit + 80 integration), build. Mark all plan checkmarks as complete.
Cargo.lock updated with new dependency resolutions (dirs, toml, tempfile, testcontainers and their transitive dependencies). Source files reformatted by cargo fmt.
The InstallError enum exceeds clippy's 128-byte threshold on Windows due to platform-specific type sizes. Box the error in all function return types (resolve_config_path, install, install_json, install_toml) so the Result Err variant is pointer-sized. The ? operator auto-boxes via From<InstallError> for Box<InstallError>.
Adds a dedicated E2E Tests job on ubuntu-latest that builds the Docker test images (Claude Code, Cursor CLI, gemini-cli) and runs the ignored testcontainers tests. Integration tests already run in the existing build-and-test matrix via cargo test --all-features.
Remove #[ignore] from E2E tests and gate them behind a Cargo feature (e2e-tests) instead. The test file uses #![cfg(feature = "e2e-tests")] so it's not compiled unless the feature is enabled. CI regular tests use --features test-support, E2E job uses --features test-support,e2e-tests. Updates Makefile test-e2e target to match.
gemini-cli requires an auth method configured before it will list MCP servers. Setting GOOGLE_GENAI_USE_GCA=true as a container env var satisfies this requirement without needing a real API key.
…mages - gemini-cli requires auth to run `mcp list`; GOOGLE_GENAI_USE_GCA triggers an interactive OAuth flow. GEMINI_API_KEY=dummy satisfies the check without network access. - Add --load to docker build commands so images are available to the daemon when using buildx container drivers. - Pre-create /root/.gemini in the gemini-cli Dockerfile to avoid ENOENT on projects.json.
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
--install <target>CLI flag for auto-registering the MCP server with 6 clients: Claude Code, Claude Desktop, Cursor, VS Code, gemini-cli, and Codex CLImcpServers/servers) or TOML (mcp_servers) config files per target, preserves existing config content, creates parent directories--installsetup guidedocs/PROJECT.mdanddocs/ARCHITECTURE.mdwith new dependencies and moduleTest plan
make fmtpassesmake lintpasses (zero clippy warnings)make testpasses (84 unit tests + 80 integration tests)make buildpassesmake test-e2e— requires Docker and pre-built images (run manually)Plan:
docs/plans/3_cli_install_flag_mcp_client_config_20260312160258.md