pcbway-mcp-server 0.1.23 → 0.1.25

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 (68) hide show
  1. package/README.md +41 -25
  2. package/dist/client.d.ts +1 -1
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +15 -15
  5. package/dist/client.js.map +1 -1
  6. package/dist/config.d.ts +1 -1
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/config.js +6 -7
  9. package/dist/config.js.map +1 -1
  10. package/dist/index.js +276 -209
  11. package/dist/index.js.map +1 -1
  12. package/dist/resources/Account.d.ts +2 -2
  13. package/dist/resources/Account.d.ts.map +1 -1
  14. package/dist/resources/Account.js +4 -4
  15. package/dist/resources/Account.js.map +1 -1
  16. package/dist/resources/CancelOrder.d.ts +2 -2
  17. package/dist/resources/CancelOrder.js +5 -5
  18. package/dist/resources/CancelTGroupOrder.d.ts +2 -2
  19. package/dist/resources/CancelTGroupOrder.js +6 -6
  20. package/dist/resources/CheckGroupOrder.d.ts +2 -2
  21. package/dist/resources/CheckGroupOrder.d.ts.map +1 -1
  22. package/dist/resources/CheckGroupOrder.js +4 -4
  23. package/dist/resources/CheckGroupOrder.js.map +1 -1
  24. package/dist/resources/CheckTGroupOrder.d.ts +2 -2
  25. package/dist/resources/CheckTGroupOrder.d.ts.map +1 -1
  26. package/dist/resources/CheckTGroupOrder.js +4 -4
  27. package/dist/resources/CheckTGroupOrder.js.map +1 -1
  28. package/dist/resources/ConfirmOrder.d.ts +2 -2
  29. package/dist/resources/ConfirmOrder.d.ts.map +1 -1
  30. package/dist/resources/ConfirmOrder.js +30 -20
  31. package/dist/resources/ConfirmOrder.js.map +1 -1
  32. package/dist/resources/GetCities.d.ts +2 -2
  33. package/dist/resources/GetCities.d.ts.map +1 -1
  34. package/dist/resources/GetCities.js +6 -8
  35. package/dist/resources/GetCities.js.map +1 -1
  36. package/dist/resources/GetCountries.d.ts +2 -2
  37. package/dist/resources/GetCountries.d.ts.map +1 -1
  38. package/dist/resources/GetCountries.js +4 -4
  39. package/dist/resources/GetCountries.js.map +1 -1
  40. package/dist/resources/GetStates.d.ts +2 -2
  41. package/dist/resources/GetStates.d.ts.map +1 -1
  42. package/dist/resources/GetStates.js +4 -6
  43. package/dist/resources/GetStates.js.map +1 -1
  44. package/dist/resources/OrderDetails.d.ts +2 -2
  45. package/dist/resources/OrderDetails.js +15 -15
  46. package/dist/resources/OrderProcess.d.ts +2 -2
  47. package/dist/resources/OrderProcess.js +6 -6
  48. package/dist/resources/PayTGroupOrder.d.ts +2 -2
  49. package/dist/resources/PayTGroupOrder.js +7 -7
  50. package/dist/resources/PayTGroupOrder.js.map +1 -1
  51. package/dist/resources/PcbQuote.d.ts +2 -2
  52. package/dist/resources/PcbQuote.d.ts.map +1 -1
  53. package/dist/resources/PcbQuote.js +59 -41
  54. package/dist/resources/PcbQuote.js.map +1 -1
  55. package/dist/resources/PlaceOrder.d.ts +2 -2
  56. package/dist/resources/PlaceOrder.d.ts.map +1 -1
  57. package/dist/resources/PlaceOrder.js +38 -35
  58. package/dist/resources/PlaceOrder.js.map +1 -1
  59. package/dist/resources/Shipping.d.ts +2 -2
  60. package/dist/resources/Shipping.js +12 -12
  61. package/dist/resources/Shipping.js.map +1 -1
  62. package/dist/resources/SmtQuote.d.ts +2 -2
  63. package/dist/resources/SmtQuote.d.ts.map +1 -1
  64. package/dist/resources/SmtQuote.js +21 -22
  65. package/dist/resources/SmtQuote.js.map +1 -1
  66. package/dist/resources/common.js +16 -16
  67. package/dist/types.d.ts +16 -16
  68. package/package.json +19 -7
package/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync } from 'node:fs';
3
- import { Server } from '@modelcontextprotocol/sdk/server/index.js';
4
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
5
- import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
6
- import { loadConfig } from './config.js';
7
- import { PcbWayClient } from './client.js';
8
- import { PcbQuote } from './resources/PcbQuote.js';
9
- import { SmtQuote } from './resources/SmtQuote.js';
10
- import { OrderProcess } from './resources/OrderProcess.js';
11
- import { OrderDetails } from './resources/OrderDetails.js';
12
- import { Shipping } from './resources/Shipping.js';
13
- import { Account } from './resources/Account.js';
14
- import { PlaceOrder } from './resources/PlaceOrder.js';
15
- import { ConfirmOrder } from './resources/ConfirmOrder.js';
16
- import { CancelOrder } from './resources/CancelOrder.js';
17
- import { CheckTGroupOrder } from './resources/CheckTGroupOrder.js';
18
- import { PayTGroupOrder } from './resources/PayTGroupOrder.js';
19
- import { CancelTGroupOrder } from './resources/CancelTGroupOrder.js';
20
- import { CheckGroupOrder } from './resources/CheckGroupOrder.js';
21
- import { GetCountries } from './resources/GetCountries.js';
22
- import { GetStates } from './resources/GetStates.js';
23
- import { GetCities } from './resources/GetCities.js';
2
+ import { readFileSync } from "node:fs";
3
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
6
+ import { PcbWayClient } from "./client.js";
7
+ import { loadConfig } from "./config.js";
8
+ import { Account } from "./resources/Account.js";
9
+ import { CancelOrder } from "./resources/CancelOrder.js";
10
+ import { CancelTGroupOrder } from "./resources/CancelTGroupOrder.js";
11
+ import { CheckGroupOrder } from "./resources/CheckGroupOrder.js";
12
+ import { CheckTGroupOrder } from "./resources/CheckTGroupOrder.js";
13
+ import { ConfirmOrder } from "./resources/ConfirmOrder.js";
14
+ import { GetCities } from "./resources/GetCities.js";
15
+ import { GetCountries } from "./resources/GetCountries.js";
16
+ import { GetStates } from "./resources/GetStates.js";
17
+ import { OrderDetails } from "./resources/OrderDetails.js";
18
+ import { OrderProcess } from "./resources/OrderProcess.js";
19
+ import { PayTGroupOrder } from "./resources/PayTGroupOrder.js";
20
+ import { PcbQuote } from "./resources/PcbQuote.js";
21
+ import { PlaceOrder } from "./resources/PlaceOrder.js";
22
+ import { Shipping } from "./resources/Shipping.js";
23
+ import { SmtQuote } from "./resources/SmtQuote.js";
24
24
  // ── Help flag ──────────────────────────────────────────────────────
25
25
  function printHelp() {
26
26
  const help = `
@@ -109,7 +109,6 @@ SETUP
109
109
  }
110
110
  }
111
111
  `;
112
- // eslint-disable-next-line no-console
113
112
  console.log(help);
114
113
  }
115
114
  // ── Tool definitions ───────────────────────────────────────────────
@@ -117,261 +116,329 @@ SETUP
117
116
  // version actually published with the package instead of a stale constant.
118
117
  const VERSION = (() => {
119
118
  try {
120
- const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
121
- return pkg.version ?? '0.0.0';
119
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
120
+ return pkg.version ?? "0.0.0";
122
121
  }
123
122
  catch {
124
- return '0.0.0';
123
+ return "0.0.0";
125
124
  }
126
125
  })();
127
126
  const tools = [
128
127
  {
129
- name: 'pcb_quote',
130
- description: 'Get a PCB manufacturing price quote from PCBWay',
128
+ name: "pcb_quote",
129
+ description: "Get a PCB manufacturing price quote from PCBWay",
131
130
  inputSchema: {
132
- type: 'object',
131
+ type: "object",
133
132
  properties: {
134
- Country: { type: 'string', description: 'Country name (e.g. "UNITED STATES OF AMERICA")' },
135
- CountryCode: { type: 'string', description: 'Country code (e.g. "US")' },
136
- ShipType: { type: 'number', description: 'Logistics company (1=DHL, 10=FedEx IP, 4=SF Express, etc.)' },
137
- Postalcode: { type: 'string', description: 'Postal code' },
138
- City: { type: 'string', description: 'City' },
139
- Length: { type: 'number', description: 'Board length in mm' },
140
- Width: { type: 'number', description: 'Board width in mm' },
141
- Qty: { type: 'number', description: 'Quantity (5-10000)' },
142
- Layers: { type: 'number', description: 'Number of layers (1,2,4,6,8,10,12,14)' },
143
- BoardType: { type: 'string', description: 'Board type: "Single PCB" (default), "Panel PCB as design", "Panel PCB by Supplier"' },
144
- Material: { type: 'string', description: 'PCB material: FR-4 (default), Aluminum, Rogers, HDI, Copper' },
145
- FR4Tg: { type: 'string', description: 'FR4 Tg grade (default: TG150)' },
146
- Thickness: { type: 'number', description: 'Board thickness in mm (default: 1.6)' },
147
- MinTrackSpacing: { type: 'string', description: 'Min track/space (default: "6/6mil")' },
148
- MinHoleSize: { type: 'number', description: 'Min hole size in mm (default: 0.3)' },
149
- SolderMask: { type: 'string', description: 'Solder mask color (default: "Green")' },
150
- Silkscreen: { type: 'string', description: 'Silkscreen color (default: "White")' },
151
- SurfaceFinish: { type: 'string', description: 'Surface finish (default: "HASL with lead")' },
152
- ViaProcess: { type: 'string', description: 'Via process (default: "Tenting vias")' },
153
- FinishedCopper: { type: 'string', description: 'Copper weight (default: "1 oz Cu")' },
154
- Note: { type: 'string', description: 'Other special requests' },
133
+ Country: { type: "string", description: 'Country name (e.g. "UNITED STATES OF AMERICA")' },
134
+ CountryCode: { type: "string", description: 'Country code (e.g. "US")' },
135
+ ShipType: {
136
+ type: "number",
137
+ description: "Logistics company (1=DHL, 10=FedEx IP, 4=SF Express, etc.)",
138
+ },
139
+ Postalcode: { type: "string", description: "Postal code" },
140
+ City: { type: "string", description: "City" },
141
+ Length: { type: "number", description: "Board length in mm" },
142
+ Width: { type: "number", description: "Board width in mm" },
143
+ Qty: { type: "number", description: "Quantity (5-10000)" },
144
+ Layers: { type: "number", description: "Number of layers (1,2,4,6,8,10,12,14)" },
145
+ BoardType: {
146
+ type: "string",
147
+ description: 'Board type: "Single PCB" (default), "Panel PCB as design", "Panel PCB by Supplier"',
148
+ },
149
+ Material: {
150
+ type: "string",
151
+ description: "PCB material: FR-4 (default), Aluminum, Rogers, HDI, Copper",
152
+ },
153
+ FR4Tg: { type: "string", description: "FR4 Tg grade (default: TG150)" },
154
+ Thickness: { type: "number", description: "Board thickness in mm (default: 1.6)" },
155
+ MinTrackSpacing: { type: "string", description: 'Min track/space (default: "6/6mil")' },
156
+ MinHoleSize: { type: "number", description: "Min hole size in mm (default: 0.3)" },
157
+ SolderMask: { type: "string", description: 'Solder mask color (default: "Green")' },
158
+ Silkscreen: { type: "string", description: 'Silkscreen color (default: "White")' },
159
+ SurfaceFinish: {
160
+ type: "string",
161
+ description: 'Surface finish (default: "HASL with lead")',
162
+ },
163
+ ViaProcess: { type: "string", description: 'Via process (default: "Tenting vias")' },
164
+ FinishedCopper: { type: "string", description: 'Copper weight (default: "1 oz Cu")' },
165
+ Note: { type: "string", description: "Other special requests" },
155
166
  },
156
- required: ['Country', 'CountryCode', 'ShipType', 'Postalcode', 'City', 'Length', 'Width', 'Qty', 'Layers'],
167
+ required: [
168
+ "Country",
169
+ "CountryCode",
170
+ "ShipType",
171
+ "Postalcode",
172
+ "City",
173
+ "Length",
174
+ "Width",
175
+ "Qty",
176
+ "Layers",
177
+ ],
157
178
  },
158
179
  },
159
180
  {
160
- name: 'smt_quote',
161
- description: 'Get an SMT assembly price quote from PCBWay',
181
+ name: "smt_quote",
182
+ description: "Get an SMT assembly price quote from PCBWay",
162
183
  inputSchema: {
163
- type: 'object',
184
+ type: "object",
164
185
  properties: {
165
- Country: { type: 'string', description: 'Country name' },
166
- CountryCode: { type: 'string', description: 'Country code (e.g. "US")' },
167
- ShipType: { type: 'number', description: 'Logistics company (1=DHL, 10=FedEx IP, etc.)' },
168
- Postalcode: { type: 'string', description: 'Postal code' },
169
- City: { type: 'string', description: 'City' },
170
- FlexibleOption: { type: 'string', enum: ['Turnkey', 'Kitted or Consigned', 'Combo'], description: 'Assembly flexible option' },
171
- BoardType: { type: 'string', enum: ['Single pieces', 'Panelized PCBs'], description: 'Board type' },
172
- AssemblySide: { type: 'string', enum: ['Top side', 'Bottom side', 'Both sides'], description: 'Assembly side' },
173
- Qty: { type: 'number', description: 'Quantity to assemble' },
174
- UniqueParts: { type: 'number', description: 'Number of unique parts (default: 0)' },
175
- SMTParts: { type: 'number', description: 'Number of SMT parts (default: 0)' },
176
- HoleParts: { type: 'number', description: 'Number of through-hole parts (default: 0)' },
186
+ Country: { type: "string", description: "Country name" },
187
+ CountryCode: { type: "string", description: 'Country code (e.g. "US")' },
188
+ ShipType: { type: "number", description: "Logistics company (1=DHL, 10=FedEx IP, etc.)" },
189
+ Postalcode: { type: "string", description: "Postal code" },
190
+ City: { type: "string", description: "City" },
191
+ FlexibleOption: {
192
+ type: "string",
193
+ enum: ["Turnkey", "Kitted or Consigned", "Combo"],
194
+ description: "Assembly flexible option",
195
+ },
196
+ BoardType: {
197
+ type: "string",
198
+ enum: ["Single pieces", "Panelized PCBs"],
199
+ description: "Board type",
200
+ },
201
+ AssemblySide: {
202
+ type: "string",
203
+ enum: ["Top side", "Bottom side", "Both sides"],
204
+ description: "Assembly side",
205
+ },
206
+ Qty: { type: "number", description: "Quantity to assemble" },
207
+ UniqueParts: { type: "number", description: "Number of unique parts (default: 0)" },
208
+ SMTParts: { type: "number", description: "Number of SMT parts (default: 0)" },
209
+ HoleParts: { type: "number", description: "Number of through-hole parts (default: 0)" },
177
210
  },
178
- required: ['Country', 'CountryCode', 'ShipType', 'Postalcode', 'City', 'FlexibleOption', 'BoardType', 'AssemblySide', 'Qty'],
211
+ required: [
212
+ "Country",
213
+ "CountryCode",
214
+ "ShipType",
215
+ "Postalcode",
216
+ "City",
217
+ "FlexibleOption",
218
+ "BoardType",
219
+ "AssemblySide",
220
+ "Qty",
221
+ ],
179
222
  },
180
223
  },
181
224
  {
182
- name: 'order_process',
183
- description: 'Get fabrication status and completed process steps for a PCBWay order',
225
+ name: "order_process",
226
+ description: "Get fabrication status and completed process steps for a PCBWay order",
184
227
  inputSchema: {
185
- type: 'object',
228
+ type: "object",
186
229
  properties: {
187
- OrderNo: { type: 'string', description: 'PCBWay order number (e.g. "W0002AS1")' },
230
+ OrderNo: { type: "string", description: 'PCBWay order number (e.g. "W0002AS1")' },
188
231
  },
189
- required: ['OrderNo'],
232
+ required: ["OrderNo"],
190
233
  },
191
234
  },
192
235
  {
193
- name: 'order_details',
194
- description: 'Get full order details including all PCB parameters',
236
+ name: "order_details",
237
+ description: "Get full order details including all PCB parameters",
195
238
  inputSchema: {
196
- type: 'object',
239
+ type: "object",
197
240
  properties: {
198
- OrderNo: { type: 'string', description: 'PCBWay order number (e.g. "W0002AS1")' },
241
+ OrderNo: { type: "string", description: 'PCBWay order number (e.g. "W0002AS1")' },
199
242
  },
200
- required: ['OrderNo'],
243
+ required: ["OrderNo"],
201
244
  },
202
245
  },
203
246
  {
204
- name: 'shipping_freight',
205
- description: 'Get shipping cost quote for an order (call before payment)',
247
+ name: "shipping_freight",
248
+ description: "Get shipping cost quote for an order (call before payment)",
206
249
  inputSchema: {
207
- type: 'object',
250
+ type: "object",
208
251
  properties: {
209
- OrderNo: { type: 'string', description: 'PCBWay order number (or comma-separated for multiple)' },
210
- ShipType: { type: 'number', description: 'Logistics company (1=DHL, 10=FedEx IP, etc.)' },
211
- Country: { type: 'string', description: 'Country name' },
212
- CountryCode: { type: 'string', description: 'Country code (e.g. "US")' },
213
- Postalcode: { type: 'string', description: 'Postal code' },
214
- City: { type: 'string', description: 'City' },
215
- State: { type: 'string', description: 'State/Province/Region (optional)' },
216
- AddGroupNo: { type: 'string', description: 'Order package number when adding to package (optional)' },
252
+ OrderNo: {
253
+ type: "string",
254
+ description: "PCBWay order number (or comma-separated for multiple)",
255
+ },
256
+ ShipType: { type: "number", description: "Logistics company (1=DHL, 10=FedEx IP, etc.)" },
257
+ Country: { type: "string", description: "Country name" },
258
+ CountryCode: { type: "string", description: 'Country code (e.g. "US")' },
259
+ Postalcode: { type: "string", description: "Postal code" },
260
+ City: { type: "string", description: "City" },
261
+ State: { type: "string", description: "State/Province/Region (optional)" },
262
+ AddGroupNo: {
263
+ type: "string",
264
+ description: "Order package number when adding to package (optional)",
265
+ },
217
266
  },
218
- required: ['OrderNo', 'ShipType', 'Country', 'CountryCode', 'Postalcode', 'City'],
267
+ required: ["OrderNo", "ShipType", "Country", "CountryCode", "Postalcode", "City"],
219
268
  },
220
269
  },
221
270
  {
222
- name: 'account_balance',
223
- description: 'Query PCBWay account balance, coupon value, and reward points',
271
+ name: "account_balance",
272
+ description: "Query PCBWay account balance, coupon value, and reward points",
224
273
  inputSchema: {
225
- type: 'object',
274
+ type: "object",
226
275
  properties: {},
227
276
  required: [],
228
277
  },
229
278
  },
230
279
  {
231
- name: 'place_order',
232
- description: 'Add a PCB order to cart',
280
+ name: "place_order",
281
+ description: "Add a PCB order to cart",
233
282
  inputSchema: {
234
- type: 'object',
283
+ type: "object",
235
284
  properties: {
236
- PcbFileName: { type: 'string', description: 'PCB file name' },
237
- BuildDays: { type: 'number', description: 'Production cycle in days (from quote)' },
238
- Length: { type: 'number', description: 'Board length in mm' },
239
- Width: { type: 'number', description: 'Board width in mm' },
240
- Qty: { type: 'number', description: 'Quantity' },
241
- Layers: { type: 'number', description: 'Number of layers' },
242
- BoardType: { type: 'string', description: 'Board type (default: "Single PCB")' },
243
- Material: { type: 'string', description: 'PCB material (default: "FR-4")' },
244
- Thickness: { type: 'number', description: 'Board thickness in mm (default: 1.6)' },
245
- SolderMask: { type: 'string', description: 'Solder mask color (default: "Green")' },
246
- Silkscreen: { type: 'string', description: 'Silkscreen color (default: "White")' },
247
- SurfaceFinish: { type: 'string', description: 'Surface finish (default: "HASL with lead")' },
248
- PcbFileUrl: { type: 'string', description: 'URL to PCB file (optional)' },
249
- Note: { type: 'string', description: 'Order notes (optional)' },
250
- BuyerEmail: { type: 'string', description: 'Buyer email for contact (optional)' },
285
+ PcbFileName: { type: "string", description: "PCB file name" },
286
+ BuildDays: { type: "number", description: "Production cycle in days (from quote)" },
287
+ Length: { type: "number", description: "Board length in mm" },
288
+ Width: { type: "number", description: "Board width in mm" },
289
+ Qty: { type: "number", description: "Quantity" },
290
+ Layers: { type: "number", description: "Number of layers" },
291
+ BoardType: { type: "string", description: 'Board type (default: "Single PCB")' },
292
+ Material: { type: "string", description: 'PCB material (default: "FR-4")' },
293
+ Thickness: { type: "number", description: "Board thickness in mm (default: 1.6)" },
294
+ SolderMask: { type: "string", description: 'Solder mask color (default: "Green")' },
295
+ Silkscreen: { type: "string", description: 'Silkscreen color (default: "White")' },
296
+ SurfaceFinish: {
297
+ type: "string",
298
+ description: 'Surface finish (default: "HASL with lead")',
299
+ },
300
+ PcbFileUrl: { type: "string", description: "URL to PCB file (optional)" },
301
+ Note: { type: "string", description: "Order notes (optional)" },
302
+ BuyerEmail: { type: "string", description: "Buyer email for contact (optional)" },
251
303
  },
252
- required: ['PcbFileName', 'BuildDays', 'Length', 'Width', 'Qty', 'Layers'],
304
+ required: ["PcbFileName", "BuildDays", "Length", "Width", "Qty", "Layers"],
253
305
  },
254
306
  },
255
307
  {
256
- name: 'confirm_order',
257
- description: 'Confirm orders and make payment on PCBWay',
308
+ name: "confirm_order",
309
+ description: "Confirm orders and make payment on PCBWay",
258
310
  inputSchema: {
259
- type: 'object',
311
+ type: "object",
260
312
  properties: {
261
- OrderNo: { type: 'string', description: 'Order number(s) — comma-separated for multiple' },
262
- PayType: { type: 'number', description: 'Payment method (1=AccountPay, 2=PCBWayWebPay)' },
263
- AddGroupNo: { type: 'string', description: 'Order package number when adding to package (optional)' },
264
- ShipType: { type: 'number', description: 'Logistics company (required unless adding to package)' },
265
- Country: { type: 'string', description: 'Country name (required unless adding to package)' },
266
- CountryCode: { type: 'string', description: 'Country code (required unless adding to package)' },
267
- State: { type: 'string', description: 'State/Province (optional)' },
268
- Postalcode: { type: 'string', description: 'Postal code (optional)' },
269
- City: { type: 'string', description: 'City (required unless adding to package)' },
270
- Addr: { type: 'string', description: 'Delivery address (required unless adding to package)' },
271
- CompanyName: { type: 'string', description: 'Company name (optional)' },
272
- ContactName: { type: 'string', description: 'Contact person (optional)' },
273
- Tel: { type: 'string', description: 'Phone number (required unless adding to package)' },
274
- BuyerEmail: { type: 'string', description: 'Buyer email for contact (optional)' },
275
- Tax: { type: 'string', description: 'Tax ID (optional)' },
313
+ OrderNo: { type: "string", description: "Order number(s) — comma-separated for multiple" },
314
+ PayType: { type: "number", description: "Payment method (1=AccountPay, 2=PCBWayWebPay)" },
315
+ AddGroupNo: {
316
+ type: "string",
317
+ description: "Order package number when adding to package (optional)",
318
+ },
319
+ ShipType: {
320
+ type: "number",
321
+ description: "Logistics company (required unless adding to package)",
322
+ },
323
+ Country: {
324
+ type: "string",
325
+ description: "Country name (required unless adding to package)",
326
+ },
327
+ CountryCode: {
328
+ type: "string",
329
+ description: "Country code (required unless adding to package)",
330
+ },
331
+ State: { type: "string", description: "State/Province (optional)" },
332
+ Postalcode: { type: "string", description: "Postal code (optional)" },
333
+ City: { type: "string", description: "City (required unless adding to package)" },
334
+ Addr: {
335
+ type: "string",
336
+ description: "Delivery address (required unless adding to package)",
337
+ },
338
+ CompanyName: { type: "string", description: "Company name (optional)" },
339
+ ContactName: { type: "string", description: "Contact person (optional)" },
340
+ Tel: { type: "string", description: "Phone number (required unless adding to package)" },
341
+ BuyerEmail: { type: "string", description: "Buyer email for contact (optional)" },
342
+ Tax: { type: "string", description: "Tax ID (optional)" },
276
343
  },
277
- required: ['OrderNo', 'PayType'],
344
+ required: ["OrderNo", "PayType"],
278
345
  },
279
346
  },
280
347
  {
281
- name: 'cancel_order',
282
- description: 'Cancel an existing PCBWay order',
348
+ name: "cancel_order",
349
+ description: "Cancel an existing PCBWay order",
283
350
  inputSchema: {
284
- type: 'object',
351
+ type: "object",
285
352
  properties: {
286
- OrderNo: { type: 'string', description: 'PCBWay order number to cancel' },
353
+ OrderNo: { type: "string", description: "PCBWay order number to cancel" },
287
354
  },
288
- required: ['OrderNo'],
355
+ required: ["OrderNo"],
289
356
  },
290
357
  },
291
358
  {
292
- name: 'check_tgroup_order',
293
- description: 'Check awaiting-payment order package details on PCBWay',
359
+ name: "check_tgroup_order",
360
+ description: "Check awaiting-payment order package details on PCBWay",
294
361
  inputSchema: {
295
- type: 'object',
362
+ type: "object",
296
363
  properties: {
297
- TGroupNo: { type: 'string', description: 'Awaiting-payment order package number' },
364
+ TGroupNo: { type: "string", description: "Awaiting-payment order package number" },
298
365
  },
299
- required: ['TGroupNo'],
366
+ required: ["TGroupNo"],
300
367
  },
301
368
  },
302
369
  {
303
- name: 'pay_tgroup_order',
304
- description: 'Pay for an awaiting-payment order package on PCBWay',
370
+ name: "pay_tgroup_order",
371
+ description: "Pay for an awaiting-payment order package on PCBWay",
305
372
  inputSchema: {
306
- type: 'object',
373
+ type: "object",
307
374
  properties: {
308
- TGroupNo: { type: 'string', description: 'Awaiting-payment order package number' },
309
- PayType: { type: 'number', description: 'Payment method (1=AccountPay, 2=PCBWayWebPay)' },
375
+ TGroupNo: { type: "string", description: "Awaiting-payment order package number" },
376
+ PayType: { type: "number", description: "Payment method (1=AccountPay, 2=PCBWayWebPay)" },
310
377
  },
311
- required: ['TGroupNo', 'PayType'],
378
+ required: ["TGroupNo", "PayType"],
312
379
  },
313
380
  },
314
381
  {
315
- name: 'cancel_tgroup_order',
316
- description: 'Cancel an awaiting-payment order package on PCBWay',
382
+ name: "cancel_tgroup_order",
383
+ description: "Cancel an awaiting-payment order package on PCBWay",
317
384
  inputSchema: {
318
- type: 'object',
385
+ type: "object",
319
386
  properties: {
320
- TGroupNo: { type: 'string', description: 'Awaiting-payment order package number' },
387
+ TGroupNo: { type: "string", description: "Awaiting-payment order package number" },
321
388
  },
322
- required: ['TGroupNo'],
389
+ required: ["TGroupNo"],
323
390
  },
324
391
  },
325
392
  {
326
- name: 'check_group_order',
327
- description: 'Check a confirmed order package details on PCBWay',
393
+ name: "check_group_order",
394
+ description: "Check a confirmed order package details on PCBWay",
328
395
  inputSchema: {
329
- type: 'object',
396
+ type: "object",
330
397
  properties: {
331
- GroupNo: { type: 'string', description: 'Order package number' },
398
+ GroupNo: { type: "string", description: "Order package number" },
332
399
  },
333
- required: ['GroupNo'],
400
+ required: ["GroupNo"],
334
401
  },
335
402
  },
336
403
  {
337
- name: 'get_countries',
338
- description: 'List all supported countries for PCBWay ordering',
404
+ name: "get_countries",
405
+ description: "List all supported countries for PCBWay ordering",
339
406
  inputSchema: {
340
- type: 'object',
407
+ type: "object",
341
408
  properties: {},
342
409
  required: [],
343
410
  },
344
411
  },
345
412
  {
346
- name: 'get_states',
347
- description: 'List states/provinces for a country',
413
+ name: "get_states",
414
+ description: "List states/provinces for a country",
348
415
  inputSchema: {
349
- type: 'object',
416
+ type: "object",
350
417
  properties: {
351
- Country: { type: 'string', description: 'Country name (e.g. "UNITED STATES OF AMERICA")' },
352
- CountryCode: { type: 'string', description: 'Country code (e.g. "US")' },
418
+ Country: { type: "string", description: 'Country name (e.g. "UNITED STATES OF AMERICA")' },
419
+ CountryCode: { type: "string", description: 'Country code (e.g. "US")' },
353
420
  },
354
- required: ['Country', 'CountryCode'],
421
+ required: ["Country", "CountryCode"],
355
422
  },
356
423
  },
357
424
  {
358
- name: 'get_cities',
359
- description: 'List cities for a country and state',
425
+ name: "get_cities",
426
+ description: "List cities for a country and state",
360
427
  inputSchema: {
361
- type: 'object',
428
+ type: "object",
362
429
  properties: {
363
- Country: { type: 'string', description: 'Country name (e.g. "UNITED STATES OF AMERICA")' },
364
- CountryCode: { type: 'string', description: 'Country code (e.g. "US")' },
365
- State: { type: 'string', description: 'State/Province to filter by (optional)' },
430
+ Country: { type: "string", description: 'Country name (e.g. "UNITED STATES OF AMERICA")' },
431
+ CountryCode: { type: "string", description: 'Country code (e.g. "US")' },
432
+ State: { type: "string", description: "State/Province to filter by (optional)" },
366
433
  },
367
- required: ['Country', 'CountryCode'],
434
+ required: ["Country", "CountryCode"],
368
435
  },
369
436
  },
370
437
  ];
371
438
  // ── Server bootstrap ───────────────────────────────────────────────
372
439
  async function main() {
373
440
  // Handle --help before anything else
374
- if (process.argv.includes('--help') || process.argv.includes('-h')) {
441
+ if (process.argv.includes("--help") || process.argv.includes("-h")) {
375
442
  printHelp();
376
443
  process.exit(0);
377
444
  }
@@ -402,7 +469,7 @@ async function main() {
402
469
  const getStates = new GetStates(client);
403
470
  const getCities = new GetCities(client);
404
471
  const server = new Server({
405
- name: 'pcbway-mcp-server',
472
+ name: "pcbway-mcp-server",
406
473
  version: VERSION,
407
474
  }, {
408
475
  capabilities: {
@@ -416,89 +483,89 @@ async function main() {
416
483
  const { name, arguments: args } = request.params;
417
484
  try {
418
485
  switch (name) {
419
- case 'pcb_quote': {
486
+ case "pcb_quote": {
420
487
  const parsed = PcbQuote.inputSchema.parse(args);
421
488
  const text = await pcbQuote.getQuote(parsed);
422
- return { content: [{ type: 'text', text }] };
489
+ return { content: [{ type: "text", text }] };
423
490
  }
424
- case 'smt_quote': {
491
+ case "smt_quote": {
425
492
  const parsed = SmtQuote.inputSchema.parse(args);
426
493
  const text = await smtQuote.getQuote(parsed);
427
- return { content: [{ type: 'text', text }] };
494
+ return { content: [{ type: "text", text }] };
428
495
  }
429
- case 'order_process': {
496
+ case "order_process": {
430
497
  const parsed = OrderProcess.inputSchema.parse(args);
431
498
  const text = await orderProcess.getStatus(parsed);
432
- return { content: [{ type: 'text', text }] };
499
+ return { content: [{ type: "text", text }] };
433
500
  }
434
- case 'order_details': {
501
+ case "order_details": {
435
502
  const parsed = OrderDetails.inputSchema.parse(args);
436
503
  const text = await orderDetails.getDetails(parsed);
437
- return { content: [{ type: 'text', text }] };
504
+ return { content: [{ type: "text", text }] };
438
505
  }
439
- case 'shipping_freight': {
506
+ case "shipping_freight": {
440
507
  const parsed = Shipping.inputSchema.parse(args);
441
508
  const text = await shipping.getFreight(parsed);
442
- return { content: [{ type: 'text', text }] };
509
+ return { content: [{ type: "text", text }] };
443
510
  }
444
- case 'account_balance': {
511
+ case "account_balance": {
445
512
  const parsed = Account.inputSchema.parse(args ?? {});
446
513
  const text = await account.getBalance(parsed);
447
- return { content: [{ type: 'text', text }] };
514
+ return { content: [{ type: "text", text }] };
448
515
  }
449
- case 'place_order': {
516
+ case "place_order": {
450
517
  const parsed = PlaceOrder.inputSchema.parse(args);
451
518
  const text = await placeOrder.place(parsed);
452
- return { content: [{ type: 'text', text }] };
519
+ return { content: [{ type: "text", text }] };
453
520
  }
454
- case 'confirm_order': {
521
+ case "confirm_order": {
455
522
  const parsed = ConfirmOrder.inputSchema.parse(args);
456
523
  const text = await confirmOrder.confirm(parsed);
457
- return { content: [{ type: 'text', text }] };
524
+ return { content: [{ type: "text", text }] };
458
525
  }
459
- case 'cancel_order': {
526
+ case "cancel_order": {
460
527
  const parsed = CancelOrder.inputSchema.parse(args);
461
528
  const text = await cancelOrder.cancel(parsed);
462
- return { content: [{ type: 'text', text }] };
529
+ return { content: [{ type: "text", text }] };
463
530
  }
464
- case 'check_tgroup_order': {
531
+ case "check_tgroup_order": {
465
532
  const parsed = CheckTGroupOrder.inputSchema.parse(args);
466
533
  const text = await checkTGroupOrder.check(parsed);
467
- return { content: [{ type: 'text', text }] };
534
+ return { content: [{ type: "text", text }] };
468
535
  }
469
- case 'pay_tgroup_order': {
536
+ case "pay_tgroup_order": {
470
537
  const parsed = PayTGroupOrder.inputSchema.parse(args);
471
538
  const text = await payTGroupOrder.pay(parsed);
472
- return { content: [{ type: 'text', text }] };
539
+ return { content: [{ type: "text", text }] };
473
540
  }
474
- case 'cancel_tgroup_order': {
541
+ case "cancel_tgroup_order": {
475
542
  const parsed = CancelTGroupOrder.inputSchema.parse(args);
476
543
  const text = await cancelTGroupOrder.cancel(parsed);
477
- return { content: [{ type: 'text', text }] };
544
+ return { content: [{ type: "text", text }] };
478
545
  }
479
- case 'check_group_order': {
546
+ case "check_group_order": {
480
547
  const parsed = CheckGroupOrder.inputSchema.parse(args);
481
548
  const text = await checkGroupOrder.check(parsed);
482
- return { content: [{ type: 'text', text }] };
549
+ return { content: [{ type: "text", text }] };
483
550
  }
484
- case 'get_countries': {
551
+ case "get_countries": {
485
552
  const parsed = GetCountries.inputSchema.parse(args ?? {});
486
553
  const text = await getCountries.get(parsed);
487
- return { content: [{ type: 'text', text }] };
554
+ return { content: [{ type: "text", text }] };
488
555
  }
489
- case 'get_states': {
556
+ case "get_states": {
490
557
  const parsed = GetStates.inputSchema.parse(args);
491
558
  const text = await getStates.get(parsed);
492
- return { content: [{ type: 'text', text }] };
559
+ return { content: [{ type: "text", text }] };
493
560
  }
494
- case 'get_cities': {
561
+ case "get_cities": {
495
562
  const parsed = GetCities.inputSchema.parse(args);
496
563
  const text = await getCities.get(parsed);
497
- return { content: [{ type: 'text', text }] };
564
+ return { content: [{ type: "text", text }] };
498
565
  }
499
566
  default:
500
567
  return {
501
- content: [{ type: 'text', text: `Unknown tool: ${name}` }],
568
+ content: [{ type: "text", text: `Unknown tool: ${name}` }],
502
569
  isError: true,
503
570
  };
504
571
  }
@@ -506,7 +573,7 @@ async function main() {
506
573
  catch (err) {
507
574
  const message = err instanceof Error ? err.message : String(err);
508
575
  return {
509
- content: [{ type: 'text', text: `Error: ${message}` }],
576
+ content: [{ type: "text", text: `Error: ${message}` }],
510
577
  isError: true,
511
578
  };
512
579
  }
@@ -515,7 +582,7 @@ async function main() {
515
582
  await server.connect(transport);
516
583
  }
517
584
  main().catch((err) => {
518
- console.error('Fatal error:', err);
585
+ console.error("Fatal error:", err);
519
586
  process.exit(1);
520
587
  });
521
588
  //# sourceMappingURL=index.js.map