You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Add Comprehensive AI Agent Friendly CLI Support (#221)
* feat: add comprehensive AI agent friendly CLI support
This commit implements comprehensive non-interactive CLI support for AI agents across all major MCPM commands:
**Server Management (mcpm new, mcpm edit):**
- Non-interactive server creation with --type, --command, --args, --env, --url, --headers
- Field-specific server editing with CLI parameters
- Environment variable support for automation
**Profile Management (mcpm profile edit, mcpm profile inspect):**
- Server management via --add-server, --remove-server, --set-servers
- Profile renaming with --name parameter
- Enhanced inspect with --port, --host, --http, --sse options
**Client Management (mcpm client edit):**
- Server and profile management for MCP clients
- Support for --add-server, --remove-server, --set-servers
- Profile operations with --add-profile, --remove-profile, --set-profiles
**Infrastructure:**
- New non-interactive utilities in src/mcpm/utils/non_interactive.py
- Environment variable detection (MCPM_NON_INTERACTIVE, MCPM_FORCE)
- Parameter parsing and validation utilities
- Server configuration creation and merging
**Documentation and Automation:**
- Automatic llm.txt generation for AI agents
- GitHub Actions workflow for continuous documentation updates
- Developer tools for local llm.txt generation
- Comprehensive AI agent integration guide
**Key Benefits:**
- Complete automation support with no interactive prompts
- Environment variable configuration for sensitive data
- Batch operations and structured error handling
- 100% backward compatibility with existing interactive workflows
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* refactor: simplify CLI help text to remove redundant information
- Streamlined docstrings for new, edit, profile edit, profile inspect, and client edit
- Removed verbose examples that duplicated parameter descriptions
- Focused on concise, essential information in help output
- Regenerated llm.txt with cleaner documentation (23KB vs 27KB)
- Improved user experience with less cluttered help screens
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: resolve linting errors and test failures after AI-agent CLI updates
- Fix unused variable in generate_llm_txt.py
- Clean up whitespace in docstrings throughout non_interactive.py
- Fix edit command to properly exit with return codes using sys.exit()
- Update tests to correctly mock non-interactive detection
- Fix client edit test to avoid non-interactive mode for external editor test
- Update test assertions to match new simplified help text
All tests now pass (113 passed, 6 skipped) and linting is clean.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* test: add comprehensive non-interactive tests for AI-agent CLI commands
- Add non-interactive test coverage for mcpm edit, profile edit, profile inspect, client edit, and config set commands
- Fix exit code handling in commands to properly use sys.exit() for non-interactive mode
- Fix remote server environment variable validation in non_interactive.py
- Update existing tests to match corrected command behavior
- Ensure all AI-agent friendly CLI commands have proper test coverage
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: resolve test failures in edit and client commands
- Fix RemoteServerConfig env field access issue in edit command
- Update client edit tests to use add_server instead of update_servers
- Fix profile test assertions for correct output messages
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: resolve mypy errors and remove duplicate function
- Remove duplicate _edit_server_non_interactive function definition
- Add Union type annotation to fix mypy type compatibility issues
- Import Union from typing module
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: resolve all remaining profile command test failures
- Fix mock setups for profile edit tests to match actual implementation
- Update profile edit tests to use correct method calls (clear_profile, add_server_to_profile, etc.)
- Fix server validation by mocking list_servers correctly
- Handle profile name conflict checking in rename tests
- Fix subprocess mocking in profile inspect tests
- Update assertion expectations to match actual command behavior
All tests now passing: 155 passed, 6 skipped
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: add missing mock for client edit test failing in CI
- Add GlobalConfigManager mock to test_client_edit_command_client_not_installed
- Ensures test has servers available to avoid early exit with code 1
- Fixes CI test failure where no servers were available
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* test: add assertion for remove_server method call in client edit test
- Enhanced test_client_edit_non_interactive_remove_server to verify that
client_manager.remove_server is called with the correct prefixed server name
- Added proper mock setup for MCPM-managed server configuration
- Ensures the removal operation is actually triggered as intended
- Also includes automatic formatting fixes in test_profile_commands.py
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* test: add assertion for add_server method call in client edit test
- Enhanced test_client_edit_non_interactive_add_server to verify that
client_manager.add_server is called with the correct server configuration
- Added detailed validation of the server config parameters:
- Server name with proper mcpm_ prefix
- Command set to "mcpm"
- Args set to ["run", "test-server"]
- Ensures the add operation is actually triggered as intended
- Provides comprehensive verification of non-interactive add server workflow
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Update tests/test_edit.py
Co-authored-by: Copilot <[email protected]>
* test: add assertion for remove_server in set servers test
Add assertion to verify that the old server is removed when using
--set-servers in non-interactive mode. This ensures the test properly
validates that old servers are removed before adding new ones.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: update GitHub Actions to latest versions and add security permissions
- Update actions/setup-python from v4 to v5
- Update peter-evans/create-pull-request from v5 to v7
- Add minimal permissions block (contents: write, pull-requests: write) for improved security
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: pass force parameter to add_server to enable proper server overwrite
- Pass force=force parameter to global_config_manager.add_server() call
- Ensures existing servers are properly overwritten when --force flag is used
- Fixes inconsistency where force check existed but wasn't applied
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: Jonathan Wang <[email protected]>
Co-authored-by: Copilot <[email protected]>
0 commit comments