CLI
CLI Installation
Install the MCPSafe CLI to scan MCP servers directly from your terminal.
Requirements
Node.js
18.0 or higher
Required runtime
npm
8.0 or higher
Comes with Node.js
Git
2.0 or higher
For repository scanning
Installation
Install with npm
Recommended for most users
Global Installation
Terminal
npm install -g @mcpsafe/cliProject Installation
Terminal
npm install --save-dev @mcpsafe/cliVerify Installation
After installation, verify the CLI is working correctly:
Terminal
mcpsafe --versionMCPSafe CLI v1.0.0 Node.js v20.0.0 Platform: darwin (arm64)
Authentication
Configure API Key
Authenticate with your MCPSafe account for full functionality.
You can authenticate using the login command or by setting an environment variable.
Option 1: Interactive Login
Terminal
mcpsafe loginOption 2: Environment Variable
Terminal
export MCPSAFE_API_KEY=mcp_abc12345_xxxxxxxxxxxxxxxxTip
Add the environment variable to your shell profile (~/.bashrc, ~/.zshrc) for persistence.
Quick Test
Run a quick scan to verify everything is working:
Terminal
# Scan the current directory
mcpsafe scan ./
# Or scan a remote repository
mcpsafe scan https://github.com/modelcontextprotocol/serversScanning: ./ Fetching source code... Analyzing 47 files... ✓ Scan completed Security Grade: B (72/100) Vulnerabilities: 1 high, 2 medium, 3 low, 5 info