| 1 | # Netdata MCP Bridges |
| 2 | |
| 3 | This directory contains bridge programs that convert MCP stdio communication to Netdata's MCP over WebSocket. These bridges allow you to use standard I/O based AI models and tools with Netdata's Model Context Protocol. |
| 4 | |
| 5 | ## Available Bridges |
| 6 | |
| 7 | Three implementations are provided to accommodate different environments, each in its own subdirectory: |
| 8 | |
| 9 | - [`stdio-python/`](stdio-python/) - Python implementation |
| 10 | - [`stdio-nodejs/`](stdio-nodejs/) - JavaScript (Node.js) implementation |
| 11 | - [`stdio-golang/`](stdio-golang/) - Go implementation |
| 12 | |
| 13 | Each subdirectory contains: |
| 14 | - The bridge implementation |
| 15 | - A README.md with detailed installation and usage instructions specific to that implementation |
| 16 | |
| 17 | ## Common Usage |
| 18 | |
| 19 | All bridges follow the same usage pattern, accepting a WebSocket URL as their only parameter: |
| 20 | |
| 21 | ``` |
| 22 | <bridge-program> ws://<ip>:19999/mcp |
| 23 | ``` |
| 24 | |
| 25 | Where `<ip>` is either `localhost` or the IP address where a Netdata instance is listening. |
| 26 | |
| 27 | The bridge reads from standard input and writes to standard output, allowing you to pipe AI model output through it to connect with Netdata MCP. |
| 28 | |
| 29 | ## Claude Desktop Configuration |
| 30 | |
| 31 | To use Claude Desktop with Netdata's MCP, you can configure it to use one of these bridges. Here's how to set it up: |
| 32 | |
| 33 | 1. Select and install one of the bridge implementations from the subdirectories |
| 34 | 2. In Claude Desktop settings, configure the Custom Command option to point to your chosen bridge |
| 35 | 3. If your Netdata instance is running on a different machine, replace `localhost` with the appropriate IP address |
| 36 | |
| 37 | This configuration allows Claude Desktop to communicate directly with your Netdata instance, providing it with contextual information from your monitoring environment. |
| 38 | |
| 39 | For detailed instructions specific to each implementation, refer to the README.md in the corresponding subdirectory. |
| 40 | |
| 41 | ## Connection Reliability |
| 42 | |
| 43 | All bridge implementations include robust connection handling features: |
| 44 | |
| 45 | - **Automatic Reconnection**: If the WebSocket connection is lost for any reason, the bridges will automatically attempt to reconnect |
| 46 | - **Exponential Backoff**: Reconnection attempts use exponential backoff with jitter to avoid overwhelming the server |
| 47 | - **Message Queuing**: Messages sent while disconnected are queued and delivered once reconnected |
| 48 | - **Connection Status Logging**: All bridges log connection status to stderr for monitoring |
| 49 | |
| 50 | These features ensure that temporary network issues or Netdata server restarts don't disrupt your AI model's integration, providing a resilient connection that automatically recovers from failures. |
| 51 | |
| 52 | ## Protocol Compatibility |
| 53 | |
| 54 | Netdata MCP implements the JSON-RPC 2.0 protocol for communication. The bridges pass messages directly between the AI model's standard I/O and the WebSocket connection without modification. |
| 55 | |
| 56 | Important compatibility notes: |
| 57 | - Netdata MCP expects JSON-RPC 2.0 compatible messages |
| 58 | - Messages that don't conform to the JSON-RPC 2.0 format are silently ignored |
| 59 | - Ensure your AI model or tool produces properly formatted JSON-RPC 2.0 messages for full compatibility |