listbee-mcp 0.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.
Files changed (48) hide show
  1. package/LICENSE +184 -0
  2. package/README.md +202 -0
  3. package/dist/client.d.ts +18 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +61 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +98 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/manifest.d.ts +22 -0
  12. package/dist/manifest.d.ts.map +1 -0
  13. package/dist/manifest.js +26 -0
  14. package/dist/manifest.js.map +1 -0
  15. package/dist/schemas.d.ts +87 -0
  16. package/dist/schemas.d.ts.map +1 -0
  17. package/dist/schemas.js +137 -0
  18. package/dist/schemas.js.map +1 -0
  19. package/dist/server.d.ts +12 -0
  20. package/dist/server.d.ts.map +1 -0
  21. package/dist/server.js +149 -0
  22. package/dist/server.js.map +1 -0
  23. package/dist/tools/files.d.ts +7 -0
  24. package/dist/tools/files.d.ts.map +1 -0
  25. package/dist/tools/files.js +34 -0
  26. package/dist/tools/files.js.map +1 -0
  27. package/dist/tools/listings.d.ts +44 -0
  28. package/dist/tools/listings.d.ts.map +1 -0
  29. package/dist/tools/listings.js +83 -0
  30. package/dist/tools/listings.js.map +1 -0
  31. package/dist/tools/orders.d.ts +15 -0
  32. package/dist/tools/orders.d.ts.map +1 -0
  33. package/dist/tools/orders.js +28 -0
  34. package/dist/tools/orders.js.map +1 -0
  35. package/dist/tools/shared.d.ts +18 -0
  36. package/dist/tools/shared.d.ts.map +1 -0
  37. package/dist/tools/shared.js +31 -0
  38. package/dist/tools/shared.js.map +1 -0
  39. package/dist/tools/stripe.d.ts +4 -0
  40. package/dist/tools/stripe.d.ts.map +1 -0
  41. package/dist/tools/stripe.js +21 -0
  42. package/dist/tools/stripe.js.map +1 -0
  43. package/dist/types.d.ts +22 -0
  44. package/dist/types.d.ts.map +1 -0
  45. package/dist/types.js +61 -0
  46. package/dist/types.js.map +1 -0
  47. package/mcp-tools.yaml +170 -0
  48. package/package.json +44 -0
package/LICENSE ADDED
@@ -0,0 +1,184 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other transformations
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submitted" means any form of electronic, verbal,
51
+ or written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of developing and
55
+ discussing the Work, but excluding communication that is conspicuously
56
+ marked or designated in writing by the copyright owner as "Not a
57
+ Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and included
61
+ within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by the combination of their Contributions
78
+ with the Work to which such Contributions were submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or any other
81
+ Contribution embodied within the Work constitutes patent or
82
+ contributory patent infringement, then any patent licenses granted
83
+ to You under this License for that Work shall terminate as of the
84
+ date such litigation is filed.
85
+
86
+ 4. Redistribution. You may reproduce and distribute copies of the
87
+ Work or Derivative Works thereof in any medium, with or without
88
+ modifications, and in Source or Object form, provided that You
89
+ meet the following conditions:
90
+
91
+ (a) You must give any other recipients of the Work or Derivative
92
+ Works a copy of this License; and
93
+
94
+ (b) You must cause any modified files to carry prominent notices
95
+ stating that You changed the files; and
96
+
97
+ (c) You must retain, in all Source form of any Derivative Works
98
+ that You distribute, all copyright, patent, trademark, and
99
+ attribution notices from the Source form of the Work,
100
+ excluding those notices that do not pertain to any part of
101
+ the Derivative Works; and
102
+
103
+ (d) If the Work includes a "NOTICE" text file as part of its
104
+ distribution, You must include a readable copy of the
105
+ attribution notices contained within such NOTICE file, in
106
+ at least one of the following places: within a NOTICE text
107
+ file distributed as part of the Derivative Works; within
108
+ the Source form or documentation, if provided along with the
109
+ Derivative Works; or, within a display generated by the
110
+ Derivative Works, if and wherever such third-party notices
111
+ normally appear. The contents of the NOTICE file are for
112
+ informational purposes only and do not modify the License.
113
+ You may add Your own attribution notices within Derivative
114
+ Works that You distribute, alongside or in addition to the
115
+ NOTICE text from the Work, provided that such additional
116
+ attribution notices cannot be construed as modifying the
117
+ License.
118
+
119
+ You may add Your own license statement for Your modifications and
120
+ may provide additional grant of rights to use, copy, modify, merge,
121
+ publish, distribute, sublicense, and/or sell copies of the
122
+ Modifications, and to permit persons to whom the Modifications are
123
+ furnished to do so.
124
+
125
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
126
+ any Contribution intentionally submitted for inclusion in the Work
127
+ by You to the Licensor shall be under the terms and conditions of
128
+ this License, without any additional terms or conditions.
129
+ Notwithstanding the above, nothing herein shall supersede or modify
130
+ the terms of any separate license agreement you may have executed
131
+ with Licensor regarding such Contributions.
132
+
133
+ 6. Trademarks. This License does not grant permission to use the trade
134
+ names, trademarks, service marks, or product names of the Licensor,
135
+ except as required for reasonable and customary use in describing the
136
+ origin of the Work and reproducing the content of the NOTICE file.
137
+
138
+ 7. Disclaimer of Warranty. Unless required by applicable law or
139
+ agreed to in writing, Licensor provides the Work (and each
140
+ Contributor provides its Contributions) on an "AS IS" BASIS,
141
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
142
+ implied, including, without limitation, any conditions of title,
143
+ non-infringement, merchantability, or fitness for a particular
144
+ purpose. You are solely responsible for determining the
145
+ appropriateness of using or reproducing the Work and assume any
146
+ risks associated with Your exercise of permissions under this License.
147
+
148
+ 8. Limitation of Liability. In no event and under no legal theory,
149
+ whether in tort (including negligence), contract, or otherwise,
150
+ unless required by applicable law (such as deliberate and grossly
151
+ negligent acts) or agreed to in writing, shall any Contributor be
152
+ liable to You for damages, including any direct, indirect, special,
153
+ incidental, or exemplary damages of any character arising as a
154
+ result of this License or out of the use or inability to use the
155
+ Work (even if such Contributor has been advised of the possibility
156
+ of such damages).
157
+
158
+ 9. Accepting Warranty or Additional Liability. While redistributing
159
+ the Work or Derivative Works thereof, You may choose to offer,
160
+ and charge a fee for, acceptance of support, warranty, indemnity,
161
+ or other liability obligations and/or rights consistent with this
162
+ License. However, in accepting such obligations, You may offer only
163
+ conditions consistent with this License, for the sole responsibility
164
+ of, and with all risk to, the User, and not on behalf of any other
165
+ Contributor. By accepting such terms, You agree to indemnify,
166
+ defend, and hold each Contributor harmless for any liability
167
+ incurred by, or claims asserted against, such Contributor by reason
168
+ of your accepting any such warranty or additional liability.
169
+
170
+ END OF TERMS AND CONDITIONS
171
+
172
+ Copyright 2026 ListBee
173
+
174
+ Licensed under the Apache License, Version 2.0 (the "License");
175
+ you may not use this file except in compliance with the License.
176
+ You may obtain a copy of the License at
177
+
178
+ http://www.apache.org/licenses/LICENSE-2.0
179
+
180
+ Unless required by applicable law or agreed to in writing, software
181
+ distributed under the License is distributed on an "AS IS" BASIS,
182
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183
+ See the License for the specific language governing permissions and
184
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,202 @@
1
+ # listbee-mcp
2
+
3
+ MCP server for ListBee — commerce API for AI agents.
4
+
5
+ ---
6
+
7
+ ## Golden Path
8
+
9
+ Four calls to go from zero to a live, selling product page:
10
+
11
+ ```
12
+ create_listing → set_deliverables → get_listing → publish_listing
13
+ name, price file/url/text check status go live
14
+ ```
15
+
16
+ **1. Create**
17
+ ```json
18
+ { "name": "50 Cold Outreach Templates", "price": 1900 }
19
+ ```
20
+
21
+ **2. Set deliverables** — attach what buyers receive after payment
22
+ ```json
23
+ { "deliverables": [{ "type": "url", "value": "https://...", "label": "Download" }] }
24
+ ```
25
+
26
+ **3. Inspect readiness** — `get_listing` tells you what's missing and how to fix it
27
+
28
+ **4. Publish** — `publish_listing` makes the product page live
29
+
30
+ ---
31
+
32
+ ## Install
33
+
34
+ ### Claude Desktop
35
+
36
+ `~/.claude/claude_desktop_config.json`
37
+
38
+ ```json
39
+ {
40
+ "mcpServers": {
41
+ "listbee": {
42
+ "command": "npx",
43
+ "args": ["listbee-mcp", "--api-key", "lb_..."]
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ Or with an env var:
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "listbee": {
55
+ "command": "npx",
56
+ "args": ["listbee-mcp"],
57
+ "env": {
58
+ "LISTBEE_API_KEY": "lb_..."
59
+ }
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ### Cursor
66
+
67
+ `.cursor/mcp.json`
68
+
69
+ ```json
70
+ {
71
+ "mcpServers": {
72
+ "listbee": {
73
+ "command": "npx",
74
+ "args": ["listbee-mcp", "--api-key", "lb_..."]
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ ### Claude Code
81
+
82
+ ```bash
83
+ claude mcp add listbee -- npx listbee-mcp --api-key lb_...
84
+ ```
85
+
86
+ ### CLI
87
+
88
+ ```bash
89
+ npx listbee-mcp --api-key lb_...
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Options
95
+
96
+ | Flag | Env var | Default | Description |
97
+ |------|---------|---------|-------------|
98
+ | `--api-key <key>` | `LISTBEE_API_KEY` | — | ListBee API key (required) |
99
+ | `--base-url <url>` | `LISTBEE_BASE_URL` | `https://api.listbee.so` | API base URL |
100
+ | `--tools <list>` | — | all tools | Comma-separated list of tools to load |
101
+
102
+ **Selective tool loading** — load only what you need:
103
+
104
+ ```bash
105
+ npx listbee-mcp --api-key lb_... --tools create_listing,get_listing,publish_listing
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Tools
111
+
112
+ ### Listings
113
+
114
+ | Tool | Description |
115
+ |------|-------------|
116
+ | `create_listing` | Create a new listing. Returns checkout URL and readiness. |
117
+ | `get_listing` | Get full listing state including readiness. Call after every change. |
118
+ | `update_listing` | Update title, price, or other listing details. |
119
+ | `list_listings` | List all listings for the current account. |
120
+ | `publish_listing` | Publish a listing so buyers can access the product page. |
121
+ | `set_deliverables` | Attach digital content (file, URL, or text) for automatic delivery. |
122
+ | `remove_deliverables` | Remove deliverables to switch to external fulfillment. |
123
+ | `delete_listing` | Permanently delete a listing. |
124
+
125
+ ### Orders
126
+
127
+ | Tool | Description |
128
+ |------|-------------|
129
+ | `list_orders` | See all sales and order status. |
130
+ | `get_order` | Get full order details including buyer info and payment. |
131
+ | `deliver_order` | Push digital content to a buyer (external fulfillment only). |
132
+
133
+ ### Files
134
+
135
+ | Tool | Description |
136
+ |------|-------------|
137
+ | `upload_file` | Upload a file to ListBee. Returns a token to use in `set_deliverables`. |
138
+
139
+ ### Stripe
140
+
141
+ | Tool | Description |
142
+ |------|-------------|
143
+ | `start_stripe_connect` | Start Stripe Connect onboarding. Returns a URL — the human must open it in a browser. |
144
+
145
+ ---
146
+
147
+ ## Readiness
148
+
149
+ Every listing response includes a `readiness` object that tells you exactly what's needed before the listing can go live — and how to fix it.
150
+
151
+ ```json
152
+ {
153
+ "readiness": {
154
+ "sellable": false,
155
+ "publishable": false,
156
+ "actions": [
157
+ {
158
+ "code": "stripe_not_connected",
159
+ "kind": "human",
160
+ "message": "Connect a Stripe account to accept payments.",
161
+ "resolve": {
162
+ "method": "POST",
163
+ "endpoint": "/v1/account/stripe/connect"
164
+ }
165
+ }
166
+ ],
167
+ "next": "stripe_not_connected"
168
+ }
169
+ }
170
+ ```
171
+
172
+ **What to do with it:**
173
+
174
+ - `readiness.sellable` — `true` means buyers can purchase right now
175
+ - `readiness.publishable` — `true` means you can call `publish_listing`
176
+ - `readiness.actions` — list of what's blocking, each with `kind: "api"` or `kind: "human"`
177
+ - `api` actions: the agent handles them (call the endpoint in `resolve`)
178
+ - `human` actions: requires human input (show the `message` and `url`)
179
+ - `readiness.next` — the highest-priority action code to resolve first
180
+
181
+ **The pattern:** `create_listing` → `get_listing` → resolve each `api` action → surface `human` actions to the user → `publish_listing` when `publishable` is `true`.
182
+
183
+ ---
184
+
185
+ ## Get an API Key
186
+
187
+ [console.listbee.so](https://console.listbee.so) — sign in, go to API Keys.
188
+
189
+ ---
190
+
191
+ ## Links
192
+
193
+ - [API Reference](https://docs.listbee.so/api-reference) — full endpoint docs
194
+ - [OpenAPI Spec](https://api.listbee.so/openapi.json) — machine-readable spec
195
+ - [Docs](https://docs.listbee.so) — guides and integration examples
196
+ - [GitHub](https://github.com/listbee-dev/listbee-mcp) — source
197
+
198
+ ---
199
+
200
+ ## License
201
+
202
+ Apache-2.0
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Thin fetch wrapper for the ListBee REST API.
3
+ * All requests include Authorization header. Non-2xx throws ListBeeApiError.
4
+ */
5
+ export declare class ListBeeClient {
6
+ private readonly apiKey;
7
+ private readonly baseUrl;
8
+ constructor(apiKey: string, baseUrl?: string);
9
+ /**
10
+ * Make an authenticated JSON request. Returns parsed response body.
11
+ */
12
+ request<T = unknown>(method: string, path: string, body?: unknown): Promise<T>;
13
+ /**
14
+ * Upload a file via multipart form data to /v1/files.
15
+ */
16
+ uploadFile(fileBuffer: Uint8Array, filename: string): Promise<unknown>;
17
+ }
18
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,MAAM,EAAE,MAAM,EAAE,OAAO,SAA2B;IAM9D;;OAEG;IACG,OAAO,CAAC,CAAC,GAAG,OAAO,EACvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,GACb,OAAO,CAAC,CAAC,CAAC;IA8Bb;;OAEG;IACG,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAsB7E"}
package/dist/client.js ADDED
@@ -0,0 +1,61 @@
1
+ import { ListBeeApiError } from "./types.js";
2
+ /**
3
+ * Thin fetch wrapper for the ListBee REST API.
4
+ * All requests include Authorization header. Non-2xx throws ListBeeApiError.
5
+ */
6
+ export class ListBeeClient {
7
+ apiKey;
8
+ baseUrl;
9
+ constructor(apiKey, baseUrl = "https://api.listbee.so") {
10
+ this.apiKey = apiKey;
11
+ // Strip trailing slash
12
+ this.baseUrl = baseUrl.replace(/\/+$/, "");
13
+ }
14
+ /**
15
+ * Make an authenticated JSON request. Returns parsed response body.
16
+ */
17
+ async request(method, path, body) {
18
+ const url = `${this.baseUrl}${path}`;
19
+ const headers = {
20
+ Authorization: `Bearer ${this.apiKey}`,
21
+ Accept: "application/json",
22
+ };
23
+ const init = { method, headers };
24
+ if (body !== undefined) {
25
+ headers["Content-Type"] = "application/json";
26
+ init.body = JSON.stringify(body);
27
+ }
28
+ const res = await fetch(url, init);
29
+ // Handle 204 No Content
30
+ if (res.status === 204) {
31
+ return undefined;
32
+ }
33
+ const json = await res.json();
34
+ if (!res.ok) {
35
+ throw new ListBeeApiError(res.status, json);
36
+ }
37
+ return json;
38
+ }
39
+ /**
40
+ * Upload a file via multipart form data to /v1/files.
41
+ */
42
+ async uploadFile(fileBuffer, filename) {
43
+ const url = `${this.baseUrl}/v1/files`;
44
+ const form = new FormData();
45
+ const blob = new Blob([fileBuffer]);
46
+ form.append("file", blob, filename);
47
+ const res = await fetch(url, {
48
+ method: "POST",
49
+ headers: {
50
+ Authorization: `Bearer ${this.apiKey}`,
51
+ },
52
+ body: form,
53
+ });
54
+ const json = await res.json();
55
+ if (!res.ok) {
56
+ throw new ListBeeApiError(res.status, json);
57
+ }
58
+ return json;
59
+ }
60
+ }
61
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;;GAGG;AACH,MAAM,OAAO,aAAa;IACP,MAAM,CAAS;IACf,OAAO,CAAS;IAEjC,YAAY,MAAc,EAAE,OAAO,GAAG,wBAAwB;QAC5D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,uBAAuB;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CACX,MAAc,EACd,IAAY,EACZ,IAAc;QAEd,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC;QACrC,MAAM,OAAO,GAA2B;YACtC,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;YACtC,MAAM,EAAE,kBAAkB;SAC3B,CAAC;QAEF,MAAM,IAAI,GAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QAE9C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;YAC7C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEnC,wBAAwB;QACxB,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACvB,OAAO,SAAc,CAAC;QACxB,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAE9B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC;QAED,OAAO,IAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,UAAsB,EAAE,QAAgB;QACvD,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,WAAW,CAAC;QACvC,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,UAAsB,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAEpC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAC3B,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;aACvC;YACD,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAE9B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
+ import { createServer } from "./server.js";
4
+ function parseArgs(argv) {
5
+ const result = { help: false };
6
+ const args = argv.slice(2); // skip node and script path
7
+ for (let i = 0; i < args.length; i++) {
8
+ const arg = args[i];
9
+ if (arg === "--help" || arg === "-h") {
10
+ result.help = true;
11
+ }
12
+ else if (arg === "--api-key" && i + 1 < args.length) {
13
+ result.apiKey = args[++i];
14
+ }
15
+ else if (arg === "--base-url" && i + 1 < args.length) {
16
+ result.baseUrl = args[++i];
17
+ }
18
+ else if (arg === "--tools" && i + 1 < args.length) {
19
+ result.tools = args[++i].split(",").map((s) => s.trim()).filter(Boolean);
20
+ }
21
+ }
22
+ return result;
23
+ }
24
+ function resolveConfig(parsed) {
25
+ const apiKey = parsed.apiKey ?? process.env.LISTBEE_API_KEY;
26
+ if (!apiKey) {
27
+ return {
28
+ ok: false,
29
+ error: "API key required. Set LISTBEE_API_KEY environment variable or pass --api-key <key>.",
30
+ };
31
+ }
32
+ const baseUrl = parsed.baseUrl ?? process.env.LISTBEE_BASE_URL;
33
+ const toolFilter = parsed.tools ? new Set(parsed.tools) : undefined;
34
+ return { ok: true, config: { apiKey, baseUrl, toolFilter } };
35
+ }
36
+ // --- Help text ---
37
+ const HELP_TEXT = `
38
+ listbee-mcp — MCP server for ListBee commerce API
39
+
40
+ Usage:
41
+ listbee-mcp [options]
42
+
43
+ Options:
44
+ --api-key <key> ListBee API key (or set LISTBEE_API_KEY env var)
45
+ --base-url <url> API base URL (default: https://api.listbee.so)
46
+ --tools <list> Comma-separated tool names to expose (default: all)
47
+ -h, --help Show this help text
48
+
49
+ Examples:
50
+ LISTBEE_API_KEY=lb_xxx listbee-mcp
51
+ listbee-mcp --api-key lb_xxx
52
+ listbee-mcp --api-key lb_xxx --tools create_listing,get_listing,publish_listing
53
+
54
+ Claude Desktop config (claude_desktop_config.json):
55
+ {
56
+ "mcpServers": {
57
+ "listbee": {
58
+ "command": "npx",
59
+ "args": ["-y", "listbee-mcp"],
60
+ "env": { "LISTBEE_API_KEY": "lb_xxx" }
61
+ }
62
+ }
63
+ }
64
+ `.trim();
65
+ // --- Main ---
66
+ async function main() {
67
+ // Handle signals gracefully
68
+ process.on("SIGINT", () => process.exit(0));
69
+ process.on("SIGTERM", () => process.exit(0));
70
+ const parsed = parseArgs(process.argv);
71
+ if (parsed.help) {
72
+ console.error(HELP_TEXT);
73
+ process.exit(0);
74
+ }
75
+ const result = resolveConfig(parsed);
76
+ if (!result.ok) {
77
+ console.error(`Error: ${result.error}`);
78
+ process.exit(1);
79
+ }
80
+ const { config } = result;
81
+ console.error("Starting ListBee MCP server...");
82
+ if (config.toolFilter && config.toolFilter.size > 0) {
83
+ console.error(` Tool filter: ${[...config.toolFilter].join(", ")}`);
84
+ }
85
+ const server = createServer({
86
+ apiKey: config.apiKey,
87
+ baseUrl: config.baseUrl,
88
+ toolFilter: config.toolFilter,
89
+ });
90
+ const transport = new StdioServerTransport();
91
+ await server.connect(transport);
92
+ console.error("ListBee MCP server running on stdio.");
93
+ }
94
+ main().catch((err) => {
95
+ console.error("Fatal error:", err);
96
+ process.exit(1);
97
+ });
98
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAW3C,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,MAAM,GAAe,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,4BAA4B;IAExD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;Y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CAAC;IAED,MAAM,MAAM,GAAG,YAAY,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,UAAU,EAAE,MAAM,CAAC,UAAU;KAC9B,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;AACxD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ export interface ToolMeta {
2
+ type: string;
3
+ operation_id: string;
4
+ name: string;
5
+ category: string;
6
+ priority: number;
7
+ status: string;
8
+ requires_human?: boolean;
9
+ when_to_use: string;
10
+ description?: string;
11
+ hints?: string[];
12
+ input_example?: Record<string, unknown>;
13
+ }
14
+ /**
15
+ * Load mcp-tools.yaml from the package root and return active tools.
16
+ */
17
+ export declare function loadManifest(): ToolMeta[];
18
+ /**
19
+ * Index manifest tools by name for quick lookup.
20
+ */
21
+ export declare function indexManifest(tools: ToolMeta[]): Map<string, ToolMeta>;
22
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAOD;;GAEG;AACH,wBAAgB,YAAY,IAAI,QAAQ,EAAE,CAOzC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAMtE"}
@@ -0,0 +1,26 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { resolve, dirname } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import YAML from "yaml";
5
+ /**
6
+ * Load mcp-tools.yaml from the package root and return active tools.
7
+ */
8
+ export function loadManifest() {
9
+ const __dirname = dirname(fileURLToPath(import.meta.url));
10
+ // In dist/ the yaml is one level up
11
+ const yamlPath = resolve(__dirname, "..", "mcp-tools.yaml");
12
+ const raw = readFileSync(yamlPath, "utf-8");
13
+ const manifest = YAML.parse(raw);
14
+ return manifest.tools.filter((t) => t.status === "active");
15
+ }
16
+ /**
17
+ * Index manifest tools by name for quick lookup.
18
+ */
19
+ export function indexManifest(tools) {
20
+ const map = new Map();
21
+ for (const t of tools) {
22
+ map.set(t.name, t);
23
+ }
24
+ return map;
25
+ }
26
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAqBxB;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,oCAAoC;IACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAC5D,MAAM,GAAG,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAiB,CAAC;IACjD,OAAO,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAiB;IAC7C,MAAM,GAAG,GAAG,IAAI,GAAG,EAAoB,CAAC;IACxC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}