feat: add ENABLE_ND_MCP cmake flag to build nd-mcp independently of go.d.plugin (#22313)
Co-authored-by: ilyam8 <22274335+ilyam8@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot committed
Apr 30, 2026 at 14:20 UTC
583804d1e1ae544797263865fad910cfc8628002
1 file changed
+13
-10
CMakeLists.txt
+13
-10
@@ -141,6 +141,7 @@ mark_as_advanced(ENABLE_DASHBOARD)
141
142
# Data collection plugins
143
option(ENABLE_PLUGIN_GO "Enable metric collectors written in Go" ${DEFAULT_FEATURE_STATE})
144
+cmake_dependent_option(ENABLE_ND_MCP "Build nd-mcp stdio-to-websocket bridge for MCP integration" ${DEFAULT_FEATURE_STATE} "ENABLE_PLUGIN_GO" False)
145
option(ENABLE_PLUGIN_SCRIPTS "Enable the experimental scripts plugin (Nagios compatibility module)" ON)
146
option(ENABLE_PLUGIN_OTEL "Enable collection of OpenTelemetry metrics and logs" ${DEFAULT_FEATURE_STATE})
147
cmake_dependent_option(ENABLE_PLUGIN_OTEL_SIGNAL_VIEWER "Enable OTel signal viewer plugin" ${DEFAULT_FEATURE_STATE} "NOT OS_WINDOWS" False)
@@ -3354,17 +3355,19 @@ if(ENABLE_PLUGIN_GO)
3355
DESTINATION usr/libexec/netdata/plugins.d)
3356
3357
# Build and install nd-mcp (stdio-golang bridge) exactly like go.d.plugin
3357
- if (OS_WINDOWS)
3358
- set(ND_MCP_NAME nd-mcp.exe)
3359
- else()
3360
- set(ND_MCP_NAME nd-mcp)
3361
- endif()
3358
+ if(ENABLE_ND_MCP)
3359
+ if (OS_WINDOWS)
3360
+ set(ND_MCP_NAME nd-mcp.exe)
3361
+ else()
3362
+ set(ND_MCP_NAME nd-mcp)
3363
+ endif()
3364
3363
- add_go_target(nd-mcp-target ${ND_MCP_NAME} src/web/mcp/bridges/stdio-golang .)
3364
- install(PROGRAMS
3365
- ${CMAKE_BINARY_DIR}/${ND_MCP_NAME}
3366
- COMPONENT plugin-go
3367
- DESTINATION "${BINDIR}")
3365
+ add_go_target(nd-mcp-target ${ND_MCP_NAME} src/web/mcp/bridges/stdio-golang .)
3366
+ install(PROGRAMS
3367
+ ${CMAKE_BINARY_DIR}/${ND_MCP_NAME}
3368
+ COMPONENT plugin-go
3369
+ DESTINATION "${BINDIR}")
3370
+ endif()
3371
endif()
3372
3373
#