upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/main/mcp_handler.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-18 03:37:27 +0530
committerYour Name <you@example.com>2026-05-18 03:37:27 +0530
commit8a2f7a6c9423e0c00fae3c1233bee9e0bb3ae239 (patch)
tree8f8d2ede379b7e3cc0da82d472bcf0eeedcbf03b /main/mcp_handler.h
parentfe7c3be2fd9d464dbc837d1913409d2691bd50f5 (diff)
feat: ContextVM (MCP over Nostr) server with WS masking fix
- Full CVM server: persistent WS relay listener, kind 25910 subscription - MCP protocol handlers: initialize, tools/list, tools/call, ping - 10 MCP tools: get_config, set_config, get_balance, wallet_send, get_sessions, get_usage, set_payout, set_metric, set_price, wallet_melt - CEP-6 announcements via WS (kinds 11316, 11317, 10002) - Auth check: owner npub only - Fix: WebSocket client-to-server frame masking (RFC 6455 requirement) - Fix: Raw event JSON in EVENT wrapper (no re-parsing that breaks sig) - SNTP init after STA gets IP - 282 unit tests passing (61 CVM + 60 MCP handler + 161 existing) - Integration test scaffold: tests/integration/test-cvm.mjs
Diffstat (limited to 'main/mcp_handler.h')
-rw-r--r--main/mcp_handler.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/main/mcp_handler.h b/main/mcp_handler.h
index e42b5ee..09aab9f 100644
--- a/main/mcp_handler.h
+++ b/main/mcp_handler.h
@@ -9,6 +9,12 @@ typedef enum {
9 MCP_TOOL_SET_CONFIG = 1, 9 MCP_TOOL_SET_CONFIG = 1,
10 MCP_TOOL_GET_BALANCE = 2, 10 MCP_TOOL_GET_BALANCE = 2,
11 MCP_TOOL_WALLET_SEND = 3, 11 MCP_TOOL_WALLET_SEND = 3,
12 MCP_TOOL_GET_SESSIONS = 4,
13 MCP_TOOL_GET_USAGE = 5,
14 MCP_TOOL_SET_PAYOUT = 6,
15 MCP_TOOL_SET_METRIC = 7,
16 MCP_TOOL_SET_PRICE = 8,
17 MCP_TOOL_WALLET_MELT = 9,
12 MCP_TOOL_UNKNOWN = 99 18 MCP_TOOL_UNKNOWN = 99
13} mcp_tool_t; 19} mcp_tool_t;
14 20
@@ -30,6 +36,12 @@ mcp_response_t mcp_handle_get_config(void);
30mcp_response_t mcp_handle_set_config(const char *params_json); 36mcp_response_t mcp_handle_set_config(const char *params_json);
31mcp_response_t mcp_handle_get_balance(void); 37mcp_response_t mcp_handle_get_balance(void);
32mcp_response_t mcp_handle_wallet_send(const char *params_json); 38mcp_response_t mcp_handle_wallet_send(const char *params_json);
39mcp_response_t mcp_handle_get_sessions(void);
40mcp_response_t mcp_handle_get_usage(void);
41mcp_response_t mcp_handle_set_payout(const char *params_json);
42mcp_response_t mcp_handle_set_metric(const char *params_json);
43mcp_response_t mcp_handle_set_price(const char *params_json);
44mcp_response_t mcp_handle_wallet_melt(const char *params_json);
33 45
34mcp_response_t mcp_dispatch(const mcp_request_t *req); 46mcp_response_t mcp_dispatch(const mcp_request_t *req);
35 47