Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:1mcp app Agent MCP Server Lifecycle

From Leeroopedia
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

  1. Use a registry search to discover available servers before installation
  2. Support both registry-based install (with version pinning) and manual add (with explicit params)
  3. Create config backups before destructive mutations (remove, uninstall)
  4. Provide a status command that probes the running runtime, not just the config file
  5. Enable tool-level disabling for fine-grained control without server removal
  6. Support runtime-backed mutations via the admin API when a background runtime is running

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment