G8R CLI for MCP server management and policy enforcement
npm install @gatorsecurity/cliG8R CLI for MCP server management and policy enforcement.
``bashBuild the CLI
pnpm --filter @gatorsecurity/cli build
$3
`bash
cd packages/cli && npm unlink
`Configuration
The CLI stores configuration in
~/.g8r/:
- ~/.g8r/config.json - Default profile
- ~/.g8r/profiles/ - Named profiles$3
Use
G8R_PROFILE to switch between configurations:`bash
Use dev profile
G8R_PROFILE=dev g8r config listSet up dev profile for local development
G8R_PROFILE=dev g8r config devOr create a shell alias
alias g8r-dev='G8R_PROFILE=dev g8r'
`$3
`bash
Quick setup with dev profile
G8R_PROFILE=dev g8r config devOr manually set URLs
g8r config set platformUrl http://localhost:8200
g8r config set webUrl http://localhost:8400
`Default production values:
-
platformUrl: https://api.g8r.live
- webUrl: https://app.g8r.liveCommands
$3
-
g8r init - Interactive setup wizard (configure AI client, wrap servers with gateway)
- g8r login - Authenticate with G8R platform (opens browser)
- g8r logout - Clear stored credentials
- g8r whoami [--json] - Show current user and organization$3
-
g8r config list - Show profile and configuration values
- g8r config get - Get a specific config value
- g8r config set - Set a config value
- g8r config dev - Configure for local development (localhost URLs)Available config keys:
-
platformUrl - Backend API URL
- webUrl - Web UI URL for authentication
- defaultDeny - Fail closed (true) or fail open (false) on policy errors$3
-
g8r servers list - List MCP servers from all AI client configs
- g8r servers search [query] - Search for MCP servers on npm
- g8r servers add --package - Add server with CVE check (e.g., --package @playwright/mcp@0.0.40)
- g8r servers add --command - Add server with custom command
- g8r servers remove [name] - Remove server from AI client configOptions for
servers add:
- --client - Target client (claude-desktop, claude-code, cursor, vscode)
- --name - Server name (auto-generated from package if not specified)
- --no-gateway - Don't wrap with g8r-gateway
- --skip-security - Skip CVE vulnerability check
- --local - Add to project config instead of globalOptions for
servers search:
- --limit - Max results to show (default: 15)
- --json - Output as JSON$3
-
g8r policies list - List security policies for your organization
- g8r policies list --type - Filter by policy type (tool, cve, dependency)
- g8r policies list --json - Output as JSON$3
-
g8r plugins list - List enabled plugins from platform
- g8r plugins sync - Sync plugin status$3
-
g8r sandbox start - Start sandbox container
- g8r sandbox stop - Stop sandbox container
- g8r sandbox status - Show sandbox statusEnvironment Variables
-
G8R_PROFILE - Use a named profile (e.g., dev, staging)
- G8R_WEB_URL - Override web URL for login (bypasses config)
- G8R_DEBUG - Enable debug logging (set to true)Examples
$3
`bash
Login (opens browser)
g8r loginVerify authentication
g8r whoamiSet up your AI client (Claude Desktop, Cursor, VS Code, etc.)
g8r initCheck enabled plugins
g8r plugins list
`$3
`bash
Search for MCP servers
g8r servers search playwright
g8r servers search githubAdd a server (with automatic CVE check)
g8r servers add --package @playwright/mcpList configured servers
g8r servers list
`$3
`bash
List all policies
g8r policies listFilter by type
g8r policies list --type cveOutput as JSON
g8r policies list --json
`$3
`bash
Set up dev profile (one time)
G8R_PROFILE=dev g8r config dev
G8R_PROFILE=dev g8r loginUse dev profile
G8R_PROFILE=dev g8r whoami
G8R_PROFILE=dev g8r init
`$3
`bash
Enable debug logs
G8R_DEBUG=true g8r login 2>debug.log
`Troubleshooting
$3
- Run g8r config list to verify URLs
- Set correct URLs: g8r config set webUrl http://localhost:8400$3
- Verify server is running: curl http://localhost:8200/health
- Check config: g8r config list
- Clear and re-login: g8r logout && g8r login`