list¶
List available templates and active deployments with comprehensive filtering and formatting options.
Synopsis¶
Description¶
The list
command provides an overview of available MCP server templates and active deployments. It displays template information, deployment status, and resource usage in a clear, formatted interface.
Options¶
Option | Description | Default |
---|---|---|
--format {table,json,yaml} |
Output format | table |
--filter TEXT |
Filter by name, category, or tag | No filter |
--backend {docker,k8s,mock} |
Backend to query | docker |
--all |
Show all templates (including inactive) | Active only |
--deployed |
Show only currently deployed (active) servers | All templates |
Output Information¶
Template Information¶
- Name: Template identifier
- Description: Brief template description
- Version: Template version
- Category: Template classification
- Status: Deployment status (Active, Stopped, Error)
- Container: Container name (if deployed)
- Ports: Exposed ports
- Created: Deployment timestamp
Examples¶
Basic Usage¶
# List all available templates
mcp-template list
# List only currently deployed (active) servers
mcp-template list --deployed
# Example output:
ββββββββββββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββ³ββββββββββββββ
β Template β Description β Status β Container β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β demo β Demo MCP server with greeting tools β β
Active (2 minutes ago) β mcp-demo-123β
β file-server β Secure filesystem operations server β β
Active (1 hour ago) β mcp-file-456β
β postgres-server β PostgreSQL database integration β βΈοΈ Stopped β - β
β api-server β REST API integration template β β Error (Connection failed) β mcp-api-789 β
ββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ
π Summary: 4 templates (2 active, 1 stopped, 1 error)
π‘ Use 'mcp-template deploy <template>' to deploy
Use 'mcp-template logs <template>' to view logs
Filtering Options¶
# Filter by template name
mcp-template list --filter file
# Filter by category
mcp-template list --filter database
# Filter by status
mcp-template list --filter active
Output Formats¶
# JSON format for programmatic use
mcp-template list --format json
# Example JSON output:
{
"templates": [
{
"name": "demo",
"description": "Demo MCP server with greeting tools",
"version": "1.0.0",
"category": "example",
"status": "active",
"container_name": "mcp-demo-123456",
"ports": {"8080": 8080},
"created": "2024-01-15T10:30:00Z",
"last_activity": "2024-01-15T10:32:00Z"
}
],
"summary": {
"total": 4,
"active": 2,
"stopped": 1,
"error": 1
}
}
# YAML format
mcp-template list --format yaml
Backend-Specific Listing¶
# List Docker deployments (default)
mcp-template list --backend docker
# List Kubernetes deployments
mcp-template list --backend k8s
# List mock deployments (testing)
mcp-template list --backend mock
Template Categories¶
Templates are organized by category for easier discovery:
Example Templates (example
)¶
- demo: Basic greeting and echo functionality
- hello-world: Minimal example server
File Operations (file
)¶
- file-server: Comprehensive file system operations
- document-processor: Document analysis and processing
Database Integration (database
)¶
- postgres-server: PostgreSQL database operations
- mongodb-server: MongoDB document operations
- redis-server: Redis cache and pub/sub
API Integration (api
)¶
- rest-api: General REST API client
- github-api: GitHub API integration
- slack-api: Slack workspace integration
Development Tools (development
)¶
- code-analysis: Static code analysis tools
- test-runner: Automated testing framework
- deployment-tools: CI/CD integration
Status Indicators¶
Active Status (β
Active
)¶
- Container is running and healthy
- Server is responding to requests
- All health checks passing
Stopped Status (βΈοΈ Stopped
)¶
- Container has been manually stopped
- No active processes
- Can be restarted with
deploy
command
Error Status (β Error
)¶
- Container failed to start or crashed
- Configuration or runtime errors
- Requires troubleshooting
Starting Status (π Starting
)¶
- Container is currently starting up
- Health checks in progress
- Normal during deployment
Detailed Information¶
For each template, the list command shows:
Resource Usage¶
- CPU Usage: Current CPU utilization
- Memory Usage: RAM consumption
- Network I/O: Network traffic statistics
- Disk Usage: Storage utilization
Configuration Summary¶
- Image: Docker image and tag
- Transport: MCP transport protocol (stdio/http)
- Ports: Exposed port mappings
- Volumes: Mounted directories
Recent Activity¶
- Last Activity: Most recent request timestamp
- Request Count: Total requests served
- Error Count: Recent error count
- Uptime: Time since last restart
Advanced Usage¶
Monitoring Dashboard¶
# Watch list in real-time (requires watch command)
watch -n 5 'mcp-template list'
# Show all information including stopped containers
mcp-template list --all
# Show only currently deployed (active) servers
mcp-template list --deployed
# Compact format for scripts
mcp-template list --format json | jq -r '.templates[].name'
Health Monitoring¶
# Show only error status deployments
mcp-template list --filter error
# Show recently active deployments
mcp-template list --filter active
# Export deployment list for monitoring
mcp-template list --format json > deployments.json
Troubleshooting¶
No Templates Listed¶
Solutions: - Verify templates directory exists - Check template.json files are valid - Ensure you have read permissionsBackend Connection Error¶
Solutions: - Start Docker daemon - Check Docker permissions - Verify DOCKER_HOST environment variablePermission Denied¶
Solutions: - Run with appropriate permissions - Check Docker group membership - Verify backend configurationIntegration Examples¶
Monitoring Scripts¶
#!/bin/bash
# Simple monitoring script
ERRORS=$(mcp-template list --format json | jq '.summary.error')
if [ "$ERRORS" -gt 0 ]; then
echo "β οΈ $ERRORS deployments have errors"
mcp-template list --filter error
fi
Health Check¶
import json
import subprocess
def check_deployment_health():
result = subprocess.run([
'python', '-m', 'mcp_template', 'list', '--format', 'json'
], capture_output=True, text=True)
data = json.loads(result.stdout)
summary = data['summary']
if summary['error'] > 0:
print(f"β οΈ {summary['error']} deployments have errors")
return False
print(f"β
All {summary['active']} deployments healthy")
return True
Configuration¶
Default Settings¶
- Backend: Docker (can be overridden with
MCP_TEMPLATE_DEFAULT_BACKEND
) - Format: Table (can be overridden with
MCP_LIST_DEFAULT_FORMAT
) - Refresh Interval: 30 seconds for cached data
Environment Variables¶
MCP_TEMPLATE_DEFAULT_BACKEND
: Default backend to queryMCP_LIST_DEFAULT_FORMAT
: Default output formatMCP_LIST_SHOW_STOPPED
: Include stopped deployments by default