Optimize mcp-manager and proxmox skills

- mcp-manager README: remove outdated MCPs (httpx, naabu, apify, brightdata),
  fix "Jarvis" references, sync with actual registry
- proxmox: restructure MCP-first with Python fallback, trim 310->110 lines
  by removing duplicate Python/CLI examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-05 19:43:12 -06:00
parent 1f70264e73
commit 6f3076c3bb
2 changed files with 80 additions and 345 deletions

View File

@ -4,43 +4,19 @@
## Quick Start ## Quick Start
The skill operates automatically - Jarvis will detect when you need MCPs and offer to load them. The skill operates automatically - Claude detects when you need MCPs and offers to load them.
### Example Workflow ### Manual Commands
**You:** "Check what tech stack reddit.com is using"
**Jarvis:**
```
🔍 Detected need for: httpx
Loading MCP for web stack analysis...
✅ Enabled httpx (~300 tokens)
⚠️ Please restart Claude Code to activate, then resubmit your request.
```
**After restart:**
```
[Jarvis completes the task using httpx MCP]
Task complete!
Currently loaded MCPs: httpx (~300 tokens)
Would you like me to unload this to free context? (yes/no)
```
## Manual Commands
You can also manually control MCPs:
```bash ```bash
# Check what's currently loaded # Check what's currently loaded
python3 ~/.claude/skills/mcp-manager/mcp_control.py status python3 ~/.claude/skills/mcp-manager/mcp_control.py status
# Load specific MCP # Load specific MCP
python3 ~/.claude/skills/mcp-manager/mcp_control.py enable httpx python3 ~/.claude/skills/mcp-manager/mcp_control.py enable n8n-mcp
# Unload specific MCP # Unload specific MCP
python3 ~/.claude/skills/mcp-manager/mcp_control.py disable httpx python3 ~/.claude/skills/mcp-manager/mcp_control.py disable n8n-mcp
# See what MCPs would help with a task # See what MCPs would help with a task
python3 ~/.claude/skills/mcp-manager/mcp_control.py detect "your query here" python3 ~/.claude/skills/mcp-manager/mcp_control.py detect "your query here"
@ -49,81 +25,38 @@ python3 ~/.claude/skills/mcp-manager/mcp_control.py detect "your query here"
python3 ~/.claude/skills/mcp-manager/mcp_control.py reset python3 ~/.claude/skills/mcp-manager/mcp_control.py reset
``` ```
Or just ask Jarvis: Or just ask:
- "Load the httpx MCP" - "Load the n8n MCP"
- "Unload all MCPs" - "Unload all MCPs"
- "What MCPs are currently loaded?" - "What MCPs are currently loaded?"
- "Show MCP status"
## Available MCPs ## Available MCPs
### Security & Analysis | MCP | Category | Description | Est. Tokens |
- **httpx** - Web server tech stack analysis (~300 tokens) |-----|----------|-------------|-------------|
- **naabu** - Port scanning and service discovery (~300 tokens) | `cognitive-memory` | Memory | Cognitive memory with decay scoring | Always loaded |
| `n8n-mcp` | Automation | n8n workflow management | ~1500 |
| `playwright` | Automation | Browser automation and testing | ~1000 |
### Web Scraping ## Configuration
- **apify** - Web scraping via Apify platform (~800 tokens)
- **brightdata** - Enterprise data extraction (~500 tokens)
- **playwright** - Browser automation (~1000 tokens)
### Development - **Global MCPs** (always-on): `~/.claude.json``mcpServers`
- **Ref** - Documentation search (~600 tokens) - **Project MCPs** (on-demand): `<project-root>/.mcp.json``mcpServers`
- **stripe** - Payment processing (~700 tokens) - **Full Registry**: `~/.claude/.mcp-full.json` (all available definitions)
- **Logs**: `~/.claude/logs/mcp-manager.log`
### Personal (Daniel Miessler) > **Important:** `~/.claude/.mcp.json` is NOT read by Claude Code. Global servers go in `~/.claude.json`.
- **content** - Content archive (~400 tokens)
- **daemon** - Personal API (~300 tokens)
- **Foundry** - PAI infrastructure (~500 tokens)
## Context Savings
- **All MCPs loaded**: ~5400 tokens
- **Minimal (none loaded)**: ~0 tokens
- **Savings per session**: 5000+ tokens available for actual work!
## How Detection Works
The skill scans your request for trigger keywords:
- "tech stack", "what technology" → `httpx`
- "port scan", "open ports" → `naabu`
- "scrape", "crawl website" → `apify`, `brightdata`
- "browser automation" → `playwright`
- "documentation", "API docs" → `Ref`
- "stripe", "payment" → `stripe`
## Files
- **SKILL.md** - Main skill documentation (loaded by Jarvis)
- **mcp_control.py** - MCP management CLI tool
- **~/.claude/.mcp.json** - Active MCP configuration
- **~/.claude/.mcp-full.json** - Backup of all MCPs
- **~/.claude/.mcp.json.backup** - Previous config backup
- **~/.claude/logs/mcp-manager.log** - Change log
## Important Notes
⚠️ **Restart Required**: MCP changes require Claude Code restart to take effect
🔒 **Credentials Safe**: The tool preserves all API keys and auth tokens
💾 **Auto-Backup**: Configurations are backed up before every change
📊 **Token Estimates**: Token counts are approximations based on MCP complexity
## Workflow ## Workflow
1. **Minimal Start** - Begin each session with no MCPs loaded 1. **Minimal Start** - Begin each session with no on-demand MCPs loaded
2. **Auto-Detect** - Jarvis detects when MCPs are needed 2. **Auto-Detect** - Claude detects when MCPs are needed via trigger keywords
3. **Load on Demand** - Enable only required MCPs 3. **Load on Demand** - Enable only required MCPs
4. **Complete Task** - Use the MCP for your work 4. **Restart** - MCP changes require Claude Code restart
5. **Unload** - Free context by removing MCPs when done 5. **Complete Task** - Use the MCP for your work
6. **Repeat** - Next task loads different MCPs as needed 6. **Unload** - Free context by removing MCPs when done
This approach keeps your context budget focused on your actual work instead of unused MCP definitions.
--- ---
**Version**: 1.0.0 **Version**: 1.1.0
**Created**: 2025-11-09 **Updated**: 2026-03-05
**Maintained by**: Jarvis (PAI System)

View File

@ -7,183 +7,78 @@ description: Proxmox VE management - VM lifecycle, creation/cloning, snapshots,
**SCOPE**: Only use in claude-home or vm-management contexts. Do not activate in unrelated projects. **SCOPE**: Only use in claude-home or vm-management contexts. Do not activate in unrelated projects.
## When to Activate This Skill ## When to Activate
- "list my VMs", "show virtual machines" - "list my VMs", "show virtual machines"
- "start/stop/restart VM X" - "start/stop/restart VM X"
- "create a new VM", "clone VM" - "create a new VM", "clone VM"
- "take a snapshot", "rollback to snapshot" - "take a snapshot", "rollback to snapshot"
- "check VM resources", "monitor VMs" - "check VM resources", "monitor VMs"
- "proxmox status", "hypervisor info"
- "LXC containers", "manage containers" - "LXC containers", "manage containers"
- "backup VM", "restore from backup" - "backup VM", "restore from backup"
- Any Proxmox VE infrastructure operations
## Quick Start ## Approach: MCP First, Python Fallback
### List All VMs ### Option 1: Proxmox MCP (Preferred)
Load the Proxmox MCP on-demand for interactive use:
```bash
python3 ~/.claude/skills/mcp-manager/mcp_control.py enable proxmox
# Restart Claude Code to activate, then use MCP tools directly
```
The MCP provides direct API access without writing Python code.
### Option 2: Python Client (Complex/Batch Operations)
For multi-step automation, batch operations, or when MCP is unavailable:
```python ```python
from proxmox_client import ProxmoxClient from proxmox_client import ProxmoxClient
client = ProxmoxClient() client = ProxmoxClient()
# Get all VMs with status
vms = client.get_all_vms_status()
for vm in vms:
print(f"VM {vm['vmid']}: {vm['name']} - {vm['status']}")
``` ```
### VM Lifecycle Operations **CLI shorthand:**
```python
# Start a VM
client.start_vm(100)
# Stop a VM (graceful)
client.stop_vm(100)
# Force stop
client.stop_vm(100, force=True)
# Restart a VM
client.restart_vm(100)
# Graceful shutdown with timeout
client.shutdown_vm(100, timeout=60)
```
### Create and Clone VMs
```python
# Create new VM
client.create_vm(
vmid=101,
name="docker-host-01",
memory=4096,
cores=2,
sockets=1
)
# Clone existing VM
client.clone_vm(
vmid=100,
newid=102,
name="cloned-vm",
full=True # Full clone, not linked
)
```
### Snapshot Management
```python
# Create snapshot
client.create_snapshot(
vmid=100,
snapname="before-upgrade",
description="Pre-system upgrade snapshot",
vmstate=True # Include RAM for running VMs
)
# List snapshots
snapshots = client.list_snapshots(100)
# Rollback to snapshot
client.rollback_snapshot(100, "before-upgrade")
# Delete snapshot
client.delete_snapshot(100, "before-upgrade")
```
### Resource Monitoring
```python
# Get VM status and resources
status = client.get_vm_status(100)
print(f"CPU: {status['cpu']}")
print(f"Memory: {status['mem']} / {status['maxmem']}")
print(f"Uptime: {status['uptime']}s")
# Get node resources
node_status = client.get_node_status()
print(f"Node CPU: {node_status['cpu']}")
print(f"Node Memory: {node_status['memory']}")
```
### Container Operations
```python
# List LXC containers
containers = client.list_containers()
# Start/stop containers
client.start_container(200)
client.stop_container(200)
```
## CLI Usage
The Python client has a CLI interface for quick operations:
```bash ```bash
# List all VMs python3 ~/.claude/skills/proxmox/proxmox_client.py [list|status|start|stop|nodes] [vmid]
python3 ~/.claude/skills/proxmox/proxmox_client.py list
# Get VM status
python3 ~/.claude/skills/proxmox/proxmox_client.py status 100
# Start a VM
python3 ~/.claude/skills/proxmox/proxmox_client.py start 100
# Stop a VM
python3 ~/.claude/skills/proxmox/proxmox_client.py stop 100
# List nodes
python3 ~/.claude/skills/proxmox/proxmox_client.py nodes
``` ```
## Key Capabilities ## Key Capabilities
### VM Lifecycle - **VM Lifecycle**: list, start, stop, restart, shutdown, create, clone, delete
- ✅ List all VMs with status - **Snapshots**: create (with/without RAM), list, rollback, delete
- ✅ Start, stop, restart, shutdown VMs - **Monitoring**: real-time CPU/RAM/disk, node health, storage capacity
- ✅ Create new VMs from scratch - **LXC Containers**: list, start, stop, status
- ✅ Clone existing VMs - **Backups**: create, list, job management
- ✅ Delete VMs - **Storage**: pool listing, capacity, content
- **Tasks**: async task monitoring, wait for completion
### Snapshot Management ## Common Workflows
- ✅ Create snapshots (with/without RAM)
- ✅ List all snapshots
- ✅ Rollback to snapshot
- ✅ Delete snapshots
### Monitoring & Resources ### Deploy VM from Template
- ✅ Real-time VM resource usage (CPU, RAM, disk) ```python
- ✅ Node status and health upid = client.clone_vm(vmid=9000, newid=101, name="app-server-01")
- ✅ Storage status and capacity client.wait_for_task(upid)
- ✅ Network interface information client.start_vm(101)
```
### Container (LXC) Operations ### Pre-Upgrade Snapshot
- ✅ List containers ```python
- ✅ Start/stop containers upid = client.create_snapshot(vmid=100, snapname="pre-upgrade", description="Before upgrade", vmstate=True)
- ✅ Get container status client.wait_for_task(upid)
# If issues: client.rollback_snapshot(100, "pre-upgrade")
```
### Backup & Recovery ### Bulk Status Check
- ✅ Create VM backups ```python
- ✅ List available backups vms = client.get_all_vms_status()
- ✅ Backup job management for vm in vms:
if vm['status'] != 'running':
### Storage Operations print(f"VM {vm['vmid']} ({vm['name']}) is {vm['status']}")
- ✅ List storage pools ```
- ✅ Check storage capacity and usage
- ✅ Storage content listing
### Task Management
- ✅ Monitor async task status
- ✅ Wait for task completion
- ✅ Task progress tracking
## Configuration ## Configuration
Credentials are stored in: Credentials: `~/.claude/secrets/proxmox.json`
```
~/.claude/secrets/proxmox.json
```
Format:
```json ```json
{ {
"host": "10.10.0.11", "host": "10.10.0.11",
@ -195,115 +90,22 @@ Format:
} }
``` ```
## MCP Server Integration ## Integration
For interactive use, the Proxmox MCP server can be loaded on-demand: - **VM docs**: `/mnt/NV2/Development/claude-home/vm-management/`
- **Network**: 10.10.0.x internal network
- **API docs**: https://pve.proxmox.com/pve-docs/api-viewer/
- **Python lib**: https://github.com/proxmoxer/proxmoxer
```bash ## Security
# Enable Proxmox MCP
python3 ~/.claude/skills/mcp-manager/mcp_control.py enable proxmox
# Restart Claude Code to activate
# Then use MCP tools directly
```
The MCP server will be automatically suggested when you use Proxmox-related keywords.
## Common Workflows
### 1. Deploy New VM from Template
```python
# Clone template
upid = client.clone_vm(vmid=9000, newid=101, name="app-server-01")
client.wait_for_task(upid)
# Start the VM
client.start_vm(101)
# Wait for boot and check status
import time
time.sleep(30)
status = client.get_vm_status(101)
print(f"VM Status: {status['status']}")
```
### 2. Pre-Upgrade Snapshot Workflow
```python
# Take snapshot before changes
upid = client.create_snapshot(
vmid=100,
snapname="pre-upgrade-2025-01-11",
description="Before system upgrade",
vmstate=True
)
client.wait_for_task(upid)
# Perform upgrade operations...
# If issues occur, rollback:
# client.rollback_snapshot(100, "pre-upgrade-2025-01-11")
```
### 3. Bulk VM Status Check
```python
# Check status of all VMs
vms = client.get_all_vms_status()
for vm in vms:
if vm['status'] != 'running':
print(f"⚠️ VM {vm['vmid']} ({vm['name']}) is {vm['status']}")
else:
cpu_pct = vm['cpu'] * 100
mem_pct = (vm['mem'] / vm['maxmem']) * 100 if vm['maxmem'] > 0 else 0
print(f"✅ VM {vm['vmid']} ({vm['name']}): CPU {cpu_pct:.1f}%, MEM {mem_pct:.1f}%")
```
### 4. Emergency VM Operations
```python
# Force stop unresponsive VM
client.stop_vm(100, force=True)
# Or graceful shutdown with fallback
try:
upid = client.shutdown_vm(100, timeout=120)
if not client.wait_for_task(upid, timeout=130):
print("Graceful shutdown timed out, forcing stop...")
client.stop_vm(100, force=True)
except Exception as e:
print(f"Shutdown failed: {e}")
client.stop_vm(100, force=True)
```
## Integration with Home Lab
This skill integrates with Cal's home lab infrastructure:
- **VM Management**: Documented in `/mnt/NV2/Development/claude-home/vm-management/`
- **Cloud-Init Templates**: Standard provisioning configurations
- **Networking**: 10.10.0.x internal network
- **Docker Hosts**: Automated Docker VM deployment
- **Monitoring**: Discord notifications via monitoring system
## Supplementary Resources
For comprehensive Proxmox API reference and advanced usage:
```bash
read ~/.claude/skills/proxmox/CLAUDE.md
```
For Proxmox VE API documentation:
- Official API: https://pve.proxmox.com/pve-docs/api-viewer/
- Python Library: https://github.com/proxmoxer/proxmoxer
## Security Notes
- API token has full root privileges - API token has full root privileges
- Credentials stored in `~/.claude/secrets/` (700 permissions) - Credentials in `~/.claude/secrets/` (700 permissions)
- SSL verification disabled for self-signed certificates - SSL verification disabled (self-signed certs)
- NEVER commit secrets to git repositories - Never commit secrets to git
- Token can be regenerated in Proxmox web UI if compromised
--- ---
**Created**: 2025-01-11
**Author**: Jarvis (PAI System)
**Client Library**: `~/.claude/skills/proxmox/proxmox_client.py` **Client Library**: `~/.claude/skills/proxmox/proxmox_client.py`
**Version**: 1.0.0 **Updated**: 2026-03-05
**Version**: 2.0.0