Skip to content

Model Context Protocol (MCP) Part 2 #20287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 96 commits into from
Jun 2, 2025
Merged

Model Context Protocol (MCP) Part 2 #20287

merged 96 commits into from
Jun 2, 2025

Conversation

ktsaou
Copy link
Member

@ktsaou ktsaou commented May 15, 2025

Continuing from #20244

Infrastructure changes

  • replaced uses to strncpy() with either strncpyz() or memcpy() depending on whether the length is known.
  • removed obsolete RRDLABELS * from parser->user. Replaced it with a counter.
  • fixed RRDLABELS cleanup on errors, to avoid leaking memory.
  • universal USER_AUTH structure for web_clients.

Websocket

  • fixed deadlock while shutting down
  • added URL parameters for controlling max frame size per connection
  • USER_AUTH is copied from web clients

API Changes

  • added scope_instances, scope_labels, scope_dimensions to /api/v3/data and /api/v3/weights.
  • added options instances, dimensions, labels to /api/v3/contexts, allowing the caller to get full visibility of all metadata per context.
  • added cardinality_limit to all contexts (instances, dimensions, labels)
  • added cardinality_limit to /api/v3/data
  • added cardinality_limit to /api/v3/weights for the MCP format
  • re-implemented full text search on contexts for provide all the information detail required for the caller to understand what is matched - respects cardinality limit
  • added option rfc3339 to /api/v3/data and nodes and contexts metadata responses
  • added option long-keys to /api/v3/data to respond with meaningful json keys
  • added contexts registry to maintain the count of unique contexts across all nodes
    • added to /api/v3/info
  • added option rfc3339 to /api/v3/alerts
  • added option long-keys to /api/v3/alerts
  • updated swagger

MCP

  • metadata tools (list_metrics, get_metrics_details, list_nodes, get_node_details)
  • working query metrics tool (query_metrics)
  • working functions (list_functions, execute_function)
  • working weights (find_correlated_metrics, find_anomalous_metrics, find_unstable_metrics)
  • working logs (systemd-journal, windows-events)
  • removed resources implementation
  • implemented stdio bridges for converting stdio <-> websockets (for use with Claude Desktop and Claude Code)
  • implemented MCP ping (responses only, Netdata does not request pings)
  • implemented MCP batch requests
  • mockup of all 2025 MCP spec endpoints
  • each MCP client is now associated with a USER_AUTH.

@ktsaou ktsaou marked this pull request as ready for review May 31, 2025 13:40
close(fd);

// Ensure file permissions are correct (only owner can read/write)
if (chmod(path, 0600) == -1) {

Check failure

Code scanning / CodeQL

Time-of-check time-of-use filesystem race condition High

The
filename
being operated upon was previously
checked
, but the underlying file may have been changed since then.
kanelatechnical
kanelatechnical previously approved these changes Jun 1, 2025
@github-actions github-actions bot added the area/packaging Packaging and operating systems support label Jun 1, 2025
@ktsaou ktsaou merged commit ffe2356 into netdata:master Jun 2, 2025
77 of 94 checks passed
@ktsaou
Copy link
Member Author

ktsaou commented Jun 2, 2025

@andrewm4894 this is done. It is working. You can play with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants