docs/netdata-ai/mcp/mcp-clients/crush.md
Configure Crush by Charmbracelet to access your Netdata infrastructure through MCP for glamorous terminal-based AI operations.
Crush has comprehensive MCP transport support, making it highly flexible for connecting to Netdata:
| Transport | Support | Netdata Version | Use Case |
|---|---|---|---|
| stdio (via nd-mcp bridge) | ✅ Fully Supported | v2.6.0+ | Local bridge to WebSocket |
| Streamable HTTP | ✅ Fully Supported | v2.7.2+ | Direct connection to Netdata's HTTP endpoint (recommended) |
| SSE (Server-Sent Events) | ✅ Fully Supported | v2.7.2+ | Direct connection to Netdata's SSE endpoint |
| WebSocket | ❌ Not Supported | - | Use nd-mcp bridge or HTTP/SSE instead |
nd-mcp bridgend-mcp bridge - The stdio-to-websocket bridge. Find its absolute path. Not needed for direct HTTP/SSE connections on v2.7.2+.Export
ND_MCP_BEARER_TOKENwith your MCP key before launching Crush so credentials never appear in command-line arguments or config files:bashexport ND_MCP_BEARER_TOKEN="$(cat /var/lib/netdata/mcp_dev_preview_api_key)"
Install Crush using one of these methods:
# Homebrew (recommended for macOS)
brew install charmbracelet/tap/crush
# NPM
npm install -g @charmland/crush
# Arch Linux
yay -S crush-bin
# Windows (Winget)
winget install charmbracelet.crush
# Windows (Scoop)
scoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git
scoop install crush
# Or install with Go
go install github.com/charmbracelet/crush@latest
Crush uses JSON configuration files with the following priority:
.crush.json (project-specific)crush.json (project-specific)~/.config/crush/crush.json (global)Connect to your entire Netdata Cloud infrastructure through a single endpoint — no local setup, bridges, or firewall changes needed.
Prerequisites:
scope:mcp
(create one){
"$schema": "https://charm.land/crush.json",
"mcp": {
"netdata-cloud": {
"type": "http",
"url": "https://app.netdata.cloud/api/v1/mcp",
"headers": {
"Authorization": "Bearer YOUR_NETDATA_CLOUD_API_TOKEN"
},
"timeout": 120,
"disabled": false
}
}
}
Replace YOUR_NETDATA_CLOUD_API_TOKEN with your
Netdata Cloud API token (must have scope:mcp).
For more details, see
Netdata Cloud MCP.
The following methods connect directly to a Netdata Agent or Parent on your network.
Connect directly to Netdata's HTTP endpoint without needing the nd-mcp bridge:
{
"$schema": "https://charm.land/crush.json",
"mcp": {
"netdata": {
"type": "http",
"url": "http://YOUR_NETDATA_IP:19999/mcp",
"headers": {
"Authorization": "Bearer NETDATA_MCP_API_KEY"
},
"timeout": 120,
"disabled": false
}
}
}
For HTTPS connections:
{
"$schema": "https://charm.land/crush.json",
"mcp": {
"netdata": {
"type": "http",
"url": "https://YOUR_NETDATA_IP:19999/mcp",
"headers": {
"Authorization": "Bearer NETDATA_MCP_API_KEY"
},
"timeout": 120
}
}
}
Connect directly to Netdata's SSE endpoint for real-time streaming:
{
"$schema": "https://charm.land/crush.json",
"mcp": {
"netdata": {
"type": "sse",
"url": "http://YOUR_NETDATA_IP:19999/mcp?transport=sse",
"headers": {
"Authorization": "Bearer NETDATA_MCP_API_KEY"
},
"timeout": 120,
"disabled": false
}
}
}
For environments where you prefer or need to use the bridge:
{
"$schema": "https://charm.land/crush.json",
"mcp": {
"netdata": {
"type": "stdio",
"command": "/usr/sbin/nd-mcp",
"args": ["ws://YOUR_NETDATA_IP:19999/mcp"],
"timeout": 120,
"disabled": false
}
}
}
If nd-mcp is not available, use the official MCP remote client (requires Netdata v2.7.2+). For detailed options and troubleshooting, see Using MCP Remote Client.
{
"$schema": "https://charm.land/crush.json",
"mcp": {
"netdata": {
"type": "stdio",
"command": "npx",
"args": [
"mcp-remote@latest",
"--http",
"http://YOUR_NETDATA_IP:19999/mcp",
"--allow-http",
"--header",
"Authorization: Bearer NETDATA_MCP_API_KEY"
],
"timeout": 120
}
}
}
Crush supports environment variable expansion using $(echo $VAR) syntax:
{
"$schema": "https://charm.land/crush.json",
"mcp": {
"netdata": {
"type": "http",
"url": "http://YOUR_NETDATA_IP:19999/mcp",
"headers": {
"Authorization": "Bearer $(echo $NETDATA_API_KEY)"
},
"timeout": 120
}
}
}
Create project-specific configurations by placing .crush.json or crush.json in your project root:
{
"$schema": "https://charm.land/crush.json",
"mcp": {
"netdata-prod": {
"type": "http",
"url": "https://prod-parent.company.com:19999/mcp",
"headers": {
"Authorization": "Bearer $(echo $PROD_API_KEY)"
},
"timeout": 120
},
"netdata-staging": {
"type": "sse",
"url": "https://staging-parent.company.com:19999/mcp?transport=sse",
"headers": {
"Authorization": "Bearer $(echo $STAGING_API_KEY)"
},
"timeout": 120
}
}
}
Replace in all examples:
YOUR_NETDATA_IP - IP address or hostname of your Netdata Agent/ParentNETDATA_MCP_API_KEY - Your Netdata MCP API key/usr/sbin/nd-mcp - With your actual nd-mcp path (stdio method only)Once configured, start Crush and it will automatically connect to your Netdata MCP servers:
# Start Crush
crush
# Ask infrastructure questions
What's the current CPU usage across all servers?
Show me any performance anomalies in the last hour
Which services are consuming the most resources?
Crush asks for permission before running tools by default. You can pre-approve certain Netdata tools:
{
"$schema": "https://charm.land/crush.json",
"permissions": {
"allowed_tools": [
"mcp_netdata_list_metrics",
"mcp_netdata_query_metrics",
"mcp_netdata_list_nodes",
"mcp_netdata_list_alerts"
]
}
}
⚠️ Warning: Use the
--yoloflag to bypass all permission prompts, but be extremely careful with this feature.
Performance Investigation:
Investigate why our application response times increased this afternoon using Netdata metrics
Resource Optimization:
Check memory usage patterns across all nodes and suggest optimization strategies
Alert Analysis:
Explain the current active alerts from Netdata and their potential impact
Anomaly Detection:
Find any anomalous metrics in the last 2 hours and explain what might be causing them
💡 Advanced Usage: Crush can combine observability data with its terminal-based interface for powerful DevOps workflows. Learn about the opportunities and security considerations in AI DevOps Copilot.
curl http://YOUR_NETDATA_IP:19999/api/v3/info"disabled": false)timeout value in your configuration (default is 120 seconds)$(echo $VAR) syntax, not $VAR or ${VAR}echo $NETDATA_API_KEY to verify the variable is setConfigure different Netdata instances using different transport methods:
{
"$schema": "https://charm.land/crush.json",
"mcp": {
"netdata-local": {
"type": "stdio",
"command": "/usr/sbin/nd-mcp",
"args": ["ws://localhost:19999/mcp"],
"timeout": 60
},
"netdata-parent": {
"type": "http",
"url": "https://parent.company.com:19999/mcp",
"headers": {
"Authorization": "Bearer ${PARENT_API_KEY}"
},
"timeout": 180
},
"netdata-streaming": {
"type": "sse",
"url": "https://stream-parent.company.com:19999/mcp?transport=sse",
"headers": {
"Authorization": "Bearer ${STREAM_API_KEY}"
},
"timeout": 300
}
}
}
ℹ️ Before switching between environments, export
ND_MCP_BEARER_TOKENwith the matching key so the bridge authenticates without exposing credentials in the JSON file.
Enable debug logging to troubleshoot MCP issues:
{
"$schema": "https://charm.land/crush.json",
"options": {
"debug": true
}
}
View logs:
# View recent logs
crush logs
# Follow logs in real-time
crush logs --follow