honeybook-mcp 1.0.0 → 1.1.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.
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "metadata": {
9
9
  "description": "HoneyBook client-portal tools for Claude Code",
10
- "version": "1.0.0"
10
+ "version": "1.1.0"
11
11
  },
12
12
  "plugins": [
13
13
  {
@@ -15,7 +15,7 @@
15
15
  "displayName": "HoneyBook",
16
16
  "source": "./",
17
17
  "description": "HoneyBook client-portal MCP for Claude — view wedding-vendor contracts and invoices via MCP",
18
- "version": "1.0.0",
18
+ "version": "1.1.0",
19
19
  "author": {
20
20
  "name": "Chris Chall"
21
21
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "honeybook",
3
3
  "displayName": "HoneyBook",
4
- "version": "1.0.0",
4
+ "version": "1.1.0",
5
5
  "description": "HoneyBook client-portal MCP for Claude — view wedding-vendor contracts and invoices via MCP",
6
6
  "author": {
7
7
  "name": "Chris Chall",
package/README.md CHANGED
@@ -26,7 +26,7 @@ Ask Claude things like:
26
26
  ## Requirements
27
27
 
28
28
  - [Claude Desktop](https://claude.ai/download) or [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
29
- - [Node.js](https://nodejs.org) 20.6 or later
29
+ - [Node.js](https://nodejs.org) 22 or later
30
30
  - Magic-link emails from the wedding vendors that use HoneyBook
31
31
  - [fetchproxy 0.3.0 browser extension](https://github.com/chrischall/fetchproxy) — installed in Chrome (Web Store) or Safari (.dmg). Used by `use_magic_link` to snapshot the session out of your signed-in vendor portal tab.
32
32
 
package/dist/bundle.js CHANGED
@@ -28156,6 +28156,7 @@ function missingClientCapabilities(required2, declared) {
28156
28156
  return Object.keys(missing).length > 0 ? missing : void 0;
28157
28157
  }
28158
28158
  var FIRST_MODERN_PROTOCOL_VERSION = "2026-07-28";
28159
+ var SUPPORTED_MODERN_PROTOCOL_VERSIONS = [FIRST_MODERN_PROTOCOL_VERSION];
28159
28160
  function isModernProtocolVersion(version2) {
28160
28161
  return version2 >= FIRST_MODERN_PROTOCOL_VERSION;
28161
28162
  }
@@ -30714,6 +30715,25 @@ function isSpecNotificationMethod(method) {
30714
30715
  return ALL_CODECS.some((codec2) => codec2.hasNotificationMethod(method));
30715
30716
  }
30716
30717
  var ALL_CODECS = [rev2025Codec, rev2026Codec];
30718
+ function isPlainObject$3(value) {
30719
+ return value !== null && typeof value === "object" && !Array.isArray(value);
30720
+ }
30721
+ function requestMetaOf(params) {
30722
+ if (!isPlainObject$3(params)) return void 0;
30723
+ const meta3 = params["_meta"];
30724
+ return isPlainObject$3(meta3) ? meta3 : void 0;
30725
+ }
30726
+ function hasEnvelopeClaim(params) {
30727
+ const meta3 = requestMetaOf(params);
30728
+ return meta3 !== void 0 && PROTOCOL_VERSION_META_KEY in meta3;
30729
+ }
30730
+ function envelopeClaimVersion(params) {
30731
+ const value = requestMetaOf(params)?.[PROTOCOL_VERSION_META_KEY];
30732
+ return typeof value === "string" ? value : void 0;
30733
+ }
30734
+ function validateEnvelopeMeta(meta3) {
30735
+ return codecForVersion(MODERN_WIRE_REVISION).validateEnvelopeMeta(meta3);
30736
+ }
30717
30737
  var schemas_exports = /* @__PURE__ */ __exportAll({
30718
30738
  AnnotationsSchema: () => AnnotationsSchema,
30719
30739
  AudioContentSchema: () => AudioContentSchema,
@@ -31064,6 +31084,45 @@ var LADDER_ERROR_HTTP_STATUS = {
31064
31084
  [ProtocolErrorCode.MissingRequiredClientCapability]: 400,
31065
31085
  [HEADER_MISMATCH_ERROR_CODE]: 400
31066
31086
  };
31087
+ function rejection(rung, cell, httpStatus, error62, settled) {
31088
+ return {
31089
+ kind: "reject",
31090
+ rung,
31091
+ cell,
31092
+ httpStatus,
31093
+ code: error62.code,
31094
+ message: error62.message,
31095
+ ...error62.data !== void 0 && { data: error62.data },
31096
+ settled
31097
+ };
31098
+ }
31099
+ function carriesValidModernEnvelopeClaim(params) {
31100
+ if (!hasEnvelopeClaim(params)) return false;
31101
+ const claimedVersion = envelopeClaimVersion(params);
31102
+ if (claimedVersion === void 0 || !isModernProtocolVersion(claimedVersion)) return false;
31103
+ const meta3 = requestMetaOf(params);
31104
+ return meta3 !== void 0 && validateEnvelopeMeta(meta3).length === 0;
31105
+ }
31106
+ function modernOnlyStrictRejection(route, supportedVersions) {
31107
+ switch (route.reason) {
31108
+ case "http-method":
31109
+ return rejection("http-method", "modern-only-method-not-allowed", 405, new ProtocolError(-32e3, "Method not allowed."), true);
31110
+ case "batch":
31111
+ return rejection("jsonrpc-shape", "modern-only-batch-not-supported", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, "Bad Request: JSON-RPC batches are not supported by this endpoint"), true);
31112
+ case "response":
31113
+ return rejection("jsonrpc-shape", "modern-only-response-post", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, "Bad Request: JSON-RPC responses cannot be posted to this endpoint"), true);
31114
+ case "notification":
31115
+ return;
31116
+ case "initialize":
31117
+ case "no-claim": {
31118
+ const requested = route.requestedVersion;
31119
+ return rejection("era-classification", "modern-only-missing-envelope", 400, requested === void 0 ? new ProtocolError(ProtocolErrorCode.UnsupportedProtocolVersion, "Unsupported protocol version: the request did not name a protocol version", { supported: [...supportedVersions] }) : new UnsupportedProtocolVersionError({
31120
+ supported: [...supportedVersions],
31121
+ requested
31122
+ }), true);
31123
+ }
31124
+ }
31125
+ }
31067
31126
  function parseSchema(schema, data) {
31068
31127
  return z2.safeParse(schema, data);
31069
31128
  }
@@ -31625,6 +31684,9 @@ function withRequestStateValue(ctx, value) {
31625
31684
  };
31626
31685
  }
31627
31686
  var writeNegotiatedProtocolVersion;
31687
+ function setNegotiatedProtocolVersion(instance, version2) {
31688
+ writeNegotiatedProtocolVersion(instance, version2);
31689
+ }
31628
31690
  var Protocol = class {
31629
31691
  _transport;
31630
31692
  _requestMessageId = 0;
@@ -39568,6 +39630,190 @@ function getCompleter(schema) {
39568
39630
  return schema[COMPLETABLE_SYMBOL]?.complete;
39569
39631
  }
39570
39632
  var MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
39633
+ function listenFilterAccepts(filter, event) {
39634
+ switch (event.kind) {
39635
+ case "tools_list_changed":
39636
+ return filter.toolsListChanged === true;
39637
+ case "prompts_list_changed":
39638
+ return filter.promptsListChanged === true;
39639
+ case "resources_list_changed":
39640
+ return filter.resourcesListChanged === true;
39641
+ case "resource_updated":
39642
+ return filter.resourceSubscriptions !== void 0 && filter.resourceSubscriptions.includes(event.uri);
39643
+ }
39644
+ }
39645
+ function honoredSubset(requested, capabilities) {
39646
+ const honored = {};
39647
+ const allow = (bit) => capabilities === void 0 || bit === true;
39648
+ if (requested.toolsListChanged === true && allow(capabilities?.tools?.listChanged)) honored.toolsListChanged = true;
39649
+ if (requested.promptsListChanged === true && allow(capabilities?.prompts?.listChanged)) honored.promptsListChanged = true;
39650
+ if (requested.resourcesListChanged === true && allow(capabilities?.resources?.listChanged)) honored.resourcesListChanged = true;
39651
+ if (requested.resourceSubscriptions !== void 0 && requested.resourceSubscriptions.length > 0 && allow(capabilities?.resources?.subscribe)) honored.resourceSubscriptions = [...requested.resourceSubscriptions];
39652
+ return honored;
39653
+ }
39654
+ var DEFAULT_MAX_SUBSCRIPTIONS = 1024;
39655
+ function stampSubscriptionId(notification, subscriptionId) {
39656
+ return {
39657
+ method: notification.method,
39658
+ params: {
39659
+ ...notification.params,
39660
+ _meta: {
39661
+ ...notification.params?._meta,
39662
+ [SUBSCRIPTION_ID_META_KEY]: subscriptionId
39663
+ }
39664
+ }
39665
+ };
39666
+ }
39667
+ function parseListenFilter(message) {
39668
+ const outcome = codecForVersion(MODERN_WIRE_REVISION).validateRequest("subscriptions/listen", message);
39669
+ return outcome.ok ? outcome.value.params?.notifications : void 0;
39670
+ }
39671
+ var CHANGE_NOTIFICATION_METHODS = /* @__PURE__ */ new Set([
39672
+ "notifications/tools/list_changed",
39673
+ "notifications/prompts/list_changed",
39674
+ "notifications/resources/list_changed",
39675
+ "notifications/resources/updated"
39676
+ ]);
39677
+ var StdioListenRouter = class {
39678
+ /** Active subscriptions, keyed by the listen request's JSON-RPC id verbatim. */
39679
+ _subs = /* @__PURE__ */ new Map();
39680
+ /**
39681
+ * The serving instance's declared capabilities. Filled in by the entry
39682
+ * once the modern instance is constructed (the router is created before
39683
+ * the instance exists), so the acknowledged filter is narrowed against
39684
+ * what the server can actually deliver.
39685
+ */
39686
+ _serverCapabilities;
39687
+ /**
39688
+ * The serving instance's identity, stamped onto the graceful-close
39689
+ * results' `_meta` (the spec's `SubscriptionsListenResultMeta` extends
39690
+ * `ResultMetaObject`). Handed over together with the capabilities.
39691
+ */
39692
+ _serverInfo;
39693
+ constructor(_maxSubscriptions = DEFAULT_MAX_SUBSCRIPTIONS, serverCapabilities, serverInfo) {
39694
+ this._maxSubscriptions = _maxSubscriptions;
39695
+ this._serverCapabilities = serverCapabilities;
39696
+ this._serverInfo = serverInfo;
39697
+ }
39698
+ /**
39699
+ * Record the serving instance's declared capabilities and identity once
39700
+ * it has been constructed. Called by `serveStdio`'s connect path;
39701
+ * subsequent `serve()` calls narrow the honored filter against the
39702
+ * capabilities, and `teardownAll()` stamps the identity.
39703
+ */
39704
+ setServerCapabilities(capabilities, serverInfo) {
39705
+ this._serverCapabilities = capabilities;
39706
+ if (serverInfo !== void 0) this._serverInfo = serverInfo;
39707
+ }
39708
+ /** Whether `id` is an active listen subscription on this connection. */
39709
+ has(id) {
39710
+ return this._subs.has(id);
39711
+ }
39712
+ /**
39713
+ * Serve one inbound `subscriptions/listen` request: registers the
39714
+ * subscription and returns the stamped acknowledged notification (or, on
39715
+ * capacity / params rejection, the in-band JSON-RPC error response).
39716
+ *
39717
+ * @throws when called before {@linkcode setServerCapabilities} (or the
39718
+ * constructor) has supplied the serving instance's capabilities. Honoring a
39719
+ * filter without knowing the server's advertised capabilities would fail
39720
+ * open (deliver unadvertised types); the entry guarantees capabilities are
39721
+ * set before any listen request is routed here.
39722
+ */
39723
+ serve(message) {
39724
+ if (this._serverCapabilities === void 0) throw new Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");
39725
+ if (this._subs.size >= this._maxSubscriptions) return {
39726
+ jsonrpc: "2.0",
39727
+ id: message.id,
39728
+ error: {
39729
+ code: -32603,
39730
+ message: "Subscription limit reached"
39731
+ }
39732
+ };
39733
+ const filter = parseListenFilter(message);
39734
+ if (filter === void 0) return {
39735
+ jsonrpc: "2.0",
39736
+ id: message.id,
39737
+ error: {
39738
+ code: -32602,
39739
+ message: "Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"
39740
+ }
39741
+ };
39742
+ const honored = honoredSubset(filter, this._serverCapabilities);
39743
+ this._subs.set(message.id, honored);
39744
+ return stampSubscriptionId({
39745
+ method: "notifications/subscriptions/acknowledged",
39746
+ params: { notifications: honored }
39747
+ }, message.id);
39748
+ }
39749
+ /**
39750
+ * Tear down one subscription (inbound `notifications/cancelled`). Returns
39751
+ * `true` when a subscription was removed. After this call NOTHING further
39752
+ * is delivered for that subscription id (the post-cancel hardening).
39753
+ */
39754
+ cancel(id) {
39755
+ return this._subs.delete(id);
39756
+ }
39757
+ /**
39758
+ * Route an outbound notification through the active subscriptions.
39759
+ *
39760
+ * - For a subscription-gated change notification, returns one stamped copy
39761
+ * per subscription that opted in to it (an empty array means it is
39762
+ * dropped — the modern era never delivers an un-requested change type).
39763
+ * - For any other outbound message, returns `'passthrough'` (the entry
39764
+ * forwards it as-is).
39765
+ */
39766
+ routeOutbound(message) {
39767
+ if (!CHANGE_NOTIFICATION_METHODS.has(message.method)) return "passthrough";
39768
+ const uriParam = message.params?.["uri"];
39769
+ const uri = typeof uriParam === "string" ? uriParam : void 0;
39770
+ const event = notificationToServerEvent(message.method, uri);
39771
+ const out = [];
39772
+ for (const [subscriptionId, filter] of this._subs) if (listenFilterAccepts(filter, event)) out.push(stampSubscriptionId({
39773
+ method: message.method,
39774
+ params: message.params ?? {}
39775
+ }, subscriptionId));
39776
+ return out;
39777
+ }
39778
+ /**
39779
+ * Server-side graceful teardown of every active subscription: returns the
39780
+ * empty `subscriptions/listen` JSON-RPC result for each subscription id —
39781
+ * the spec's graceful-close signal, `_meta` carrying the subscription id
39782
+ * and the serving instance's identity — for the entry to emit before
39783
+ * closing the wire. Clears the set so nothing further is delivered.
39784
+ */
39785
+ teardownAll() {
39786
+ const out = [];
39787
+ for (const id of this._subs.keys()) out.push({
39788
+ jsonrpc: "2.0",
39789
+ id,
39790
+ result: {
39791
+ resultType: "complete",
39792
+ _meta: {
39793
+ [SUBSCRIPTION_ID_META_KEY]: id,
39794
+ ...this._serverInfo !== void 0 && { [SERVER_INFO_META_KEY]: this._serverInfo }
39795
+ }
39796
+ }
39797
+ });
39798
+ this._subs.clear();
39799
+ return out;
39800
+ }
39801
+ };
39802
+ function notificationToServerEvent(method, uri) {
39803
+ switch (method) {
39804
+ case "notifications/tools/list_changed":
39805
+ return { kind: "tools_list_changed" };
39806
+ case "notifications/prompts/list_changed":
39807
+ return { kind: "prompts_list_changed" };
39808
+ case "notifications/resources/list_changed":
39809
+ return { kind: "resources_list_changed" };
39810
+ default:
39811
+ return {
39812
+ kind: "resource_updated",
39813
+ uri: uri ?? ""
39814
+ };
39815
+ }
39816
+ }
39571
39817
  var DEFAULT_LEGACY_SHIM_MAX_ROUNDS = 8;
39572
39818
  var DEFAULT_LEGACY_SHIM_ROUND_TIMEOUT_MS = 6e5;
39573
39819
  function resolveLegacyShimOptions(options) {
@@ -39705,6 +39951,12 @@ var INPUT_REQUIRED_CAPABLE_METHODS = /* @__PURE__ */ new Set([
39705
39951
  var writeClientIdentity;
39706
39952
  var installDiscoverHandler;
39707
39953
  var readServerIdentity;
39954
+ function installModernOnlyHandlers(server, servedModernVersions) {
39955
+ installDiscoverHandler(server, servedModernVersions);
39956
+ }
39957
+ function serverIdentityOf(server) {
39958
+ return readServerIdentity(server);
39959
+ }
39708
39960
  var Server = class extends Protocol {
39709
39961
  _clientCapabilities;
39710
39962
  _clientVersion;
@@ -40979,6 +41231,400 @@ var StdioServerTransport = class {
40979
41231
  });
40980
41232
  }
40981
41233
  };
41234
+ var DISCARD_ANSWER_TIMEOUT_MS = 3e3;
41235
+ var StdioConnectionChannel = class {
41236
+ onclose;
41237
+ onerror;
41238
+ onmessage;
41239
+ _closed = false;
41240
+ /** Request ids the entry delivered to the instance that the instance has not yet answered. */
41241
+ _pendingRequests = /* @__PURE__ */ new Set();
41242
+ _drainWaiters = [];
41243
+ constructor(_wire, _onInstanceClose, _outboundIntercept) {
41244
+ this._wire = _wire;
41245
+ this._onInstanceClose = _onInstanceClose;
41246
+ this._outboundIntercept = _outboundIntercept;
41247
+ }
41248
+ async start() {
41249
+ }
41250
+ async send(message, options) {
41251
+ if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
41252
+ const { id } = message;
41253
+ if (id !== void 0) this._settle(id);
41254
+ }
41255
+ if (this._closed) return;
41256
+ if (this._outboundIntercept?.(message) === "handled") return;
41257
+ return this._wire.send(message, options);
41258
+ }
41259
+ setProtocolVersion = (version2) => {
41260
+ this._wire.setProtocolVersion?.(version2);
41261
+ };
41262
+ /** Forwards one inbound message to the connected instance. */
41263
+ deliver(message, extra) {
41264
+ if (this._closed) return;
41265
+ if (isJSONRPCRequest(message)) this._pendingRequests.add(message.id);
41266
+ else if (isJSONRPCNotification(message) && message.method === "notifications/cancelled") {
41267
+ const cancelledId = message.params?.requestId;
41268
+ if (cancelledId !== void 0) this._settle(cancelledId);
41269
+ }
41270
+ this.onmessage?.(message, extra);
41271
+ }
41272
+ /**
41273
+ * Resolves once every request delivered to the instance has been answered
41274
+ * through {@linkcode send}, settled by a delivered cancellation, or the
41275
+ * channel has been closed and nothing further can be answered. The wait is
41276
+ * bounded by `timeoutMs` as a backstop so no edge can hold the caller
41277
+ * indefinitely; resolves `false` only when the bound elapsed with requests
41278
+ * still unanswered. Used by the probe-discard path so a probe request the
41279
+ * entry accepted is never silently dropped.
41280
+ */
41281
+ async whenRequestsAnswered(timeoutMs) {
41282
+ if (this._closed || this._pendingRequests.size === 0) return true;
41283
+ return await new Promise((resolve2) => {
41284
+ const waiter = () => {
41285
+ clearTimeout(timer);
41286
+ resolve2(true);
41287
+ };
41288
+ const timer = setTimeout(() => {
41289
+ this._drainWaiters = this._drainWaiters.filter((pending) => pending !== waiter);
41290
+ resolve2(false);
41291
+ }, timeoutMs);
41292
+ this._drainWaiters.push(waiter);
41293
+ });
41294
+ }
41295
+ async close() {
41296
+ if (this._closed) return;
41297
+ this._closed = true;
41298
+ this._pendingRequests.clear();
41299
+ this._releaseDrainWaiters();
41300
+ try {
41301
+ this._onInstanceClose();
41302
+ } finally {
41303
+ this.onclose?.();
41304
+ }
41305
+ }
41306
+ _settle(id) {
41307
+ this._pendingRequests.delete(id);
41308
+ if (this._pendingRequests.size === 0) this._releaseDrainWaiters();
41309
+ }
41310
+ _releaseDrainWaiters() {
41311
+ const waiters = this._drainWaiters;
41312
+ this._drainWaiters = [];
41313
+ for (const waiter of waiters) waiter();
41314
+ }
41315
+ };
41316
+ function classifyOpeningMessage(message) {
41317
+ const params = message.params;
41318
+ if (message.method === "initialize" && !carriesValidModernEnvelopeClaim(params)) {
41319
+ const requestedVersion = params !== null && typeof params === "object" && typeof params.protocolVersion === "string" ? params.protocolVersion : void 0;
41320
+ return {
41321
+ kind: "legacy",
41322
+ reason: "initialize",
41323
+ ...requestedVersion !== void 0 && { requestedVersion }
41324
+ };
41325
+ }
41326
+ if (!hasEnvelopeClaim(params)) return {
41327
+ kind: "legacy",
41328
+ reason: "no-claim"
41329
+ };
41330
+ const meta3 = requestMetaOf(params);
41331
+ const firstIssue = (meta3 === void 0 ? [] : validateEnvelopeMeta(meta3))[0];
41332
+ if (firstIssue !== void 0) return {
41333
+ kind: "invalid-envelope",
41334
+ issue: firstIssue
41335
+ };
41336
+ const claimedVersion = envelopeClaimVersion(params);
41337
+ if (claimedVersion === void 0 || !SUPPORTED_MODERN_PROTOCOL_VERSIONS.includes(claimedVersion)) return {
41338
+ kind: "unsupported-revision",
41339
+ requested: claimedVersion ?? "unknown"
41340
+ };
41341
+ return {
41342
+ kind: "modern",
41343
+ revision: claimedVersion,
41344
+ classification: {
41345
+ era: "modern",
41346
+ revision: claimedVersion
41347
+ }
41348
+ };
41349
+ }
41350
+ function serveStdio(factory, options = {}) {
41351
+ const legacyMode = options.legacy ?? "serve";
41352
+ const wire = options.transport ?? new StdioServerTransport();
41353
+ let state = { phase: "opening" };
41354
+ let discarding;
41355
+ let closing = false;
41356
+ const isTornDown = () => closing || state.phase === "closed";
41357
+ const reportError = (error62) => {
41358
+ try {
41359
+ options.onerror?.(error62);
41360
+ } catch {
41361
+ }
41362
+ };
41363
+ const writeErrorResponse = (id, code, message, data) => wire.send({
41364
+ jsonrpc: "2.0",
41365
+ id,
41366
+ error: {
41367
+ code,
41368
+ message,
41369
+ ...data !== void 0 && { data }
41370
+ }
41371
+ }).catch((error62) => reportError(toError(error62)));
41372
+ const listenRouter = new StdioListenRouter(options.maxSubscriptions ?? DEFAULT_MAX_SUBSCRIPTIONS);
41373
+ const modernOutboundIntercept = (message) => {
41374
+ if (!isJSONRPCNotification(message)) return void 0;
41375
+ const routed = listenRouter.routeOutbound(message);
41376
+ if (routed === "passthrough") return void 0;
41377
+ for (const stamped of routed) wire.send({
41378
+ jsonrpc: "2.0",
41379
+ ...stamped
41380
+ }).catch((error62) => reportError(toError(error62)));
41381
+ return "handled";
41382
+ };
41383
+ const tryServeListen = async (message) => {
41384
+ if (isJSONRPCRequest(message) && message.method === "subscriptions/listen") {
41385
+ const meta3 = requestMetaOf(message.params);
41386
+ const issue2 = hasEnvelopeClaim(message.params) ? (meta3 === void 0 ? [] : validateEnvelopeMeta(meta3))[0] : {
41387
+ key: "_meta",
41388
+ problem: "the per-request envelope is required on protocol revision 2026-07-28"
41389
+ };
41390
+ const claimedVersion = envelopeClaimVersion(message.params);
41391
+ let reply;
41392
+ if (issue2 !== void 0) reply = {
41393
+ jsonrpc: "2.0",
41394
+ id: message.id,
41395
+ error: {
41396
+ code: -32602,
41397
+ message: `Invalid _meta envelope: ${issue2.key}: ${issue2.problem}`
41398
+ }
41399
+ };
41400
+ else if (claimedVersion === void 0 || !SUPPORTED_MODERN_PROTOCOL_VERSIONS.includes(claimedVersion)) {
41401
+ const error62 = new UnsupportedProtocolVersionError({
41402
+ supported: [...SUPPORTED_MODERN_PROTOCOL_VERSIONS],
41403
+ requested: claimedVersion ?? "unknown"
41404
+ });
41405
+ reply = {
41406
+ jsonrpc: "2.0",
41407
+ id: message.id,
41408
+ error: {
41409
+ code: error62.code,
41410
+ message: error62.message,
41411
+ data: error62.data
41412
+ }
41413
+ };
41414
+ } else reply = listenRouter.serve(message);
41415
+ await wire.send("error" in reply ? reply : {
41416
+ jsonrpc: "2.0",
41417
+ method: reply.method,
41418
+ params: reply.params
41419
+ }).catch((error62) => reportError(toError(error62)));
41420
+ return true;
41421
+ }
41422
+ if (isJSONRPCNotification(message) && message.method === "notifications/cancelled") {
41423
+ const cancelledId = message.params?.requestId;
41424
+ if (cancelledId !== void 0 && listenRouter.cancel(cancelledId)) return true;
41425
+ }
41426
+ return false;
41427
+ };
41428
+ const answerLegacyRejection = (request, reason, requestedVersion) => {
41429
+ const rejection2 = modernOnlyStrictRejection({
41430
+ kind: "legacy",
41431
+ reason,
41432
+ ...requestedVersion !== void 0 && { requestedVersion }
41433
+ }, SUPPORTED_MODERN_PROTOCOL_VERSIONS);
41434
+ if (rejection2 === void 0) return Promise.resolve();
41435
+ reportError(/* @__PURE__ */ new Error(`Rejected 2025-era request on a modern-only stdio connection (${rejection2.cell}): ${rejection2.message}`));
41436
+ return writeErrorResponse(request.id, rejection2.code, rejection2.message, rejection2.data);
41437
+ };
41438
+ const onInstanceClosed = (channel) => {
41439
+ if (closing || channel === discarding) return;
41440
+ closeAll();
41441
+ };
41442
+ const connectInstance = async (era, revision) => {
41443
+ const product = await factory({ era });
41444
+ const server = product instanceof McpServer ? product.server : product;
41445
+ if (era === "modern") {
41446
+ setNegotiatedProtocolVersion(server, revision);
41447
+ installModernOnlyHandlers(server, SUPPORTED_MODERN_PROTOCOL_VERSIONS);
41448
+ listenRouter.setServerCapabilities(server.getCapabilities(), serverIdentityOf(server));
41449
+ }
41450
+ const channel = new StdioConnectionChannel(wire, () => onInstanceClosed(channel), era === "modern" ? modernOutboundIntercept : void 0);
41451
+ await product.connect(channel);
41452
+ return {
41453
+ product,
41454
+ channel
41455
+ };
41456
+ };
41457
+ const disposeLateInstance = (instance) => instance.product.close().catch((error62) => reportError(toError(error62)));
41458
+ const discardProbeInstance = async (instance) => {
41459
+ discarding = instance.channel;
41460
+ try {
41461
+ if (!await instance.channel.whenRequestsAnswered(DISCARD_ANSWER_TIMEOUT_MS)) reportError(/* @__PURE__ */ new Error(`Discarded the probe instance with requests still unanswered after ${DISCARD_ANSWER_TIMEOUT_MS}ms; continuing with the fallback`));
41462
+ await instance.product.close();
41463
+ } catch (error62) {
41464
+ reportError(toError(error62));
41465
+ } finally {
41466
+ discarding = void 0;
41467
+ }
41468
+ };
41469
+ const processMessage = async (message) => {
41470
+ if (state.phase === "closed") return;
41471
+ if (state.phase === "pinned") {
41472
+ if (state.era === "modern" && isJSONRPCRequest(message) && message.method === "initialize" && !carriesValidModernEnvelopeClaim(message.params)) {
41473
+ await answerLegacyRejection(message, "initialize", message.params !== null && typeof message.params === "object" && typeof message.params.protocolVersion === "string" ? message.params.protocolVersion : void 0);
41474
+ return;
41475
+ }
41476
+ if (state.era === "modern" && await tryServeListen(message)) return;
41477
+ state.instance.channel.deliver(message);
41478
+ return;
41479
+ }
41480
+ if (!isJSONRPCRequest(message) && !isJSONRPCNotification(message)) {
41481
+ reportError(/* @__PURE__ */ new Error("Discarded a JSON-RPC response received before the connection negotiated an era"));
41482
+ return;
41483
+ }
41484
+ const opening = classifyOpeningMessage(message);
41485
+ switch (opening.kind) {
41486
+ case "invalid-envelope": {
41487
+ const detail = `Invalid _meta envelope for protocol revision 2026-07-28: ${opening.issue.key}: ${opening.issue.problem}`;
41488
+ if (isJSONRPCRequest(message)) await writeErrorResponse(message.id, ProtocolErrorCode.InvalidParams, detail, { envelope: opening.issue });
41489
+ else reportError(/* @__PURE__ */ new Error(`Discarded a notification with a malformed envelope: ${detail}`));
41490
+ return;
41491
+ }
41492
+ case "unsupported-revision":
41493
+ if (isJSONRPCRequest(message)) {
41494
+ const error62 = new UnsupportedProtocolVersionError({
41495
+ supported: [...SUPPORTED_MODERN_PROTOCOL_VERSIONS],
41496
+ requested: opening.requested
41497
+ });
41498
+ reportError(error62);
41499
+ await writeErrorResponse(message.id, error62.code, error62.message, error62.data);
41500
+ } else reportError(/* @__PURE__ */ new Error(`Discarded a notification claiming unsupported protocol revision ${opening.requested}`));
41501
+ return;
41502
+ case "modern":
41503
+ if (isJSONRPCRequest(message) && message.method === "server/discover") {
41504
+ if (state.phase === "probe") {
41505
+ state.instance.channel.deliver(message, { classification: opening.classification });
41506
+ return;
41507
+ }
41508
+ const instance = await connectInstance("modern", opening.revision);
41509
+ if (isTornDown()) {
41510
+ await disposeLateInstance(instance);
41511
+ return;
41512
+ }
41513
+ state = {
41514
+ phase: "probe",
41515
+ instance
41516
+ };
41517
+ instance.channel.deliver(message, { classification: opening.classification });
41518
+ return;
41519
+ }
41520
+ if (state.phase === "probe") {
41521
+ if (isJSONRPCNotification(message)) {
41522
+ state.instance.channel.deliver(message, { classification: opening.classification });
41523
+ return;
41524
+ }
41525
+ state = {
41526
+ phase: "pinned",
41527
+ era: "modern",
41528
+ instance: state.instance
41529
+ };
41530
+ } else {
41531
+ const instance = await connectInstance("modern", opening.revision);
41532
+ if (isTornDown()) {
41533
+ await disposeLateInstance(instance);
41534
+ return;
41535
+ }
41536
+ state = {
41537
+ phase: "pinned",
41538
+ era: "modern",
41539
+ instance
41540
+ };
41541
+ }
41542
+ if (await tryServeListen(message)) return;
41543
+ state.instance.channel.deliver(message, { classification: opening.classification });
41544
+ return;
41545
+ case "legacy": {
41546
+ if (legacyMode === "reject") {
41547
+ if (isJSONRPCRequest(message)) await answerLegacyRejection(message, opening.reason, opening.requestedVersion);
41548
+ return;
41549
+ }
41550
+ if (state.phase === "probe") {
41551
+ await discardProbeInstance(state.instance);
41552
+ if (isTornDown()) return;
41553
+ state = { phase: "opening" };
41554
+ }
41555
+ const instance = await connectInstance("legacy");
41556
+ if (isTornDown()) {
41557
+ await disposeLateInstance(instance);
41558
+ return;
41559
+ }
41560
+ state = {
41561
+ phase: "pinned",
41562
+ era: "legacy",
41563
+ instance
41564
+ };
41565
+ state.instance.channel.deliver(message);
41566
+ return;
41567
+ }
41568
+ }
41569
+ };
41570
+ const queue = [];
41571
+ let pumping = false;
41572
+ const pump = async () => {
41573
+ if (pumping) return;
41574
+ pumping = true;
41575
+ try {
41576
+ while (queue.length > 0) {
41577
+ const message = queue.shift();
41578
+ try {
41579
+ await processMessage(message);
41580
+ } catch (error62) {
41581
+ if (isJSONRPCRequest(message)) await writeErrorResponse(message.id, ProtocolErrorCode.InternalError, "Internal server error");
41582
+ reportError(toError(error62));
41583
+ }
41584
+ }
41585
+ } finally {
41586
+ pumping = false;
41587
+ }
41588
+ };
41589
+ const closeAll = async () => {
41590
+ if (closing || state.phase === "closed") return;
41591
+ closing = true;
41592
+ const current = state;
41593
+ state = { phase: "closed" };
41594
+ for (const result of listenRouter.teardownAll()) await wire.send(result).catch((error62) => reportError(toError(error62)));
41595
+ if (current.phase === "probe" || current.phase === "pinned") await current.instance.product.close().catch((error62) => reportError(toError(error62)));
41596
+ await wire.close().catch((error62) => reportError(toError(error62)));
41597
+ };
41598
+ wire.onmessage = (message) => {
41599
+ queue.push(message);
41600
+ pump();
41601
+ };
41602
+ wire.onerror = (error62) => {
41603
+ reportError(error62);
41604
+ if (state.phase === "probe" || state.phase === "pinned") state.instance.channel.onerror?.(error62);
41605
+ };
41606
+ wire.onclose = () => {
41607
+ if (closing || state.phase === "closed") return;
41608
+ closing = true;
41609
+ const current = state;
41610
+ state = { phase: "closed" };
41611
+ if (current.phase === "probe" || current.phase === "pinned") current.instance.product.close().catch((error62) => reportError(toError(error62)));
41612
+ };
41613
+ const started = wire.start().catch((error62) => {
41614
+ reportError(toError(error62));
41615
+ throw error62;
41616
+ });
41617
+ started.catch(() => {
41618
+ });
41619
+ return { close: async () => {
41620
+ await started.catch(() => {
41621
+ });
41622
+ await closeAll();
41623
+ } };
41624
+ }
41625
+ function toError(value) {
41626
+ return value instanceof Error ? value : new Error(String(value));
41627
+ }
40982
41628
 
40983
41629
  // node_modules/@chrischall/mcp-utils/dist/errors/index.js
40984
41630
  var DEFAULT_ERROR_MESSAGE_MAX = 500;
@@ -60784,7 +61430,7 @@ async function createMcpServer(opts) {
60784
61430
  }
60785
61431
  return server;
60786
61432
  }
60787
- function withGracefulShutdown(server, opts = {}) {
61433
+ function withGracefulShutdown(target, opts = {}) {
60788
61434
  const shouldExit = opts.exit ?? true;
60789
61435
  let shuttingDown = false;
60790
61436
  const handler = (signal) => {
@@ -60795,7 +61441,7 @@ function withGracefulShutdown(server, opts = {}) {
60795
61441
  try {
60796
61442
  if (opts.onSignal)
60797
61443
  await opts.onSignal(signal);
60798
- await server.close();
61444
+ await target.close();
60799
61445
  } catch (err) {
60800
61446
  console.error(`[mcp-utils] error during graceful shutdown on ${signal}: ${err instanceof Error ? err.message : String(err)}`);
60801
61447
  } finally {
@@ -60807,16 +61453,26 @@ function withGracefulShutdown(server, opts = {}) {
60807
61453
  process.on("SIGINT", () => handler("SIGINT"));
60808
61454
  process.on("SIGTERM", () => handler("SIGTERM"));
60809
61455
  }
60810
- async function runMcp(opts) {
60811
- const server = await createMcpServer(opts);
61456
+ function runMcp(opts) {
61457
+ if (opts.banner !== void 0) {
61458
+ console.error(opts.banner);
61459
+ }
61460
+ const spec = opts.transport ?? "stdio";
61461
+ const handle = serveStdio(() => createMcpServer({ ...opts, banner: void 0 }), {
61462
+ legacy: opts.legacy ?? "serve",
61463
+ onerror: opts.onerror ?? ((error62) => {
61464
+ console.error(`[mcp-utils] stdio server error: ${redactSecrets(error62.message)}`);
61465
+ }),
61466
+ // `'stdio'` means "let the entry make its own StdioServerTransport over
61467
+ // this process"; anything else is the caller's transport, which the entry
61468
+ // then owns (it starts it, pumps it, and closes it with the handle).
61469
+ ...spec === "stdio" ? {} : { transport: spec }
61470
+ });
60812
61471
  const shutdown = opts.shutdown ?? true;
60813
61472
  if (shutdown !== false) {
60814
- withGracefulShutdown(server, shutdown === true ? {} : shutdown);
61473
+ withGracefulShutdown(handle, shutdown === true ? {} : shutdown);
60815
61474
  }
60816
- const spec = opts.transport ?? "stdio";
60817
- const transport = spec === "stdio" ? new StdioServerTransport() : spec;
60818
- await server.connect(transport);
60819
- return server;
61475
+ return handle;
60820
61476
  }
60821
61477
 
60822
61478
  // node_modules/@chrischall/mcp-utils/dist/config/index.js
@@ -66475,7 +67131,7 @@ function bridgeErrorInfo(err) {
66475
67131
  // package.json
66476
67132
  var package_default = {
66477
67133
  name: "honeybook-mcp",
66478
- version: "1.0.0",
67134
+ version: "1.1.0",
66479
67135
  mcpName: "io.github.chrischall/honeybook-mcp",
66480
67136
  description: "HoneyBook client-portal MCP server for Claude",
66481
67137
  author: "Claude Code (AI) <https://www.anthropic.com/claude>",
@@ -66504,7 +67160,7 @@ var package_default = {
66504
67160
  "mint.yaml"
66505
67161
  ],
66506
67162
  engines: {
66507
- node: ">=20.6.0"
67163
+ node: ">=22.0.0"
66508
67164
  },
66509
67165
  type: "module",
66510
67166
  bin: {
@@ -66519,7 +67175,7 @@ var package_default = {
66519
67175
  typecheck: "tsc -p tsconfig.json --noEmit"
66520
67176
  },
66521
67177
  dependencies: {
66522
- "@chrischall/mcp-utils": "^0.28.0",
67178
+ "@chrischall/mcp-utils": "^1.0.0",
66523
67179
  "@fetchproxy/bootstrap": "^3.0.1",
66524
67180
  "@fetchproxy/server": "^3.0.1",
66525
67181
  "@modelcontextprotocol/server": "^2.0.0",
@@ -68292,7 +68948,7 @@ var __dirname = dirname2(fileURLToPath(import.meta.url));
68292
68948
  await loadDotenvSafely({ path: join6(__dirname, "..", ".env"), override: false });
68293
68949
  await runMcp({
68294
68950
  name: "honeybook-mcp",
68295
- version: "1.0.0",
68951
+ version: "1.1.0",
68296
68952
  // x-release-please-version
68297
68953
  tools: [
68298
68954
  registerSessionTools,
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ import { registerAttachmentTools } from './tools/attachments.js';
20
20
  import { registerPaymentTools } from './tools/payments.js';
21
21
  await runMcp({
22
22
  name: 'honeybook-mcp',
23
- version: '1.0.0', // x-release-please-version
23
+ version: '1.1.0', // x-release-please-version
24
24
  tools: [
25
25
  registerSessionTools,
26
26
  registerFlowTools,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "honeybook-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "mcpName": "io.github.chrischall/honeybook-mcp",
5
5
  "description": "HoneyBook client-portal MCP server for Claude",
6
6
  "author": "Claude Code (AI) <https://www.anthropic.com/claude>",
@@ -29,7 +29,7 @@
29
29
  "mint.yaml"
30
30
  ],
31
31
  "engines": {
32
- "node": ">=20.6.0"
32
+ "node": ">=22.0.0"
33
33
  },
34
34
  "type": "module",
35
35
  "bin": {
@@ -44,7 +44,7 @@
44
44
  "typecheck": "tsc -p tsconfig.json --noEmit"
45
45
  },
46
46
  "dependencies": {
47
- "@chrischall/mcp-utils": "^0.28.0",
47
+ "@chrischall/mcp-utils": "^1.0.0",
48
48
  "@fetchproxy/bootstrap": "^3.0.1",
49
49
  "@fetchproxy/server": "^3.0.1",
50
50
  "@modelcontextprotocol/server": "^2.0.0",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/chrischall/honeybook-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "1.0.0",
9
+ "version": "1.1.0",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "honeybook-mcp",
14
- "version": "1.0.0",
14
+ "version": "1.1.0",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },