Gemini CLI
Configure Google's Gemini CLI to access your Netdata infrastructure through MCP for powerful AI-driven operations.
Prerequisites
- Gemini CLI installed - Available from GitHub
- The IP and port (usually 19999) of a running Netdata Agent - Prefer a Netdata Parent to get infrastructure level visibility. Currently the latest nightly version of Netdata has MCP support (not released to the stable channel yet). Your AI Client (running on your desktop or laptop) needs to have direct network access to this IP and port.
nd-mcp
program available on your desktop or laptop - This is the bridge that translatesstdio
towebsocket
, connecting your AI Client to your Netdata Agent or Parent. Find its absolute path- Optionally, the Netdata MCP API key that unlocks full access to sensitive observability data (protected functions, full access to logs) on your Netdata. Each Netdata Agent or Parent has its own unique API key for MCP - Find your Netdata MCP API key
Installation
# Run Gemini CLI directly from GitHub
npx https://github.com/google-gemini/gemini-cli
# Or clone and install locally
git clone https://github.com/google-gemini/gemini-cli.git
cd gemini-cli
npm install
npm run build
Configuration
Gemini CLI has built-in MCP server support. For detailed MCP configuration, see the official MCP documentation.
Adding Netdata MCP Server
Configure your Gemini settings to include the Netdata MCP server:
# Edit Gemini settings file
~/.gemini/settings.json
Add your Netdata MCP server configuration:
{
"mcpServers": {
"netdata": {
"command": "/usr/sbin/nd-mcp",
"args": ["ws://YOUR_NETDATA_IP:19999/mcp?api_key=NETDATA_MCP_API_KEY"]
}
}
}
Verify MCP Configuration
Use the /mcp
command to verify your setup:
# List configured MCP servers
/mcp
# Show detailed descriptions of MCP servers and tools
/mcp desc
# Show MCP server schema details
/mcp schema
Replace:
/usr/sbin/nd-mcp
- With your actual nd-mcp pathYOUR_NETDATA_IP
- IP address or hostname of your Netdata Agent/ParentNETDATA_MCP_API_KEY
- Your Netdata MCP API key
How to Use
Gemini CLI can leverage Netdata's observability data for infrastructure analysis and automation:
What's the current system performance across all monitored servers?
Show me any performance anomalies in the last 2 hours
Which services are consuming the most resources right now?
Analyze the database performance trends over the past week
Example Workflows
Performance Investigation:
Investigate why our application response times increased this afternoon
Resource Optimization:
Check memory usage patterns and suggest optimization strategies
Alert Analysis:
Explain the current active alerts and their potential impact
💡 Advanced Usage: Gemini CLI can combine observability data with system automation for powerful DevOps workflows. Learn about the opportunities and security considerations in AI DevOps Copilot.
Troubleshooting
MCP Connection Issues
- Verify Netdata is accessible:
curl http://YOUR_NETDATA_IP:19999/api/v3/info
- Check that the bridge path exists and is executable
- Ensure API key is correct and properly formatted
Limited Data Access
- Verify API key is included in the connection string
- Check that the Netdata agent is properly configured for MCP
- Ensure network connectivity between Gemini CLI and Netdata
Command Execution Problems
- Review command syntax for your specific Gemini CLI version
- Check MCP server configuration parameters
- Verify that MCP protocol is supported in your Gemini CLI installation
Documentation Links
Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.