@attrkit/mcp 0.4.3 → 0.4.4

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 CHANGED
@@ -33,7 +33,7 @@ Install Node.js 18 or newer. The `npx -y @attrkit/mcp` command downloads and
33
33
  starts the server automatically, so no global install is required.
34
34
 
35
35
  Create the first workspace management key under
36
- [Dashboard → Settings → API keys](https://attrikit.io/en/dashboard/settings/api-keys).
36
+ [Dashboard → Settings → API keys & MCP](https://attrikit.io/en/dashboard/settings/api-keys).
37
37
  This one-time bootstrap requires the dashboard.
38
38
 
39
39
  After that first key exists, a workspace-scoped read/write key can manage every
package/dist/cli.js CHANGED
@@ -14076,7 +14076,8 @@ function toToolResult(result) {
14076
14076
  const code = envelope?.error?.code ?? `http_${result.status}`;
14077
14077
  const message = envelope?.error?.message ? `: ${envelope.error.message}` : "";
14078
14078
  const retryAfter = result.status === 429 && result.retryAfter ? ` (Retry-After: ${result.retryAfter})` : "";
14079
- const excerpt = !envelope?.error?.message && result.rawBody ? ` — body: ${result.rawBody.replace(/\s+/g, " ").trim().slice(0, 300)}` : "";
14079
+ const redact = (text) => text.replace(/\b(?:mk|pk|sk|rk)_[A-Za-z0-9_-]{8,}/g, "[redacted-key]").replace(/\b[Bb]earer\s+[A-Za-z0-9._-]{8,}/g, "Bearer [redacted]").replace(/\bAttriKit-(?:Management|Publishable)\s+\S+/g, "AttriKit-$1 [redacted]").replace(/([?&](?:token|secret|key|password|code|signature)=)[^&\s]+/gi, "$1[redacted]");
14080
+ const excerpt = !envelope?.error?.message && result.rawBody ? ` — body: ${redact(result.rawBody.replace(/\s+/g, " ").trim()).slice(0, 300)}` : "";
14080
14081
  const hint = result.status === 401 ? " Check ATTRKIT_API_KEY: this is the same error for a missing, wrong, revoked or expired key." : "";
14081
14082
  return {
14082
14083
  content: [{
@@ -14090,7 +14091,8 @@ function toToolResult(result) {
14090
14091
  const isEmptySuccess = result.status === 204 && (result.rawBody === undefined || result.rawBody === "");
14091
14092
  const isJsonEnvelope = result.json !== null && typeof result.json === "object" && !Array.isArray(result.json) && Object.hasOwn(result.json, "data");
14092
14093
  const contentType = (result.contentType ?? "").toLowerCase();
14093
- const isExpectedText = expectedResponse === "text" && typeof result.json === "string" && (contentType.includes("text/csv") || contentType.includes("application/csv"));
14094
+ const looksLikeMarkup = typeof result.json === "string" && /^\s*<(?:!doctype|html|head|body)\b/i.test(result.json);
14095
+ const isExpectedText = expectedResponse === "text" && typeof result.json === "string" && !contentType.includes("text/html") && !looksLikeMarkup;
14094
14096
  if (!isEmptySuccess && !isJsonEnvelope && !isExpectedText) {
14095
14097
  const reportedContentType = result.contentType ?? "unknown content type";
14096
14098
  const received = result.json === null ? "an empty body" : Array.isArray(result.json) ? "a JSON array" : typeof result.json === "object" ? "a JSON object without a data field" : `a ${typeof result.json} body`;
@@ -14110,7 +14112,7 @@ ${body}`
14110
14112
  structuredContent: structured
14111
14113
  };
14112
14114
  }
14113
- var SERVER_VERSION = "0.4.3";
14115
+ var SERVER_VERSION = "0.4.4";
14114
14116
  var periodSchema = z4.enum(["7d", "30d", "90d", "all"]).describe("Reporting window. Defaults to 30d.").optional();
14115
14117
  var appIdSchema = z4.string().describe("Optional app id to scope the result to one app.").optional();
14116
14118
  var requiredAppIdSchema = z4.string().describe("The AttrKit app id.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attrkit/mcp",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "AttrKit's stdio MCP server for its public Management API",
5
5
  "keywords": [
6
6
  "attrkit",