Skip to main content
Glama
list.py2.07 kB
""" OPNsense MCP Server - List Profiles Command List all configured credential profiles. """ import typer from typing import Optional from ..core.config_loader import ConfigLoader from ..core.exceptions import ConfigurationError def list_command( verbose: bool = typer.Option( False, "--verbose", "-v", help="Show detailed information for each profile" ) ): """ List all configured OPNsense profiles. Examples: # List all profiles opnsense-mcp list-profiles # List with details opnsense-mcp list-profiles --verbose """ typer.echo("\n📋 Configured OPNsense Profiles\n") try: profiles = ConfigLoader.list_profiles() if not profiles: typer.echo("❌ No profiles configured yet") typer.echo("\n💡 Tip: Run 'opnsense-mcp setup' to configure your first profile") return typer.echo(f"Found {len(profiles)} profile(s):\n") for profile in profiles: if verbose: # Show detailed information try: info = ConfigLoader.get_profile_info(profile) typer.echo(f"📦 {typer.style(profile, fg=typer.colors.CYAN, bold=True)}") typer.echo(f" URL: {info['url']}") typer.echo(f" API Key: {info['api_key_preview']}") typer.echo(f" SSL Verification: {'✓' if info['verify_ssl'] else '✗'}") typer.echo() except Exception as e: typer.echo(f"📦 {profile} - Error loading details: {e}") typer.echo() else: # Simple list typer.echo(f" • {profile}") if not verbose: typer.echo(f"\n💡 Tip: Use --verbose to see profile details") typer.echo(f"\n📍 Config file: {ConfigLoader.DEFAULT_CONFIG_FILE}") except Exception as e: typer.echo(f"❌ Error listing profiles: {e}", err=True) raise typer.Exit(1)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/floriangrousset/opnsense-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server