@joy-loyalty/mcp 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -1
- package/build/config.js +11 -0
- package/build/index.js +1358 -356
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ For **Claude Desktop**, edit your config file:
|
|
|
21
21
|
"mcpServers": {
|
|
22
22
|
"joy-loyalty": {
|
|
23
23
|
"command": "npx",
|
|
24
|
-
"args": ["-y", "@joy-loyalty/mcp"],
|
|
24
|
+
"args": ["-y", "@joy-loyalty/mcp@latest"],
|
|
25
25
|
"env": {
|
|
26
26
|
"JOY_APP_KEY": "<your-shop-id>",
|
|
27
27
|
"JOY_SECRET_KEY": "<your-key-from-step-1>"
|
|
@@ -76,6 +76,34 @@ Your Joy plan must be **Advanced or higher** to use the API.
|
|
|
76
76
|
|
|
77
77
|
Every point-changing action requires a stated reason and is recorded in your Joy activity log for audit purposes.
|
|
78
78
|
|
|
79
|
+
## Usage telemetry
|
|
80
|
+
|
|
81
|
+
Starting with 0.5.0, choose telemetry behavior with `JOY_MCP_TELEMETRY` in your MCP client's `env` block:
|
|
82
|
+
|
|
83
|
+
| Setting | What is sent |
|
|
84
|
+
|---|---|
|
|
85
|
+
| Unset (default) | Metadata headers on normal Joy API requests: call ID, tool name, transport (`stdio`), server version, client application name (when valid), and a random process session ID. No telemetry event relay requests. |
|
|
86
|
+
| `"on"` | The same headers plus batched session and tool-call metadata sent to Joy's telemetry endpoint. |
|
|
87
|
+
| `"off"`, `"false"`, or `"0"` | No telemetry headers or event relay. `DO_NOT_TRACK="1"` or `DO_NOT_TRACK="true"` also disables telemetry and takes precedence over `"on"`. |
|
|
88
|
+
|
|
89
|
+
Both settings ignore case and surrounding whitespace (for example, `"OFF"` and `" off "` disable telemetry).
|
|
90
|
+
|
|
91
|
+
Telemetry goes to `https://api.joy.so` by default; full mode uses `/rest_api/v2/internal/mcp-telemetry`. If Joy support configures `JOY_API_BASE_URL`, telemetry uses that same API destination. Normal API authentication still uses your configured credential; credentials are never included in telemetry events.
|
|
92
|
+
|
|
93
|
+
In full mode, events contain only these metadata fields when applicable:
|
|
94
|
+
|
|
95
|
+
- Shared: `event`, `schema_version`, `event_id`, `server_version`, `session_id`, `mcp_client_name`, `mcp_client_version`.
|
|
96
|
+
- Session: `protocol_version`, `client_capabilities` (capability names only), `tools_exposed`.
|
|
97
|
+
- Tool call: `call_id`, `tool`, `tool_kind`, `outcome`, `error_kind`, `error_code` (a machine code), `http_status`, `duration_ms`, `api_calls`, `api_ms`, `result_bytes` (UTF-8 byte count only).
|
|
98
|
+
|
|
99
|
+
Joy's backend adds verified shop ID/domain, Joy and Shopify plans, authentication mode, access scope, and transport. With either header mode or full mode, the backend can also record API status, duration, route pattern, and BigQuery usage. Header mode cannot report calls served entirely from cache, failures before an API request, or result byte counts.
|
|
100
|
+
|
|
101
|
+
**Telemetry does not send tool arguments, tool result content, prompts, SQL, or free-form error messages.** Normal tool requests and responses still carry the data needed to perform the tool's work. Telemetry never writes to the stdio protocol output.
|
|
102
|
+
|
|
103
|
+
To enable event relay, add `"JOY_MCP_TELEMETRY": "on"` to your client's `env` block. To disable all telemetry, add `"JOY_MCP_TELEMETRY": "off"` or `"DO_NOT_TRACK": "1"`. Restart your AI client after changing these settings.
|
|
104
|
+
|
|
105
|
+
Run the latest version with `npx -y @joy-loyalty/mcp@latest`.
|
|
106
|
+
|
|
79
107
|
## Security
|
|
80
108
|
|
|
81
109
|
- The server only talks to Joy's official API — it never sends your data anywhere else.
|
package/build/config.js
CHANGED
|
@@ -67,3 +67,14 @@ export function loadConfig(env = process.env) {
|
|
|
67
67
|
deductDryRunThreshold
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
+
export const DEFAULT_TELEMETRY_MODE = 'headers';
|
|
71
|
+
/** Choose header-only telemetry by default, full relay by opt-in, or complete opt-out. */
|
|
72
|
+
export function telemetryMode(env = process.env) {
|
|
73
|
+
const mode = (env.JOY_MCP_TELEMETRY ?? '').trim().toLowerCase();
|
|
74
|
+
const doNotTrack = (env.DO_NOT_TRACK ?? '').trim().toLowerCase();
|
|
75
|
+
if (['1', 'true'].includes(doNotTrack) || ['off', 'false', '0'].includes(mode))
|
|
76
|
+
return 'off';
|
|
77
|
+
if (mode === 'on')
|
|
78
|
+
return 'full';
|
|
79
|
+
return DEFAULT_TELEMETRY_MODE;
|
|
80
|
+
}
|