@adviverse/mcp 0.1.6 → 0.1.7

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
@@ -25,7 +25,7 @@ The server reads it from the environment:
25
25
 
26
26
  | Env var | Required | Default |
27
27
  |---|---|---|
28
- | `ADVIVERSE_API_KEY` | yes | — (`ak_<prefix>.<secret>`) |
28
+ | `ADVIVERSE_API_KEY` | yes, unless you ran `adviverse login` (then the CLI's saved key is used) | — (`ak_<prefix>.<secret>`) |
29
29
  | `ADVIVERSE_BASE_URL` | no | `https://adviverse.com` |
30
30
 
31
31
  A read-only key makes every mutating tool return a `403 missing scope: write` —
package/dist/http.js CHANGED
@@ -14421,6 +14421,14 @@ var AuthResource = class extends Resource {
14421
14421
  body: { newPassword, ...currentPassword ? { currentPassword } : {} }
14422
14422
  });
14423
14423
  }
14424
+ /** Start an RFC 8628 device login: show `user_code` / `verification_uri_complete`, then poll deviceToken(). */
14425
+ deviceCode(body = {}) {
14426
+ return this.c.request("POST", "/v1/auth/device/code", { body });
14427
+ }
14428
+ /** Poll every `interval` s. Throws AdNetApiError 400 with body.error authorization_pending | slow_down | access_denied | expired_token until approved. */
14429
+ deviceToken(deviceCode) {
14430
+ return this.c.request("POST", "/v1/auth/device/token", { body: { device_code: deviceCode } });
14431
+ }
14424
14432
  login(body) {
14425
14433
  return this.c.request("POST", "/v1/auth/login", { body });
14426
14434
  }
@@ -14743,6 +14751,10 @@ var KeysResource = class extends Resource {
14743
14751
  delete(id) {
14744
14752
  return this.c.request("DELETE", `/v1/keys/${encodeURIComponent(id)}`);
14745
14753
  }
14754
+ /** Revoke the API key this client is using (logout). 400 when authenticated by session. */
14755
+ revokeCurrent() {
14756
+ return this.c.request("DELETE", "/v1/keys/current");
14757
+ }
14746
14758
  };
14747
14759
  var BillingResource = class extends Resource {
14748
14760
  constructor(c) {
@@ -15674,6 +15686,14 @@ var AppsResource = class extends Resource {
15674
15686
  update(id, body) {
15675
15687
  return this.c.request("PATCH", `/v1/publisher/apps/${encodeURIComponent(id)}`, { body });
15676
15688
  }
15689
+ /** Soft-deletes the app and its placements. */
15690
+ delete(id) {
15691
+ return this.c.request("DELETE", `/v1/publisher/apps/${encodeURIComponent(id)}`);
15692
+ }
15693
+ /** Verify via app-ads.txt on the linked developer site (default), or also the store listing. */
15694
+ verify(id, method) {
15695
+ return this.c.request("POST", `/v1/publisher/apps/${encodeURIComponent(id)}/verify`, { body: method ? { method } : {} });
15696
+ }
15677
15697
  /** The generated app-ads.txt content (plain text). */
15678
15698
  appAdsTxt(id) {
15679
15699
  return this.c.request("GET", `/v1/publisher/apps/${encodeURIComponent(id)}/app-ads.txt`, { text: true });
@@ -24469,12 +24489,12 @@ function createServer(client) {
24469
24489
  tool("set_serving_domain", "Set a first-party ad-serving domain on a property (anti-adblock). The publisher CNAMEs this host to our edge; returns the CNAME target. Pass domain:null to remove.", { id: external_exports.string(), domain: external_exports.string().nullable() }, (a) => client.properties.setServingDomain(a.id, a.domain));
24470
24490
  tool("verify_serving_domain", "Verify a property custom serving domain CNAMEs to our edge (routes traffic + proves control). On success the tag serves first-party.", { id: external_exports.string() }, (a) => client.properties.verifyServingDomain(a.id));
24471
24491
  tool("list_placements", "List ad placements. has_signing_secret says whether signed-tag enforcement is on (the secret itself is only returned by rotate_placement_signing_secret).", page, (a) => client.placements.list(a));
24472
- tool("create_placement", "Create a placement. fields: { propertyId, name, format, floorCpm, \u2026 }.", { fields, idempotencyKey: idem }, (a) => client.placements.create(a.fields, a.idempotencyKey));
24492
+ tool("create_placement", "Create a placement. fields: { propertyId | appId (exactly one; an app id from list_apps works), name, format, floorCpm, \u2026 }. Apps accept banner, native, interstitial, rewarded, app_open, video, audio, carousel, pod, direct_link (no popunder/social_bar/in_page_push).", { fields, idempotencyKey: idem }, (a) => client.placements.create(a.fields, a.idempotencyKey));
24473
24493
  tool("get_placement_tag", "Get the ad tag / install code for a placement (responsive banners also return autoAdsScript, the one-line site-wide auto-ads tag).", { id: external_exports.string() }, (a) => client.placements.tag(a.id));
24474
24494
  tool("rotate_placement_signing_secret", "Generate/rotate a placement signing secret (Layer 3, returned once). With a secret set, the engine only serves /terminal requests carrying a valid HMAC signature.", { id: external_exports.string() }, (a) => client.placements.rotateSigningSecret(a.id));
24475
24495
  tool("disable_placement_signing", "Disable signed-tag enforcement on a placement.", { id: external_exports.string() }, (a) => client.placements.disableSigning(a.id));
24476
24496
  tool("list_combo_presets", "List the static combo / layout presets (each bundles several ad units: standard_combo, leaderboard_pop, social_push, sticky_interstitial, full_monetization).", {}, () => client.placements.comboPresets());
24477
- tool("create_combo", "Provision several ad units as placements on a property at once and get ONE combined embed snippet back (paste once before </body>). Provide EITHER a preset (presetKey) OR a custom set of units [{format,label?,width?,height?}]. fields: { presetKey?, units?, namePrefix?, floorCpm?, revShare?, auctionType?, passbackUrl?, houseOnly?, houseShare?, houseBackfill?, floorFallback? }.", { propertyId: external_exports.string(), fields }, (a) => client.placements.createCombo(a.propertyId, a.fields));
24497
+ tool("create_combo", "Provision several ad units as placements on a property at once and get ONE combined embed snippet back (paste once before </body>). propertyId may be an app id; on apps use presetKey in_app (banner + interstitial), web-only presets are refused. Provide EITHER a preset (presetKey) OR a custom set of units [{format,label?,width?,height?}]. fields: { presetKey?, units?, namePrefix?, floorCpm?, revShare?, auctionType?, passbackUrl?, houseOnly?, houseShare?, houseBackfill?, floorFallback? }.", { propertyId: external_exports.string(), fields }, (a) => client.placements.createCombo(a.propertyId, a.fields));
24478
24498
  tool("get_balance", "Get the account balance (available / held). The balance currency may be a tenant's own platform-token code (not an ISO code).", {}, () => client.finance.balance());
24479
24499
  tool("list_ledger", "List ledger entries.", { limit: external_exports.number().optional(), offset: external_exports.number().optional() }, (a) => client.finance.ledger({ limit: a.limit, offset: a.offset }));
24480
24500
  tool("advertiser_report", "Advertiser spend/performance report.", reportQuery, (a) => client.reporting.advertiser(a));
@@ -24691,14 +24711,14 @@ function createServer(client) {
24691
24711
  tool("send_capi_events", "Ingest server-side conversions. Auth is the CAPI token (from rotate_capi_token), NOT the session key.", { capiToken: external_exports.string(), events: external_exports.array(external_exports.any()) }, (a) => client.capi.send(a.capiToken, a.events));
24692
24712
  tool("track_conversion", "Record a conversion by click id (S2S postback). fields: { clickId|click_id, value?, postbackId? }.", { fields }, (a) => client.track.conversion(a.fields));
24693
24713
  tool("track_event", "Ingest a pixel event server-side (same payload pixel.js sends). fields = event object.", { fields }, (a) => client.track.event(a.fields));
24694
- tool("list_invoices", "List invoices (advertiser sees own; admin can pass accountId).", { accountId: external_exports.string().optional() }, (a) => client.billing.invoices({ accountId: a.accountId }));
24695
- tool("get_invoice", "Get one invoice by id.", { id: external_exports.string() }, (a) => client.billing.invoice(a.id));
24714
+ tool("list_billing_invoices", "List platform billing invoices (advertiser sees own; admin can pass accountId).", { accountId: external_exports.string().optional() }, (a) => client.billing.invoices({ accountId: a.accountId }));
24715
+ tool("get_billing_invoice", "Get one platform billing invoice by id.", { id: external_exports.string() }, (a) => client.billing.invoice(a.id));
24696
24716
  tool("get_statement", "Account financial statement (opening/charges/payments/closing).", { from: external_exports.string().optional(), to: external_exports.string().optional(), accountId: external_exports.string().optional() }, (a) => client.billing.statement(a));
24697
24717
  tool("render_invoice", "Rendered HTML of an invoice.", { id: external_exports.string() }, (a) => client.billing.renderInvoice(a.id));
24698
24718
  tool("generate_invoice", "Generate a draft invoice for an account+period (admin).", { accountId: external_exports.string(), periodStart: external_exports.string(), periodEnd: external_exports.string() }, (a) => client.billing.generateInvoice(a));
24699
24719
  tool("issue_invoice", "Issue a draft invoice (admin).", { id: external_exports.string() }, (a) => client.billing.issueInvoice(a.id));
24700
24720
  tool("pay_invoice", "Pay an invoice (advertiser own; admin any).", { id: external_exports.string() }, (a) => client.billing.payInvoice(a.id));
24701
- tool("void_invoice", "Void an invoice (admin).", { id: external_exports.string() }, (a) => client.billing.voidInvoice(a.id));
24721
+ tool("void_billing_invoice", "Void a platform billing invoice (admin).", { id: external_exports.string() }, (a) => client.billing.voidInvoice(a.id));
24702
24722
  tool("deposit_funds", "Request a deposit / account top-up. fields: { amount, provider?: stripe|card|paypal|crypto|wire|paxum|mock, currency? }. card=Stripe card checkout; wire/paxum are instruction-based \u2014 the response carries where to send funds + a reference, and the balance is credited once receipt is confirmed. Accounts on a tenant network transact in that tenant's own platform token: currency is the token code and amount is denominated in it.", { fields }, (a) => client.finance.deposit(a.fields));
24703
24723
  tool("list_deposits", "List deposit history.", {}, () => client.finance.deposits());
24704
24724
  tool("request_payout", "Request a publisher payout. fields: { amount, method: crypto|paxum|wire, destination? }. crypto\u2192OxaPay, paxum\u2192Paxum wallet email (destination.email), wire\u2192bank transfer (destination bank fields; settled once ops confirms it was sent).", { fields }, (a) => client.finance.requestPayout(a.fields));
@@ -24738,8 +24758,10 @@ function createServer(client) {
24738
24758
  tool("get_identity", "Get an identity you own by canonical id, with only the signals you supplied (404 if you own none of its signals).", { canonicalId: external_exports.string() }, (a) => client.identity.get(a.canonicalId));
24739
24759
  tool("list_apps", "List publisher mobile/CTV apps.", {}, () => client.apps.list());
24740
24760
  tool("get_app", "Get one app by id.", { id: external_exports.string() }, (a) => client.apps.get(a.id));
24741
- tool("create_app", "Register a mobile/CTV app. fields: { kind: mobile_app|ctv, name, bundleId, platform, storeUrl?, appStoreId?, category?, ctvMeta? }.", { fields }, (a) => client.apps.create(a.fields));
24742
- tool("update_app", "Update an app. fields: { appAdsTxt?, skadnetworkIds?, ctvMeta?, storeUrl?, platform? }.", { id: external_exports.string(), fields }, (a) => client.apps.update(a.id, a.fields));
24761
+ tool("create_app", "Register a mobile/CTV app. fields: { kind: mobile_app|ctv, name, bundleId, platform, storeUrl?, appStoreId?, category?, ctvMeta?, developerPropertyId? (your website property whose /app-ads.txt proves the app) }. Starts pending; then verify_app. Test tag tk_test fills before verification.", { fields }, (a) => client.apps.create(a.fields));
24762
+ tool("update_app", "Update an app. fields: { appAdsTxt?, skadnetworkIds?, ctvMeta?, storeUrl?, platform?, developerPropertyId? (website property id; null unlinks) }.", { id: external_exports.string(), fields }, (a) => client.apps.update(a.id, a.fields));
24763
+ tool("delete_app", "Delete an app (soft-deletes it and its placements).", { id: external_exports.string() }, (a) => client.apps.delete(a.id));
24764
+ tool("verify_app", "Verify an app. developer_site (default): the linked, verified developer website must serve /app-ads.txt with 'adviverse.com, <your account id>, DIRECT' (see get_app_ads_txt). store_listing: also checks the apps.apple.com / play.google.com listing. On failure returns error + message saying what to fix.", { id: external_exports.string(), method: external_exports.enum(["developer_site", "store_listing"]).optional() }, (a) => client.apps.verify(a.id, a.method));
24743
24765
  tool("get_app_ads_txt", "An app's generated app-ads.txt content.", { id: external_exports.string() }, (a) => client.apps.appAdsTxt(a.id));
24744
24766
  tool("report_ivt", "Invalid-traffic breakdown.", reportQuery, (a) => client.reporting.ivt(a));
24745
24767
  tool("report_reach", "Reach & frequency (unique users): total reach, average frequency, a frequency-distribution histogram (impressions per user), and daily unique reach.", reportQuery, (a) => client.reporting.reach(a));
package/dist/index.js CHANGED
@@ -6968,6 +6968,9 @@ var require_dist = __commonJS({
6968
6968
 
6969
6969
  // src/index.ts
6970
6970
  init_esm_shims();
6971
+ import { readFileSync } from "fs";
6972
+ import { homedir } from "os";
6973
+ import { join } from "path";
6971
6974
 
6972
6975
  // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
6973
6976
  init_esm_shims();
@@ -13182,6 +13185,14 @@ var AuthResource = class extends Resource {
13182
13185
  body: { newPassword, ...currentPassword ? { currentPassword } : {} }
13183
13186
  });
13184
13187
  }
13188
+ /** Start an RFC 8628 device login: show `user_code` / `verification_uri_complete`, then poll deviceToken(). */
13189
+ deviceCode(body = {}) {
13190
+ return this.c.request("POST", "/v1/auth/device/code", { body });
13191
+ }
13192
+ /** Poll every `interval` s. Throws AdNetApiError 400 with body.error authorization_pending | slow_down | access_denied | expired_token until approved. */
13193
+ deviceToken(deviceCode) {
13194
+ return this.c.request("POST", "/v1/auth/device/token", { body: { device_code: deviceCode } });
13195
+ }
13185
13196
  login(body) {
13186
13197
  return this.c.request("POST", "/v1/auth/login", { body });
13187
13198
  }
@@ -13504,6 +13515,10 @@ var KeysResource = class extends Resource {
13504
13515
  delete(id) {
13505
13516
  return this.c.request("DELETE", `/v1/keys/${encodeURIComponent(id)}`);
13506
13517
  }
13518
+ /** Revoke the API key this client is using (logout). 400 when authenticated by session. */
13519
+ revokeCurrent() {
13520
+ return this.c.request("DELETE", "/v1/keys/current");
13521
+ }
13507
13522
  };
13508
13523
  var BillingResource = class extends Resource {
13509
13524
  constructor(c) {
@@ -14435,6 +14450,14 @@ var AppsResource = class extends Resource {
14435
14450
  update(id, body) {
14436
14451
  return this.c.request("PATCH", `/v1/publisher/apps/${encodeURIComponent(id)}`, { body });
14437
14452
  }
14453
+ /** Soft-deletes the app and its placements. */
14454
+ delete(id) {
14455
+ return this.c.request("DELETE", `/v1/publisher/apps/${encodeURIComponent(id)}`);
14456
+ }
14457
+ /** Verify via app-ads.txt on the linked developer site (default), or also the store listing. */
14458
+ verify(id, method) {
14459
+ return this.c.request("POST", `/v1/publisher/apps/${encodeURIComponent(id)}/verify`, { body: method ? { method } : {} });
14460
+ }
14438
14461
  /** The generated app-ads.txt content (plain text). */
14439
14462
  appAdsTxt(id) {
14440
14463
  return this.c.request("GET", `/v1/publisher/apps/${encodeURIComponent(id)}/app-ads.txt`, { text: true });
@@ -23230,12 +23253,12 @@ function createServer(client) {
23230
23253
  tool("set_serving_domain", "Set a first-party ad-serving domain on a property (anti-adblock). The publisher CNAMEs this host to our edge; returns the CNAME target. Pass domain:null to remove.", { id: external_exports.string(), domain: external_exports.string().nullable() }, (a) => client.properties.setServingDomain(a.id, a.domain));
23231
23254
  tool("verify_serving_domain", "Verify a property custom serving domain CNAMEs to our edge (routes traffic + proves control). On success the tag serves first-party.", { id: external_exports.string() }, (a) => client.properties.verifyServingDomain(a.id));
23232
23255
  tool("list_placements", "List ad placements. has_signing_secret says whether signed-tag enforcement is on (the secret itself is only returned by rotate_placement_signing_secret).", page, (a) => client.placements.list(a));
23233
- tool("create_placement", "Create a placement. fields: { propertyId, name, format, floorCpm, \u2026 }.", { fields, idempotencyKey: idem }, (a) => client.placements.create(a.fields, a.idempotencyKey));
23256
+ tool("create_placement", "Create a placement. fields: { propertyId | appId (exactly one; an app id from list_apps works), name, format, floorCpm, \u2026 }. Apps accept banner, native, interstitial, rewarded, app_open, video, audio, carousel, pod, direct_link (no popunder/social_bar/in_page_push).", { fields, idempotencyKey: idem }, (a) => client.placements.create(a.fields, a.idempotencyKey));
23234
23257
  tool("get_placement_tag", "Get the ad tag / install code for a placement (responsive banners also return autoAdsScript, the one-line site-wide auto-ads tag).", { id: external_exports.string() }, (a) => client.placements.tag(a.id));
23235
23258
  tool("rotate_placement_signing_secret", "Generate/rotate a placement signing secret (Layer 3, returned once). With a secret set, the engine only serves /terminal requests carrying a valid HMAC signature.", { id: external_exports.string() }, (a) => client.placements.rotateSigningSecret(a.id));
23236
23259
  tool("disable_placement_signing", "Disable signed-tag enforcement on a placement.", { id: external_exports.string() }, (a) => client.placements.disableSigning(a.id));
23237
23260
  tool("list_combo_presets", "List the static combo / layout presets (each bundles several ad units: standard_combo, leaderboard_pop, social_push, sticky_interstitial, full_monetization).", {}, () => client.placements.comboPresets());
23238
- tool("create_combo", "Provision several ad units as placements on a property at once and get ONE combined embed snippet back (paste once before </body>). Provide EITHER a preset (presetKey) OR a custom set of units [{format,label?,width?,height?}]. fields: { presetKey?, units?, namePrefix?, floorCpm?, revShare?, auctionType?, passbackUrl?, houseOnly?, houseShare?, houseBackfill?, floorFallback? }.", { propertyId: external_exports.string(), fields }, (a) => client.placements.createCombo(a.propertyId, a.fields));
23261
+ tool("create_combo", "Provision several ad units as placements on a property at once and get ONE combined embed snippet back (paste once before </body>). propertyId may be an app id; on apps use presetKey in_app (banner + interstitial), web-only presets are refused. Provide EITHER a preset (presetKey) OR a custom set of units [{format,label?,width?,height?}]. fields: { presetKey?, units?, namePrefix?, floorCpm?, revShare?, auctionType?, passbackUrl?, houseOnly?, houseShare?, houseBackfill?, floorFallback? }.", { propertyId: external_exports.string(), fields }, (a) => client.placements.createCombo(a.propertyId, a.fields));
23239
23262
  tool("get_balance", "Get the account balance (available / held). The balance currency may be a tenant's own platform-token code (not an ISO code).", {}, () => client.finance.balance());
23240
23263
  tool("list_ledger", "List ledger entries.", { limit: external_exports.number().optional(), offset: external_exports.number().optional() }, (a) => client.finance.ledger({ limit: a.limit, offset: a.offset }));
23241
23264
  tool("advertiser_report", "Advertiser spend/performance report.", reportQuery, (a) => client.reporting.advertiser(a));
@@ -23452,14 +23475,14 @@ function createServer(client) {
23452
23475
  tool("send_capi_events", "Ingest server-side conversions. Auth is the CAPI token (from rotate_capi_token), NOT the session key.", { capiToken: external_exports.string(), events: external_exports.array(external_exports.any()) }, (a) => client.capi.send(a.capiToken, a.events));
23453
23476
  tool("track_conversion", "Record a conversion by click id (S2S postback). fields: { clickId|click_id, value?, postbackId? }.", { fields }, (a) => client.track.conversion(a.fields));
23454
23477
  tool("track_event", "Ingest a pixel event server-side (same payload pixel.js sends). fields = event object.", { fields }, (a) => client.track.event(a.fields));
23455
- tool("list_invoices", "List invoices (advertiser sees own; admin can pass accountId).", { accountId: external_exports.string().optional() }, (a) => client.billing.invoices({ accountId: a.accountId }));
23456
- tool("get_invoice", "Get one invoice by id.", { id: external_exports.string() }, (a) => client.billing.invoice(a.id));
23478
+ tool("list_billing_invoices", "List platform billing invoices (advertiser sees own; admin can pass accountId).", { accountId: external_exports.string().optional() }, (a) => client.billing.invoices({ accountId: a.accountId }));
23479
+ tool("get_billing_invoice", "Get one platform billing invoice by id.", { id: external_exports.string() }, (a) => client.billing.invoice(a.id));
23457
23480
  tool("get_statement", "Account financial statement (opening/charges/payments/closing).", { from: external_exports.string().optional(), to: external_exports.string().optional(), accountId: external_exports.string().optional() }, (a) => client.billing.statement(a));
23458
23481
  tool("render_invoice", "Rendered HTML of an invoice.", { id: external_exports.string() }, (a) => client.billing.renderInvoice(a.id));
23459
23482
  tool("generate_invoice", "Generate a draft invoice for an account+period (admin).", { accountId: external_exports.string(), periodStart: external_exports.string(), periodEnd: external_exports.string() }, (a) => client.billing.generateInvoice(a));
23460
23483
  tool("issue_invoice", "Issue a draft invoice (admin).", { id: external_exports.string() }, (a) => client.billing.issueInvoice(a.id));
23461
23484
  tool("pay_invoice", "Pay an invoice (advertiser own; admin any).", { id: external_exports.string() }, (a) => client.billing.payInvoice(a.id));
23462
- tool("void_invoice", "Void an invoice (admin).", { id: external_exports.string() }, (a) => client.billing.voidInvoice(a.id));
23485
+ tool("void_billing_invoice", "Void a platform billing invoice (admin).", { id: external_exports.string() }, (a) => client.billing.voidInvoice(a.id));
23463
23486
  tool("deposit_funds", "Request a deposit / account top-up. fields: { amount, provider?: stripe|card|paypal|crypto|wire|paxum|mock, currency? }. card=Stripe card checkout; wire/paxum are instruction-based \u2014 the response carries where to send funds + a reference, and the balance is credited once receipt is confirmed. Accounts on a tenant network transact in that tenant's own platform token: currency is the token code and amount is denominated in it.", { fields }, (a) => client.finance.deposit(a.fields));
23464
23487
  tool("list_deposits", "List deposit history.", {}, () => client.finance.deposits());
23465
23488
  tool("request_payout", "Request a publisher payout. fields: { amount, method: crypto|paxum|wire, destination? }. crypto\u2192OxaPay, paxum\u2192Paxum wallet email (destination.email), wire\u2192bank transfer (destination bank fields; settled once ops confirms it was sent).", { fields }, (a) => client.finance.requestPayout(a.fields));
@@ -23499,8 +23522,10 @@ function createServer(client) {
23499
23522
  tool("get_identity", "Get an identity you own by canonical id, with only the signals you supplied (404 if you own none of its signals).", { canonicalId: external_exports.string() }, (a) => client.identity.get(a.canonicalId));
23500
23523
  tool("list_apps", "List publisher mobile/CTV apps.", {}, () => client.apps.list());
23501
23524
  tool("get_app", "Get one app by id.", { id: external_exports.string() }, (a) => client.apps.get(a.id));
23502
- tool("create_app", "Register a mobile/CTV app. fields: { kind: mobile_app|ctv, name, bundleId, platform, storeUrl?, appStoreId?, category?, ctvMeta? }.", { fields }, (a) => client.apps.create(a.fields));
23503
- tool("update_app", "Update an app. fields: { appAdsTxt?, skadnetworkIds?, ctvMeta?, storeUrl?, platform? }.", { id: external_exports.string(), fields }, (a) => client.apps.update(a.id, a.fields));
23525
+ tool("create_app", "Register a mobile/CTV app. fields: { kind: mobile_app|ctv, name, bundleId, platform, storeUrl?, appStoreId?, category?, ctvMeta?, developerPropertyId? (your website property whose /app-ads.txt proves the app) }. Starts pending; then verify_app. Test tag tk_test fills before verification.", { fields }, (a) => client.apps.create(a.fields));
23526
+ tool("update_app", "Update an app. fields: { appAdsTxt?, skadnetworkIds?, ctvMeta?, storeUrl?, platform?, developerPropertyId? (website property id; null unlinks) }.", { id: external_exports.string(), fields }, (a) => client.apps.update(a.id, a.fields));
23527
+ tool("delete_app", "Delete an app (soft-deletes it and its placements).", { id: external_exports.string() }, (a) => client.apps.delete(a.id));
23528
+ tool("verify_app", "Verify an app. developer_site (default): the linked, verified developer website must serve /app-ads.txt with 'adviverse.com, <your account id>, DIRECT' (see get_app_ads_txt). store_listing: also checks the apps.apple.com / play.google.com listing. On failure returns error + message saying what to fix.", { id: external_exports.string(), method: external_exports.enum(["developer_site", "store_listing"]).optional() }, (a) => client.apps.verify(a.id, a.method));
23504
23529
  tool("get_app_ads_txt", "An app's generated app-ads.txt content.", { id: external_exports.string() }, (a) => client.apps.appAdsTxt(a.id));
23505
23530
  tool("report_ivt", "Invalid-traffic breakdown.", reportQuery, (a) => client.reporting.ivt(a));
23506
23531
  tool("report_reach", "Reach & frequency (unique users): total reach, average frequency, a frequency-distribution histogram (impressions per user), and daily unique reach.", reportQuery, (a) => client.reporting.reach(a));
@@ -23647,10 +23672,29 @@ function createServer(client) {
23647
23672
  }
23648
23673
 
23649
23674
  // src/index.ts
23650
- var apiKey = process.env.ADVIVERSE_API_KEY;
23651
- var baseUrl = process.env.ADVIVERSE_BASE_URL || "https://adviverse.com";
23675
+ function cliConfigPath() {
23676
+ const env = process.env;
23677
+ const dir = process.platform === "win32" ? env.APPDATA ?? join(homedir(), "AppData", "Roaming") : process.platform === "darwin" ? join(homedir(), "Library", "Application Support") : env.XDG_CONFIG_HOME || join(homedir(), ".config");
23678
+ return join(dir, "adviverse", "config.json");
23679
+ }
23680
+ function cliConfig() {
23681
+ try {
23682
+ return JSON.parse(readFileSync(cliConfigPath(), "utf8"));
23683
+ } catch {
23684
+ return {};
23685
+ }
23686
+ }
23687
+ var saved = process.env.ADVIVERSE_API_KEY ? {} : cliConfig();
23688
+ var apiKey = process.env.ADVIVERSE_API_KEY || saved.api_key;
23689
+ var baseUrl = process.env.ADVIVERSE_BASE_URL || saved.base_url || "https://adviverse.com";
23652
23690
  if (!apiKey) {
23653
- console.error("ADVIVERSE_API_KEY is required (create one in Settings \u2192 API keys).");
23691
+ console.error(
23692
+ `No API key: set ADVIVERSE_API_KEY (Settings \u2192 API keys) or run \`adviverse login\` (looked in ${cliConfigPath()}).`
23693
+ );
23694
+ process.exit(1);
23695
+ }
23696
+ if (saved.expires_at && Date.parse(saved.expires_at) < Date.now()) {
23697
+ console.error(`The saved CLI key expired at ${saved.expires_at}; run \`adviverse login\` again.`);
23654
23698
  process.exit(1);
23655
23699
  }
23656
23700
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adviverse/mcp",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "MCP server exposing the Adviverse ad network API as tools for AI agents.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -22,8 +22,8 @@
22
22
  "tsup": "^8.3.0",
23
23
  "typescript": "^5.6.2",
24
24
  "@types/node": "^22.0.0",
25
- "@adviverse/sdk": "0.1.6",
26
- "@adnet/shared": "0.1.0"
25
+ "@adnet/shared": "0.1.0",
26
+ "@adviverse/sdk": "0.1.7"
27
27
  },
28
28
  "repository": {
29
29
  "type": "git",