We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pazuzu1w/ubuntu_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
check_disk_space.pyβ’1.53 KiB
#!/usr/bin/env python3
"""
Demonstrate disk space checking functionality
"""
from main import create_safe_policy, UbuntuController
import json
def check_disk_space():
"""Check disk space using the MCP server functionality"""
print("πΎ Checking Disk Space...")
print("=" * 40)
# Create controller
policy = create_safe_policy()
controller = UbuntuController(policy)
# Get system info (includes disk usage)
info = controller.get_system_info()
disk = info['disk_usage']
# Convert to GB
total_gb = disk['total'] / (1024**3)
used_gb = disk['used'] / (1024**3)
free_gb = disk['free'] / (1024**3)
used_percent = (disk['used'] / disk['total']) * 100
# Display results
print(f"π Total Disk Space: {total_gb:.1f} GB")
print(f"π΄ Used Space: {used_gb:.1f} GB ({used_percent:.1f}%)")
print(f"π’ Free Space: {free_gb:.1f} GB")
# Visual usage bar
bar_length = 20
used_bars = int((used_percent / 100) * bar_length)
free_bars = bar_length - used_bars
bar = "β" * used_bars + "β" * free_bars
print(f"π Usage: [{bar}] {used_percent:.1f}%")
# Warnings
if used_percent > 90:
print("β οΈ WARNING: Disk is over 90% full!")
elif used_percent > 80:
print("β οΈ NOTICE: Disk is over 80% full")
else:
print("β Disk space looks good!")
print("\n" + "=" * 40)
print("This is how Claude Desktop would see your disk space!")
if __name__ == "__main__":
check_disk_space()