Principle:1mcp app Agent MCP Server Lifecycle
| Knowledge Sources | |
|---|---|
| Domains | MCP_Protocol, CLI |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Pattern that manages the full lifecycle of MCP server entries—discovery, installation, configuration, verification, tool-level management, lifecycle control, update, and removal—through a set of CLI commands operating on a shared configuration file.
Description
MCP Server Lifecycle Management provides a command-driven interface for adding, removing, and managing MCP server entries in the 1MCP configuration. Servers can be discovered from a remote registry, installed with automatic configuration, or added manually with explicit transport parameters. Once configured, servers can be listed, status-checked, enabled, disabled, restarted, updated, and removed. Tool-level management allows disabling specific tools within a server. All mutations write to the shared config file with backup and can optionally target a running runtime for live changes.
Usage
Use this principle when:
- Users need to discover MCP servers from a registry and install them with one command
- Manual server addition must support stdio, HTTP, and SSE transports with env vars and tags
- Configuration changes need to be verified via list, status, and token estimation
- Individual tools within a server can be disabled without removing the server
- Runtime-backed mutations (enable, disable, restart) target a running instance, not just config
Theoretical Basis
The lifecycle is a state machine over config entries:
discovery → installation → configured → (enabled | disabled) → updated → removed
↓
tool-level management
Each CLI command is a command builder + handler pair:
// Abstract pattern (NOT real implementation)
buildCommand(yargs) // registers options and help text
command(argv) // validates, mutates config, prints result
Practical Guide
- Use a registry search to discover available servers before installation
- Support both registry-based install (with version pinning) and manual add (with explicit params)
- Create config backups before destructive mutations (remove, uninstall)
- Provide a status command that probes the running runtime, not just the config file
- Enable tool-level disabling for fine-grained control without server removal
- Support runtime-backed mutations via the admin API when a background runtime is running
Related Pages
Implemented By
- Implementation:1mcp_app_Agent_searchCommand
- Implementation:1mcp_app_Agent_addCommand
- Implementation:1mcp_app_Agent_installCommand
- Implementation:1mcp_app_Agent_listCommand
- Implementation:1mcp_app_Agent_statusCommand
- Implementation:1mcp_app_Agent_toolsCommand
- Implementation:1mcp_app_Agent_enableCommand
- Implementation:1mcp_app_Agent_restartCommand
- Implementation:1mcp_app_Agent_updateCommand
- Implementation:1mcp_app_Agent_uninstallCommand
- Implementation:1mcp_app_Agent_removeCommand