| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef NETDATA_MCP_ADAPTER_WEBSOCKET_H |
| 4 | #define NETDATA_MCP_ADAPTER_WEBSOCKET_H |
| 5 | |
| 6 | #include "web/websocket/websocket-internal.h" |
| 7 | #include "web/mcp/mcp.h" |
| 8 | |
| 9 | // Initialize the WebSocket adapter for MCP |
| 10 | void mcp_websocket_adapter_initialize(void); |
| 11 | |
| 12 | // WebSocket protocol handler callbacks for MCP |
| 13 | void mcp_websocket_on_connect(struct websocket_server_client *wsc); |
| 14 | void mcp_websocket_on_message(struct websocket_server_client *wsc, const char *message, size_t length, WEBSOCKET_OPCODE opcode); |
| 15 | void mcp_websocket_on_close(struct websocket_server_client *wsc, WEBSOCKET_CLOSE_CODE code, const char *reason); |
| 16 | void mcp_websocket_on_disconnect(struct websocket_server_client *wsc); |
| 17 | |
| 18 | // Get and set MCP context from a WebSocket client |
| 19 | MCP_CLIENT *mcp_websocket_get_context(struct websocket_server_client *wsc); |
| 20 | void mcp_websocket_set_context(struct websocket_server_client *wsc, MCP_CLIENT *ctx); |
| 21 | |
| 22 | #endif // NETDATA_MCP_ADAPTER_WEBSOCKET_H |