docs/netdata-ai/mcp/README.md
Model Context Protocol (MCP) works in two directions with Netdata:
The rest of this page covers Netdata as an MCP server.
Netdata provides MCP servers that enable AI assistants to interact with your infrastructure monitoring data. You can connect via:
https://app.netdata.cloud/api/v1/mcp with full visibility across all your nodes. No bridges, no firewall changes.http://YOUR_IP:19999/mcp.Both options provide comprehensive access to all available observability data through MCP:
processes, network-connections, streaming, systemd-journal, windows-events, etc.AI assistants have different visibility depending on where they connect:
| Connection | Visibility |
|---|---|
| Netdata Cloud | All nodes across your entire infrastructure |
| Netdata Parent | All child nodes connected to that parent |
| Netdata Child/Standalone | Only that specific node |
| Feature | Cloud MCP | Agent/Parent MCP |
|---|---|---|
| Scope | All nodes | Single agent/parent |
| Endpoint | app.netdata.cloud/api/v1/mcp | YOUR_IP:19999/mcp |
| Transport | Streamable HTTP | HTTP, SSE, WebSocket |
| Authentication | Cloud API token (scope:mcp) | Local MCP API key (mandatory when bearer protection is enabled) |
| Network access | Internet only | Direct access to Netdata IP required |
| Local setup | None | Bridge may be needed for some clients |
Connect AI assistants to your entire Netdata Cloud infrastructure through a single MCP endpoint — no local setup, no bridges, no firewall changes.
scope:mcp — Create one in API Tokens settingshttps://app.netdata.cloud/api/v1/mcp
Transport: Streamable HTTP (stateless, works behind load balancers and CDNs)
All requests to the Cloud MCP endpoint require a
Bearer token in the Authorization header:
Authorization: Bearer YOUR_NETDATA_CLOUD_API_TOKEN
scope:mcpFor more details, see API Tokens.
If you're using Claude Code, you can register the Netdata Cloud MCP server from any session with a single command — no JSON editing required:
claude mcp add --transport http --scope user netdata-cloud \
https://app.netdata.cloud/api/v1/mcp \
--header "Authorization: Bearer YOUR_NETDATA_CLOUD_API_TOKEN"
Replace YOUR_NETDATA_CLOUD_API_TOKEN with a token that has scope:mcp — see Creating an API Token above, or go directly to User Settings → API Tokens in Netdata Cloud.
Scope flags:
--scope user — available in all your projects on this machine (recommended for personal use)--scope local — this project only, private to you (default when --scope is omitted)--scope project — this project, checked into .mcp.json and shared with your team (do not use with a raw token; reference an environment variable instead)Useful companion commands:
claude mcp list # show all configured servers and their connection status
claude mcp get netdata-cloud # show the configuration for this server
claude mcp remove netdata-cloud -s user # remove the server (match the scope you added with)
Restart the Claude Code session after adding the server so the new tools load.
For more Claude Code options — including connecting to a local Netdata Agent or Parent — see the Claude Code guide.
For any MCP client that supports Streamable HTTP transport:
{
"mcpServers": {
"netdata-cloud": {
"type": "http",
"url": "https://app.netdata.cloud/api/v1/mcp",
"headers": {
"Authorization": "Bearer YOUR_NETDATA_CLOUD_API_TOKEN"
}
}
}
}
For MCP clients that only support stdio transport, use npx mcp-remote as a bridge:
{
"mcpServers": {
"netdata-cloud": {
"command": "npx",
"args": [
"mcp-remote@latest",
"https://app.netdata.cloud/api/v1/mcp",
"--header",
"Authorization: Bearer YOUR_NETDATA_CLOUD_API_TOKEN"
]
}
}
}
Replace YOUR_NETDATA_CLOUD_API_TOKEN with your
API token
(must have scope:mcp).
scope:mcpAuthorization: Bearer <token> (not as a query parameter)--allow-http flag is neededcurl -H "Authorization: Bearer YOUR_TOKEN" https://app.netdata.cloud/api/v1/mcpConnect directly to any Netdata Agent or Parent on your network. All Netdata Agents and Parents (v2.6.0+) include a built-in MCP server at http://YOUR_IP:19999/mcp.
Netdata generates a local MCP API key automatically on startup. Authentication behavior depends on [web].bearer token protection:
no): anonymous MCP access works for non-sensitive operations (metrics, alerts, node info). The API key unlocks sensitive operations.yes): anonymous MCP access is rejected on all MCP transports (HTTP, SSE, WebSocket). The API key is required for all MCP requests.Netdata implements the MCP protocol with multiple transport options:
| Transport | Endpoint | Use Case | Version Requirement |
|---|---|---|---|
| WebSocket | ws://YOUR_IP:19999/mcp | Original transport, requires nd-mcp bridge for stdio clients | v2.6.0+ |
| HTTP Streamable | http://YOUR_IP:19999/mcp | Direct connection from AI clients supporting HTTP | v2.7.2+ |
| SSE | http://YOUR_IP:19999/sse | Server-Sent Events for real-time streaming | v2.7.2+ |
nd-mcp (stdio-to-websocket) or mcp-remote (stdio-to-http or stdio-to-sse) bridgeAuthorization: Bearer <mcp_key>.?api_key=<mcp_key>. Keep this only for legacy clients, since URL query strings are more likely to be logged by proxies and tools.netdata.confUse a dedicated MCP ACL to control network-level MCP access independently from dashboard and streaming:
[web]
allow connections from = 10.* 192.168.* localhost
allow dashboard from = 10.* 192.168.* localhost
allow mcp from = 10.* 192.168.* localhost
allow streaming from = *
allow mcp by dns = heuristic
allow mcp from controls /mcp, /sse, and MCP WebSocket protocol access.allow connections from is still the global first gate for all features.allow mcp from restricted to trusted networks.If your AI client doesn't support HTTP/SSE directly and you don't want to use nd-mcp, you can use the official MCP remote client (requires Netdata v2.7.2+):
# Export your MCP key once per shell
export NETDATA_MCP_API_KEY="$(cat /var/lib/netdata/mcp_dev_preview_api_key)"
# For HTTP transport
npx mcp-remote@latest --http http://YOUR_NETDATA_IP:19999/mcp \
--allow-http \
--header "Authorization: Bearer $NETDATA_MCP_API_KEY"
# For SSE transport
npx mcp-remote@latest --sse http://YOUR_NETDATA_IP:19999/mcp \
--allow-http \
--header "Authorization: Bearer $NETDATA_MCP_API_KEY"
Note: The --allow-http flag is required for non-HTTPS connections. Only use this on trusted networks as traffic will not be encrypted.
Note: With the new HTTP and SSE transports, many AI clients can now connect directly to Netdata without nd-mcp. Check your AI client's documentation to see if it supports direct HTTP or SSE connections.
The nd-mcp bridge is only needed for AI clients that:
stdio communication (like some desktop applications)npx mcp-remote@latestThe nd-mcp bridge needs to be available on your desktop or laptop where your AI client runs. Since most users run Netdata on remote servers rather than their local machines, you have two options:
If you have Netdata installed on your desktop/laptop, find the existing bridge:
# Try these locations in order:
which nd-mcp
ls -la /usr/sbin/nd-mcp
ls -la /usr/bin/nd-mcp
ls -la /opt/netdata/usr/bin/nd-mcp
ls -la /usr/local/bin/nd-mcp
ls -la /usr/local/netdata/usr/bin/nd-mcp
# Or search for it:
find / -name "nd-mcp" 2>/dev/null
Common locations:
/usr/sbin/nd-mcp or /usr/bin/nd-mcp/opt/netdata/usr/bin/nd-mcp/usr/local/netdata/usr/bin/nd-mcp# Try these locations:
which nd-mcp
ls -la /usr/local/bin/nd-mcp
ls -la /usr/local/netdata/usr/bin/nd-mcp
ls -la /opt/homebrew/bin/nd-mcp
# Or search for it:
find / -name "nd-mcp" 2>/dev/null
# Check common locations:
dir "C:\Program Files\Netdata\usr\bin\nd-mcp.exe"
dir "C:\Netdata\usr\bin\nd-mcp.exe"
# Or search for it:
where nd-mcp.exe
If you don't have Netdata installed locally you can build just the nd-mcp bridge. Netdata provides three implementations - choose the one that best fits your environment:
Go bridge (recommended) - Go bridge source code
nd-mcp (nd-mcp.exe on windows)build.sh and build.bat (for Windows)Node.js bridge - Node.js bridge source code
nd-mcp.jsbuild.shPython bridge - Python bridge source code
nd-mcp.pybuild.shTo build:
# Clone the Netdata repository
git clone https://github.com/netdata/netdata.git
cd netdata
# Choose your preferred implementation
cd src/web/mcp/bridges/stdio-golang/ # or stdio-nodejs/ or stdio-python/
# Build the bridge
./build.sh # On Windows with the Go version, use build.bat
# The executable will be created with different names:
# - Go: nd-mcp
# - Node.js: nd-mcp.js
# - Python: nd-mcp.py
# Test the bridge with your Netdata instance (replace localhost with your Netdata IP)
./nd-mcp ws://localhost:19999/mcp # Go bridge
./nd-mcp.js ws://localhost:19999/mcp # Node.js bridge
./nd-mcp.py ws://localhost:19999/mcp # Python bridge
# You should see:
# nd-mcp: Connecting to ws://localhost:19999/mcp...
# nd-mcp: Connected
# Press Ctrl+C to stop the test
# Get the absolute path for your AI client configuration
pwd # Shows current directory
# Example output: /home/user/netdata/src/web/mcp/bridges/stdio-golang
# Your nd-mcp path would be: /home/user/netdata/src/web/mcp/bridges/stdio-golang/nd-mcp
Important: When configuring your AI client, use the full absolute path to the executable:
/path/to/bridges/stdio-golang/nd-mcp/path/to/bridges/stdio-nodejs/nd-mcp.js/path/to/bridges/stdio-python/nd-mcp.pyOnce you have nd-mcp (either from existing installation or built), test it:
# Test connection to your Netdata instance (replace YOUR_NETDATA_IP with actual IP)
/path/to/nd-mcp ws://YOUR_NETDATA_IP:19999/mcp
# You should see:
# nd-mcp: Connecting to ws://YOUR_NETDATA_IP:19999/mcp...
# nd-mcp: Connected
# Press Ctrl+C to stop the test
The official MCP remote client (mcp-remote) is an alternative bridge that enables stdio-only AI clients to connect to Netdata's HTTP and SSE transports (requires Netdata v2.7.2+). Unlike nd-mcp which only supports WebSocket, mcp-remote provides broader transport compatibility.
Use mcp-remote when:
No installation required - mcp-remote runs via npx:
# Test the connection
npx mcp-remote@latest --http http://YOUR_NETDATA_IP:19999/mcp \
--allow-http \
--header "Authorization: Bearer YOUR_API_KEY"
mcp-remote supports multiple transport strategies:
# HTTP transport (recommended)
npx mcp-remote@latest --http http://YOUR_NETDATA_IP:19999/mcp \
--allow-http \
--header "Authorization: Bearer YOUR_API_KEY"
# SSE transport
npx mcp-remote@latest --sse http://YOUR_NETDATA_IP:19999/mcp \
--allow-http \
--header "Authorization: Bearer YOUR_API_KEY"
# Auto-detect with fallback (tries SSE first, falls back to HTTP)
npx mcp-remote@latest --transport sse-first http://YOUR_NETDATA_IP:19999/mcp \
--allow-http \
--header "Authorization: Bearer YOUR_API_KEY"
# HTTPS (no --allow-http flag needed)
npx mcp-remote@latest --http https://YOUR_NETDATA_IP:19999/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
| Option | Description | Example |
|---|---|---|
--http | Use HTTP transport | --http http://host:19999/mcp |
--sse | Use SSE transport | --sse http://host:19999/mcp |
--allow-http | Allow non-HTTPS connections (required for HTTP URLs) | --allow-http |
--header | Add custom headers (for authentication) | --header "Authorization: Bearer KEY" |
--transport | Transport strategy | --transport sse-first (tries SSE, falls back to HTTP) |
--debug | Enable debug logging | --debug |
--host | OAuth callback host (default: localhost) | --host 127.0.0.1 |
| Port number | OAuth callback port (optional) | 9696 |
For Netdata MCP, pass the API key via the Authorization header:
# Using environment variable (recommended)
export NETDATA_MCP_API_KEY="$(cat /var/lib/netdata/mcp_dev_preview_api_key)"
npx mcp-remote@latest --http http://YOUR_NETDATA_IP:19999/mcp \
--allow-http \
--header "Authorization: Bearer $NETDATA_MCP_API_KEY"
Security Note: The --allow-http flag is required for non-HTTPS connections. Only use this on trusted networks as traffic will not be encrypted.
Connection Issues:
# Enable debug logging
npx mcp-remote@latest --debug --http http://YOUR_NETDATA_IP:19999/mcp \
--allow-http \
--header "Authorization: Bearer YOUR_API_KEY"
# Check debug logs (stored in ~/.mcp-auth/)
cat ~/.mcp-auth/*_debug.log
Clear Authentication State:
# Remove cached credentials
rm -rf ~/.mcp-auth
Spaces in Arguments:
Some AI clients (Cursor, Claude Desktop on Windows) have issues with spaces in arguments. Use environment variables as a workaround:
{
"mcpServers": {
"netdata": {
"command": "npx",
"args": [
"mcp-remote@latest",
"--http",
"http://YOUR_IP:19999/mcp",
"--allow-http",
"--header",
"Authorization: Bearer YOUR_API_KEY"
]
}
}
}
Always use the latest version:
# Force npx to check for latest version
npx mcp-remote@latest --http http://YOUR_NETDATA_IP:19999/mcp
Or in AI client configurations:
{
"args": ["mcp-remote@latest", "--http", "..."]
}
For more details, see the official mcp-remote documentation.
You need the MCP API key when bearer protection is enabled. When bearer protection is disabled, the key is still needed for sensitive functions like logs and live system information. Netdata automatically generates an API key on startup. The key is stored in a file on the Netdata server you want to connect to.
You need the API key of the Netdata you will connect to (usually a Netdata Parent).
Note: This temporary API key mechanism will eventually be replaced by integration with Netdata Cloud.
# Try the default location first:
sudo cat /var/lib/netdata/mcp_dev_preview_api_key
# For static installations:
sudo cat /opt/netdata/var/lib/netdata/mcp_dev_preview_api_key
# If not found, search for it:
sudo find / -name "mcp_dev_preview_api_key" 2>/dev/null
The file contains a UUID that looks like:
a1b2c3d4-e5f6-7890-abcd-ef1234567890
Copy this entire string - you'll need it for your AI client configuration.
If the file doesn't exist:
sudo systemctl restart netdataAI clients can connect to Netdata MCP in different ways depending on their transport support:
For AI clients that support HTTP or SSE transports:
{
"mcpServers": {
"netdata": {
"type": "http",
"url": "http://IP_OF_YOUR_NETDATA:19999/mcp",
"headers": [
"Authorization: Bearer YOUR_API_KEY"
]
}
}
}
Or for SSE:
{
"mcpServers": {
"netdata": {
"type": "sse",
"url": "http://IP_OF_YOUR_NETDATA:19999/mcp?transport=sse",
"headers": [
"Authorization: Bearer YOUR_API_KEY"
]
}
}
}
For AI clients that only support stdio:
{
"mcpServers": {
"netdata": {
"command": "/usr/sbin/nd-mcp",
"args": [
"--bearer",
"YOUR_API_KEY",
"ws://IP_OF_YOUR_NETDATA:19999/mcp"
]
}
}
}
{
"mcpServers": {
"netdata": {
"command": "npx",
"args": [
"mcp-remote@latest",
"--http",
"http://IP_OF_YOUR_NETDATA:19999/mcp",
"--header",
"Authorization: Bearer YOUR_API_KEY"
]
}
}
}
Replace:
IP_OF_YOUR_NETDATA: Your Netdata instance IP/hostnameYOUR_API_KEY: The API key from the file mentioned above/usr/sbin/nd-mcp: With your actual nd-mcp path (if using the bridge)You can configure multiple Netdata instances:
{
"mcpServers": {
"netdata-production": {
"command": "/usr/sbin/nd-mcp",
"args": ["--bearer", "PROD_KEY", "ws://prod-parent:19999/mcp"]
},
"netdata-testing": {
"command": "/usr/sbin/nd-mcp",
"args": ["--bearer", "TEST_KEY", "ws://test-parent:19999/mcp"]
}
}
}
For compatibility with older tooling, Netdata still accepts the ?api_key=YOUR_API_KEY query parameter on the /mcp endpoints. New integrations should prefer the Authorization: Bearer YOUR_API_KEY header, but the query-string form remains available if you are migrating gradually.
For detailed configuration instructions for specific AI clients, see:
Chat Clients:
DevOps Copilots:
Each guide includes specific transport support matrices and configuration examples optimized for that client.