Gemini
This guide covers Google's official Gemini CLI, a powerful open-source AI agent that brings Gemini directly into your terminal with native MCP support. Unlike community tools, this is Google's own CLI with built-in Model Context Protocol integration, making WhoisXML API MCP Server setup incredibly simple.
🚀 Official Gemini CLI Repository →
Why Choose Gemini CLI?
Google's official Gemini CLI offers several advantages that make it ideal for working with MCP servers:
Key Advantages
- 💫 Massive Context Window - Gemini 2.5 Pro provides 1 million tokens of context
- 🔌 Native MCP Support - Built-in Model Context Protocol integration
- 🆓 Generous Free Tier - 60 requests/minute, 1,000 requests/day at no cost
- 🔍 Google Search Integration - Ground prompts with real-time web data
- 🔧 Extensible - Support for MCP, system prompts, and custom extensions
- 📖 Open Source - Apache 2.0 license, fully transparent
📰 Announcement: Introducing Gemini CLI →
System Requirements
- Node.js: Version 20 or higher
- Operating Systems: macOS, Linux, or Windows
- Hardware: Minimum 4GB RAM (8GB recommended)
- Network: Active internet connection for API access
Authentication Options
Choose the authentication method that best fits your needs:
Option 1: OAuth Login (Using your Google Account) - Recommended
✨ Best for: Individual developers as well as anyone who has a Gemini Code Assist License
Benefits:
- Free tier: 60 requests/min and 1,000 requests/day
- Gemini 2.5 Pro with 1M token context window
- No API key management - just sign in with your Google account
- Automatic updates to latest models
Perfect for Most Users
This is the easiest and most secure authentication method. No API key management required!
Option 2: Gemini API Key
✨ Best for: Developers who need specific model control or paid tier access
Benefits:
- Free tier: 100 requests/day with Gemini 2.5 Pro
- Model selection: Choose specific Gemini models
- Usage-based billing: Upgrade for higher limits when needed
Get API Keys:
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API key"
- Copy the key for use
Option 3: Vertex AI
✨ Best for: Enterprise teams and production workloads
Benefits:
- Enterprise features: Advanced security and compliance
- Scalable: Higher rate limits with billing account
- Integration: Works with existing Google Cloud infrastructure
WhoisXMLAPI Token
You'll also need a WhoisXMLAPI token:
- Get yours from whoisxmlapi.com
- Keep it secure as an environment variable
Installing Gemini CLI
The official Gemini CLI installation varies by platform:
Step 1: Install Gemini CLI
Run instantly with npx (no installation required):
npx https://github.com/google-gemini/gemini-cli
Why Choose npx?
The npx method requires no installation, always runs the latest version, and eliminates dependency management. Perfect for getting started quickly!
Alternative: Install globally with npm:
npm install -g @google/gemini-cli
# Verify installation
gemini --version
Alternative: Install with Homebrew (macOS/Linux):
brew install gemini-cli
# Verify installation
gemini --version
Installation Options
For the most up-to-date installation methods, check the official repository. The npx method is recommended for most users.
Step 2: Authentication Setup
Choose your preferred authentication method:
Option A: OAuth Login (Recommended)
# Start Gemini CLI - it will prompt for authentication
gemini
# Choose OAuth and follow the browser authentication flow when prompted
# For organization Code Assist licenses, set your Google Cloud Project:
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_NAME"
Option B: Gemini API Key
# Get your key from https://aistudio.google.com/apikey
export GEMINI_API_KEY="YOUR_API_KEY"
# Start Gemini CLI
gemini
Option C: Vertex AI
# Get your key from Google Cloud Console
export GOOGLE_API_KEY="YOUR_API_KEY"
export GOOGLE_GENAI_USE_VERTEXAI=true
# Start Gemini CLI
gemini
Step 3: Basic Configuration
# Test the installation
gemini --help
# Test basic functionality (non-interactive)
gemini -p "Hello, can you help me understand AI?"
# Start interactive session
gemini
Configuring WhoisXML API MCP Server
The official Gemini CLI has native MCP support through the Model Context Protocol (MCP). MCP servers extend Gemini CLI with custom tools and capabilities. This section covers how to configure, add, remove, and manage MCP servers, specifically the WhoisXMLAPI server.
Understanding MCP Configuration
MCP servers are configured in the mcpServers section of your settings.json file. Each server configuration includes:
- Connection method: How to start/connect to the server (command, HTTP, or streamable HTTP)
- Environment variables: API keys and configuration
- Tool management: Which tools to include/exclude
- Security settings: Trust levels and permissions
MCP Server Configuration Options
Each MCP server supports these configuration options:
| Option | Type | Description |
|---|---|---|
command | string | Command to execute to start the MCP server via standard I/O |
args | array | Arguments to pass to the command |
env | object | Environment variables for the server process |
cwd | string | Working directory to start the server |
url | string | URL for MCP server using streamable HTTP transport |
httpUrl | string | URL for MCP server using streamable HTTP |
headers | object | HTTP headers for url/httpUrl requests |
timeout | number | Timeout in milliseconds for server requests |
trust | boolean | Trust this server and bypass tool call confirmations |
description | string | Brief description for display purposes |
includeTools | array | Allowlist of specific tool names from this server |
excludeTools | array | Denylist of tool names to exclude |
Connection Method Priority
If multiple connection methods are specified, Gemini CLI uses this precedence: httpUrl > url > command
Step 1: Set Up Environment Variables
# Set your WhoisXMLAPI token
export WHOISXMLAPI_TOKEN="your-whoisxmlapi-token-here"
# Add to your shell profile for persistence
echo 'export WHOISXMLAPI_TOKEN="your-whoisxmlapi-token-here"' >> ~/.bashrc
source ~/.bashrc
Step 2: Configure the WhoisXML API MCP Server
Create or edit ~/.gemini/settings.json to add the WhoisXML API MCP Server:
Option A: Using npx (Recommended - no installation required)
{
"mcpServers": {
"whoisxmlapi": {
"command": "npx",
"args": ["-y", "@whoisxmlapidotcom/mcp-whoisxmlapi"],
"env": {
"WHOISXMLAPI_TOKEN": "${WHOISXMLAPI_TOKEN}"
},
"description": "WhoisXMLAPI tools for domain intelligence and security analysis",
"trust": false // configures it so every tool call requires human approval, set to true to bypass this
}
}
}
Option B: Using Docker
{
"mcpServers": {
"whoisxmlapi": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"--env", "WHOISXMLAPI_TOKEN",
"whoisxmlapidotcom/mcp-whoisxmlapi:v1"
],
"env": {
"WHOISXMLAPI_TOKEN": "${WHOISXMLAPI_TOKEN}"
},
"description": "WhoisXMLAPI tools via Docker container",
"trust": false // configures it so every tool call requires human approval, set to true to bypass this
}
}
}
Option C: Using Binary
{
"mcpServers": {
"whoisxmlapi": {
"command": "/usr/local/bin/mcp-whoisxmlapi",
"env": {
"WHOISXMLAPI_TOKEN": "${WHOISXMLAPI_TOKEN}"
},
"description": "WhoisXMLAPI tools via binary installation",
"trust": false // configures it so every tool call requires human approval, set to true to bypass this
}
}
}
Step 3: Advanced Configuration
Selective Tool Access
Control which tools are available from the WhoisXMLAPI server:
{
"mcpServers": {
"whoisxmlapi": {
"command": "npx",
"args": ["-y", "@whoisxmlapidotcom/mcp-whoisxmlapi"],
"env": {
"WHOISXMLAPI_TOKEN": "${WHOISXMLAPI_TOKEN}"
},
"includeTools": [
"mcp_whoisxmlapi_whois",
"mcp_whoisxmlapi_dns_lookup",
"mcp_whoisxmlapi_threat_intelligence"
],
"excludeTools": [
"mcp_whoisxmlapi_email_verification"
],
"trust": false // configures it so every tool call requires human approval, set to true to bypass this
}
}
}
Tool Precedence
excludeTools takes precedence over includeTools. If a tool appears in both lists, it will be excluded.
Trusted Server Configuration
For development or trusted environments, you can bypass tool confirmations:
{
"mcpServers": {
"whoisxmlapi": {
"command": "npx",
"args": ["-y", "@whoisxmlapidotcom/mcp-whoisxmlapi"],
"env": {
"WHOISXMLAPI_TOKEN": "${WHOISXMLAPI_TOKEN}"
},
"trust": true,
"timeout": 30000
}
}
}
Managing Multiple MCP Servers
You can configure multiple MCP servers simultaneously:
{
"mcpServers": {
"whoisxmlapi": {
"command": "npx",
"args": ["-y", "@whoisxmlapidotcom/mcp-whoisxmlapi"],
"env": {
"WHOISXMLAPI_TOKEN": "${WHOISXMLAPI_TOKEN}"
},
"description": "Domain intelligence and security analysis"
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
},
"description": "GitHub repository management"
}
}
}
Tool Name Conflicts
When multiple servers provide tools with the same name, Gemini CLI automatically prefixes them:
whoisxmlapi__tool_namegithub__tool_name
Adding and Removing MCP Servers
Adding a New Server
- Edit your
~/.gemini/settings.jsonfile - Add the new server configuration to the
mcpServerssection - Restart Gemini CLI to load the new server
Removing a Server
- Delete the server entry from
mcpServersinsettings.json - Restart Gemini CLI
Temporarily Disabling a Server
Use the global MCP configuration to exclude specific servers:
{
"mcp": {
"excluded": ["whoisxmlapi"]
},
"mcpServers": {
"whoisxmlapi": {
// ... server config remains
}
}
}
Step 4: Verify MCP Configuration
# Start Gemini CLI to test the configuration
gemini
# Test WhoisXMLAPI tools with natural language queries:
# "Tell me about the domain google.com"
# "What's the WHOIS data for example.com?"
# "Check if admin@example.com is a valid email"
# "Is there any threat intelligence on suspicious-domain.com?"
# Gemini will automatically discover and use WhoisXMLAPI tools when relevant
Usage Examples
With native MCP support, using WhoisXMLAPI tools is seamless:
Getting Started
# Start in current directory
gemini
# Include multiple directories for context
gemini --include-directories ../lib,../docs
# Use specific model
gemini -m gemini-2.5-flash
# Non-interactive mode for scripts
gemini -p "Analyze the security posture of example.com"
Basic Domain Analysis
# Start Gemini CLI and use natural language
gemini
# Examples of domain analysis queries:
> "Analyze the domain security and ownership of stackoverflow.com"
> "What can you tell me about the IP address 8.8.8.8?"
> "Show me the DNS configuration and history for example.com"
> "Is the email address admin@example.com valid?"
> "Is github.com associated with any security threats?"
Advanced Features
# Leverage the massive context window for comprehensive analysis
gemini "Provide a detailed security audit of these domains: google.com, github.com, stackoverflow.com, reddit.com - include WHOIS data, DNS configuration, SSL certificates, and any threat intelligence"
# Use Google Search integration along with WhoisXMLAPI data
gemini "Research the latest security news about cloudflare.com and analyze its current domain configuration"
# Complex multi-tool queries
gemini "Compare the hosting infrastructure, DNS setup, and security posture of aws.amazon.com vs azure.microsoft.com vs cloud.google.com"
Interactive Session
# Start an interactive session (default behavior)
gemini
# In interactive mode, you can have ongoing conversations:
# > "Let's analyze some domains for security issues"
# > "First, tell me about google.com's WHOIS data"
# > "Now compare its DNS setup with cloudflare.com"
# > "Are there any security concerns with either domain?"
MCP Configuration Troubleshooting
Common MCP Configuration Issues
Server Not Loading
# Check if settings.json is valid JSON
jq empty ~/.gemini/settings.json
# Check if mcpServers section exists
jq '.mcpServers.whoisxmlapi' ~/.gemini/settings.json
# Verify environment variables are set
echo $WHOISXMLAPI_TOKEN
Tools Not Available
# Check if server is excluded globally
jq '.mcp.excluded' ~/.gemini/settings.json
# Check tool include/exclude lists for the server
jq '.mcpServers.whoisxmlapi.includeTools' ~/.gemini/settings.json
jq '.mcpServers.whoisxmlapi.excludeTools' ~/.gemini/settings.json
# Test server can start independently with npx
npx @whoisxmlapidotcom/mcp-whoisxmlapi --version
Permission Issues
# Check if server is trusted (bypasses confirmations)
jq '.mcpServers.whoisxmlapi.trust' ~/.gemini/settings.json
# Check global tool allowlist
jq '.tools.allowed' ~/.gemini/settings.json
Configuration File Locations
Different configuration files have different precedence:
# User settings (most common)
~/.gemini/settings.json
# Project-specific settings (overrides user settings)
.gemini/settings.json
# System-wide settings (highest precedence)
/etc/gemini-cli/settings.json # Linux
/Library/Application Support/GeminiCli/settings.json # macOS
C:\ProgramData\gemini-cli\settings.json # Windows
Example Complete Configuration
Here's a complete example with all common settings:
{
"mcpServers": {
"whoisxmlapi": {
"command": "npx",
"args": ["-y", "@whoisxmlapidotcom/mcp-whoisxmlapi"],
"env": {
"WHOISXMLAPI_TOKEN": "${WHOISXMLAPI_TOKEN}"
},
"description": "Domain intelligence and security analysis",
"trust": false,
"timeout": 30000,
"includeTools": [
"mcp_whoisxmlapi_whois",
"mcp_whoisxmlapi_dns_lookup",
"mcp_whoisxmlapi_threat_intelligence"
]
}
},
"tools": {
"allowed": [
"mcp_whoisxmlapi_whois",
"mcp_whoisxmlapi_dns_lookup"
]
},
"mcp": {
"allowed": ["whoisxmlapi"]
}
}
Troubleshooting
Common Issues
1. Authentication Problems
# For OAuth authentication, simply restart Gemini CLI
gemini
# For API keys, verify environment variables are set
echo $GEMINI_API_KEY
echo $GOOGLE_API_KEY
echo $WHOISXMLAPI_TOKEN
# For Vertex AI, check additional variables
echo $GOOGLE_CLOUD_PROJECT
echo $GOOGLE_GENAI_USE_VERTEXAI
# Test basic functionality
gemini -p "Hello, are you working?"
2. MCP Server Issues
# Check your MCP configuration file
cat ~/.gemini/settings.json
# Verify the mcpServers section exists and is properly formatted
jq '.mcpServers' ~/.gemini/settings.json
# Test MCP server independently with npx
npx @whoisxmlapidotcom/mcp-whoisxmlapi --help
# Check for server conflicts or exclusions
jq '.mcp.excluded // []' ~/.gemini/settings.json
jq '.mcp.allowed // []' ~/.gemini/settings.json
# Start Gemini CLI and test with natural language
gemini
> "Test WhoisXMLAPI by looking up google.com"
# Common MCP configuration issues:
# - Missing environment variables in server config
# - Incorrect command paths or arguments
# - Server excluded in mcp.excluded array
# - Tool name conflicts with other servers
3. Installation Issues
# Check Gemini CLI version
gemini --version
# Update to latest version
brew upgrade gemini-cli # macOS/Linux
# or
npm update -g @google/gemini-cli # npm installation
# Verify PATH
which gemini
# If PATH issues, try reinstalling
npm uninstall -g @google/gemini-cli
npm install -g @google/gemini-cli
4. Tool Access Issues
# Verify WhoisXMLAPI token
export WHOISXMLAPI_TOKEN="your-token"
# Test MCP server independently with npx
npx @whoisxmlapidotcom/mcp-whoisxmlapi --help
# Check MCP configuration
cat ~/.gemini/settings.json
# Test in Gemini CLI
gemini
> "Test the WhoisXMLAPI connection by looking up a domain"
5. Rate Limits
# For free tier users hitting limits, consider:
# - Spacing out requests (60 requests/min, 1,000/day for OAuth)
# - Using API keys for different limits (100 requests/day for free tier)
# - Upgrading to paid plans for higher limits
# - Using different authentication methods (OAuth vs API key vs Vertex AI)
Advanced Features
Context Window Advantage
One of Gemini CLI's biggest advantages is the massive 1 million token context window:
# Analyze multiple domains in a single request
gemini "Perform a comprehensive security analysis of these 50 domains with their full WHOIS data, DNS configurations, and SSL certificates: [list of domains...]"
# Process large datasets
cat domain_list.txt | gemini "Analyze each domain in this list for security issues and provide a detailed report"
# Maintain context across complex queries
gemini "Start a security audit session for example.com. First get WHOIS data, then DNS records, then SSL certificate info, and finally provide recommendations based on all the data."
Google Search Integration
Combine real-time web data with WhoisXMLAPI intelligence:
# Research domains with current threat intelligence
gemini "Search for recent security news about github.com, then analyze its current domain configuration using WHOIS and DNS data"
# Market research with domain intelligence
gemini "Find information about the company behind cloudflare.com, then analyze their domain infrastructure and security setup"
System Prompts (GEMINI.md)
Create a GEMINI.md file in your project directory to customize behavior:
# Domain Security Analyst
You are a cybersecurity expert specializing in domain analysis. When users ask about domains:
1. Always use WhoisXMLAPI tools to gather technical data
2. Provide security-focused analysis
3. Highlight potential risks or vulnerabilities
4. Suggest improvements when appropriate
5. Format responses clearly with sections for different data types
## Available Tools
- WHOIS lookup for domain ownership
- DNS analysis for configuration
- SSL certificate verification
- IP geolocation
- Email verification
- Threat intelligence
Configuration Options
Configuration is managed through ~/.gemini/settings.json. Example configuration:
{
"model": "gemini-2.5-pro",
"outputFormat": "markdown",
"temperature": 0.3,
"mcpServers": {
"whoisxmlapi": {
"command": "npx",
"args": ["-y", "@whoisxmlapidotcom/mcp-whoisxmlapi"],
"env": {
"WHOISXMLAPI_TOKEN": "${WHOISXMLAPI_TOKEN}"
}
}
}
}
Security Considerations
Best Practices
- Store API tokens securely as environment variables
- Never commit tokens to version control
- Use Google account authentication when possible (more secure than API keys)
- Regularly review MCP server permissions
- Monitor usage and set appropriate limits
Getting Help
If you need assistance:
Official Resources
- Gemini CLI GitHub Repository - Official source code and issues
- Gemini CLI Announcement - Feature overview and updates
- Google AI Studio - For API key management
WhoisXML API MCP Server Support
- WhoisXML API MCP Server Tools Reference - All available tools and capabilities
- Troubleshooting Guide - Common issues and solutions
- WhoisXMLAPI Support - API-specific assistance
Community Resources
- Model Context Protocol - MCP standard and community
- AI Client Configuration - Setup guides for other AI clients
Related Documentation
- Installation Methods - Compare Docker, npx, and binary options
- Docker Usage - Container deployment guide
- Node.js Setup - Required for npx execution