@smallwebco/tinypivot-mcp 0.1.0 → 0.1.1

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.
@@ -7421,7 +7421,8 @@ function buildFullCompanionPayload(store, datasetId, opts) {
7421
7421
  return null;
7422
7422
  const session = store.getSessionSavings();
7423
7423
  const turnTokensSaved = ds.ingestionMode === "direct" ? Math.max(0, ds.estimatedDatasetTokens - 150) : 0;
7424
- const isPro2 = Boolean(opts.licenseKey && opts.licenseKey.startsWith("TP-") || opts.demoToken);
7424
+ const validMcpKey = opts.licenseKey && (opts.licenseKey.startsWith("TP-MCPP-") || opts.licenseKey.startsWith("TP-MCPT-")) ? opts.licenseKey : null;
7425
+ const isPro2 = Boolean(validMcpKey || opts.demoToken);
7425
7426
  return {
7426
7427
  datasetId: ds.id,
7427
7428
  name: ds.name,
@@ -7438,7 +7439,7 @@ function buildFullCompanionPayload(store, datasetId, opts) {
7438
7439
  chartConfig: ds.chartConfig ?? null,
7439
7440
  chartTheme: isPro2 ? store.getVisualTheme() : "code",
7440
7441
  datasets: store.listMetadata(),
7441
- licenseKey: opts.licenseKey ?? null,
7442
+ licenseKey: validMcpKey,
7442
7443
  demoToken: opts.demoToken ?? null,
7443
7444
  modelCatalog: MODEL_CATALOG,
7444
7445
  tokenStats: {
@@ -7517,7 +7518,9 @@ data: ${JSON.stringify(payload)}
7517
7518
  }
7518
7519
  if (req.method === "POST" && pathname === "/api/theme") {
7519
7520
  const body = await readJsonBody(req);
7520
- const isPro2 = Boolean(options.licenseKey && options.licenseKey.startsWith("TP-") || options.demoToken);
7521
+ const isPro2 = Boolean(
7522
+ options.licenseKey && (options.licenseKey.startsWith("TP-MCPP-") || options.licenseKey.startsWith("TP-MCPT-")) || options.demoToken
7523
+ );
7521
7524
  if (typeof body.theme === "string") {
7522
7525
  const requested = body.theme;
7523
7526
  if (isPro2 || requested === "code") {
@@ -9124,7 +9127,7 @@ import fsSync2 from "fs";
9124
9127
  import os2 from "os";
9125
9128
  import path2 from "path";
9126
9129
  var DEFAULT_TELEMETRY_URL = "https://tiny-pivot.com/api/telemetry";
9127
- var PACKAGE_VERSION = "0.1.0";
9130
+ var PACKAGE_VERSION = "0.1.1";
9128
9131
  function isTelemetryEnabled() {
9129
9132
  if (process.env.TINYPIVOT_TELEMETRY === "0" || process.env.TINYPIVOT_TELEMETRY === "false")
9130
9133
  return false;
@@ -9275,7 +9278,8 @@ function buildAppPayload(dataset, store, options) {
9275
9278
  const turnTokensSaved = options.overrideTurnTokensSaved ?? defaultTurnBypass;
9276
9279
  const sessionSavings = options.recordTurn !== false ? store.recordTurnSavings(turnTokensSaved, options.model) : options.model ? (store.setActiveModel(options.model), store.getSessionSavings()) : store.getSessionSavings();
9277
9280
  const turnUsdSaved = tokensToUsd(turnTokensSaved, sessionSavings.model.ratePerMillion);
9278
- const isPro2 = Boolean(options.licenseKey && options.licenseKey.startsWith("TP-") || options.demoToken);
9281
+ const validMcpKey = isMcpLicenseKey(options.licenseKey) ? options.licenseKey : null;
9282
+ const isPro2 = Boolean(validMcpKey || options.demoToken);
9279
9283
  return {
9280
9284
  datasetId: dataset.id,
9281
9285
  name: dataset.name,
@@ -9292,7 +9296,7 @@ function buildAppPayload(dataset, store, options) {
9292
9296
  chartConfig: dataset.chartConfig ?? null,
9293
9297
  chartTheme: isPro2 ? store.getVisualTheme() : "code",
9294
9298
  datasets: store.listMetadata(),
9295
- licenseKey: options.licenseKey ?? null,
9299
+ licenseKey: validMcpKey,
9296
9300
  demoToken: options.demoToken ?? null,
9297
9301
  modelCatalog: MODEL_CATALOG,
9298
9302
  tokenStats: {
@@ -9328,6 +9332,11 @@ async function loadAppHtml(customPath) {
9328
9332
  <p>Run <code>pnpm --filter @smallwebco/tinypivot-mcp build</code> to bundle <code>dist/app/index.html</code>.</p>
9329
9333
  </body></html>`;
9330
9334
  }
9335
+ function isMcpLicenseKey(key) {
9336
+ if (!key)
9337
+ return false;
9338
+ return key.startsWith("TP-MCPP-") || key.startsWith("TP-MCPT-");
9339
+ }
9331
9340
  function resolveLicenseKey(explicit) {
9332
9341
  if (explicit?.trim())
9333
9342
  return explicit.trim();
@@ -9349,9 +9358,13 @@ function resolveLicenseKey(explicit) {
9349
9358
  return void 0;
9350
9359
  }
9351
9360
  function createTinyPivotMcpServer(options = {}) {
9352
- const licenseKey = resolveLicenseKey(options.licenseKey);
9361
+ const rawLicenseKey = resolveLicenseKey(options.licenseKey);
9362
+ const licenseKey = isMcpLicenseKey(rawLicenseKey) ? rawLicenseKey : void 0;
9363
+ if (rawLicenseKey && !licenseKey && rawLicenseKey.startsWith("TP-PRO")) {
9364
+ console.error("[tinypivot-mcp] Notice: UI Library keys (TP-PRO*) apply to @smallwebco/tinypivot-react/-vue. TinyPivot MCP Pro requires an MCP license key (TP-MCPP* / TP-MCPT*) from https://tiny-pivot.com/mcp");
9365
+ }
9353
9366
  const demoToken = options.demoToken ?? process.env.TINYPIVOT_DEMO_TOKEN;
9354
- const isPro2 = Boolean(licenseKey && licenseKey.startsWith("TP-") || demoToken);
9367
+ const isPro2 = Boolean(licenseKey || demoToken);
9355
9368
  const tier = isPro2 ? "pro" : "free";
9356
9369
  const store = options.store ?? new DatasetStore({
9357
9370
  maxRowsPerDataset: isPro2 ? Number.POSITIVE_INFINITY : FREE_TIER_ROW_LIMIT
@@ -9367,7 +9380,7 @@ function createTinyPivotMcpServer(options = {}) {
9367
9380
  const server = new McpServer(
9368
9381
  {
9369
9382
  name: "tinypivot",
9370
- version: "0.1.0"
9383
+ version: "0.1.1"
9371
9384
  },
9372
9385
  {
9373
9386
  capabilities: {
@@ -9978,6 +9991,7 @@ export {
9978
9991
  APP_RESOURCE_URI,
9979
9992
  APP_MIME_TYPE,
9980
9993
  loadAppHtml,
9994
+ isMcpLicenseKey,
9981
9995
  resolveLicenseKey,
9982
9996
  createTinyPivotMcpServer
9983
9997
  };
package/dist/cli.js CHANGED
@@ -3,10 +3,11 @@ import {
3
3
  DatasetStore,
4
4
  FREE_TIER_ROW_LIMIT,
5
5
  createTinyPivotMcpServer,
6
+ isMcpLicenseKey,
6
7
  loadAppHtml,
7
8
  resolveLicenseKey,
8
9
  startCompanionServer
9
- } from "./chunk-VLD3SN2I.js";
10
+ } from "./chunk-5BTVEJDK.js";
10
11
  import "./chunk-2ESYSVXG.js";
11
12
 
12
13
  // src/cli.ts
@@ -409,9 +410,10 @@ async function main() {
409
410
  await runInitCommand(args.slice(1));
410
411
  return;
411
412
  }
412
- const licenseKey = resolveLicenseKey();
413
+ const rawLicenseKey = resolveLicenseKey();
414
+ const licenseKey = isMcpLicenseKey(rawLicenseKey) ? rawLicenseKey : void 0;
413
415
  const demoToken = process.env.TINYPIVOT_DEMO_TOKEN;
414
- const isPro = Boolean(licenseKey && licenseKey.startsWith("TP-") || demoToken);
416
+ const isPro = Boolean(licenseKey || demoToken);
415
417
  const store = new DatasetStore({
416
418
  maxRowsPerDataset: isPro ? Number.POSITIVE_INFINITY : FREE_TIER_ROW_LIMIT
417
419
  });
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  resolveModelPricing,
18
18
  startCompanionServer,
19
19
  tokensToUsd
20
- } from "./chunk-VLD3SN2I.js";
20
+ } from "./chunk-5BTVEJDK.js";
21
21
  import "./chunk-2ESYSVXG.js";
22
22
  export {
23
23
  APP_MIME_TYPE,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@smallwebco/tinypivot-mcp",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "description": "TinyPivot MCP Server & Interactive MCP App — turn CSV, JSON, and PostgreSQL queries into interactive pivot tables, charts, drill-through, and Excel exports directly inside AI chats.",
6
6
  "author": "Small Web, LLC",
7
7
  "license": "MIT",