pcbway-mcp-server 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.
- package/LICENSE +21 -0
- package/README.md +322 -0
- package/dist/client.d.ts +35 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +135 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +23 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +24 -0
- package/dist/config.js.map +1 -0
- package/dist/enums.d.ts +20 -0
- package/dist/enums.d.ts.map +1 -0
- package/dist/enums.js +20 -0
- package/dist/enums.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +509 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/Account.d.ts +14 -0
- package/dist/resources/Account.d.ts.map +1 -0
- package/dist/resources/Account.js +22 -0
- package/dist/resources/Account.js.map +1 -0
- package/dist/resources/AssemblyQuote.d.ts +144 -0
- package/dist/resources/AssemblyQuote.d.ts.map +1 -0
- package/dist/resources/AssemblyQuote.js +102 -0
- package/dist/resources/AssemblyQuote.js.map +1 -0
- package/dist/resources/CancelOrder.d.ts +23 -0
- package/dist/resources/CancelOrder.d.ts.map +1 -0
- package/dist/resources/CancelOrder.js +21 -0
- package/dist/resources/CancelOrder.js.map +1 -0
- package/dist/resources/CancelTGroupOrder.d.ts +23 -0
- package/dist/resources/CancelTGroupOrder.d.ts.map +1 -0
- package/dist/resources/CancelTGroupOrder.js +21 -0
- package/dist/resources/CancelTGroupOrder.js.map +1 -0
- package/dist/resources/CheckGroupOrder.d.ts +23 -0
- package/dist/resources/CheckGroupOrder.d.ts.map +1 -0
- package/dist/resources/CheckGroupOrder.js +40 -0
- package/dist/resources/CheckGroupOrder.js.map +1 -0
- package/dist/resources/CheckTGroupOrder.d.ts +23 -0
- package/dist/resources/CheckTGroupOrder.d.ts.map +1 -0
- package/dist/resources/CheckTGroupOrder.js +43 -0
- package/dist/resources/CheckTGroupOrder.js.map +1 -0
- package/dist/resources/ConfirmOrder.d.ts +107 -0
- package/dist/resources/ConfirmOrder.d.ts.map +1 -0
- package/dist/resources/ConfirmOrder.js +67 -0
- package/dist/resources/ConfirmOrder.js.map +1 -0
- package/dist/resources/GetCities.d.ts +35 -0
- package/dist/resources/GetCities.d.ts.map +1 -0
- package/dist/resources/GetCities.js +33 -0
- package/dist/resources/GetCities.js.map +1 -0
- package/dist/resources/GetCountries.d.ts +14 -0
- package/dist/resources/GetCountries.d.ts.map +1 -0
- package/dist/resources/GetCountries.js +22 -0
- package/dist/resources/GetCountries.js.map +1 -0
- package/dist/resources/GetStates.d.ts +29 -0
- package/dist/resources/GetStates.d.ts.map +1 -0
- package/dist/resources/GetStates.js +31 -0
- package/dist/resources/GetStates.js.map +1 -0
- package/dist/resources/Order.d.ts +25 -0
- package/dist/resources/Order.d.ts.map +1 -0
- package/dist/resources/Order.js +59 -0
- package/dist/resources/Order.js.map +1 -0
- package/dist/resources/OrderDetails.d.ts +23 -0
- package/dist/resources/OrderDetails.d.ts.map +1 -0
- package/dist/resources/OrderDetails.js +47 -0
- package/dist/resources/OrderDetails.js.map +1 -0
- package/dist/resources/OrderProcess.d.ts +23 -0
- package/dist/resources/OrderProcess.d.ts.map +1 -0
- package/dist/resources/OrderProcess.js +36 -0
- package/dist/resources/OrderProcess.js.map +1 -0
- package/dist/resources/PayTGroupOrder.d.ts +29 -0
- package/dist/resources/PayTGroupOrder.d.ts.map +1 -0
- package/dist/resources/PayTGroupOrder.js +41 -0
- package/dist/resources/PayTGroupOrder.js.map +1 -0
- package/dist/resources/PcbQuote.d.ts +329 -0
- package/dist/resources/PcbQuote.d.ts.map +1 -0
- package/dist/resources/PcbQuote.js +111 -0
- package/dist/resources/PcbQuote.js.map +1 -0
- package/dist/resources/PlaceOrder.d.ts +173 -0
- package/dist/resources/PlaceOrder.d.ts.map +1 -0
- package/dist/resources/PlaceOrder.js +90 -0
- package/dist/resources/PlaceOrder.js.map +1 -0
- package/dist/resources/Shipping.d.ts +65 -0
- package/dist/resources/Shipping.d.ts.map +1 -0
- package/dist/resources/Shipping.js +47 -0
- package/dist/resources/Shipping.js.map +1 -0
- package/dist/resources/SmtQuote.d.ts +89 -0
- package/dist/resources/SmtQuote.d.ts.map +1 -0
- package/dist/resources/SmtQuote.js +56 -0
- package/dist/resources/SmtQuote.js.map +1 -0
- package/dist/resources/Status.d.ts +27 -0
- package/dist/resources/Status.d.ts.map +1 -0
- package/dist/resources/Status.js +47 -0
- package/dist/resources/Status.js.map +1 -0
- package/dist/resources/common.d.ts +10 -0
- package/dist/resources/common.d.ts.map +1 -0
- package/dist/resources/common.js +69 -0
- package/dist/resources/common.js.map +1 -0
- package/dist/types.d.ts +552 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +56 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { loadConfig } from './config.js';
|
|
6
|
+
import { PcbWayClient } from './client.js';
|
|
7
|
+
import { PcbQuote } from './resources/PcbQuote.js';
|
|
8
|
+
import { SmtQuote } from './resources/SmtQuote.js';
|
|
9
|
+
import { OrderProcess } from './resources/OrderProcess.js';
|
|
10
|
+
import { OrderDetails } from './resources/OrderDetails.js';
|
|
11
|
+
import { Shipping } from './resources/Shipping.js';
|
|
12
|
+
import { Account } from './resources/Account.js';
|
|
13
|
+
import { PlaceOrder } from './resources/PlaceOrder.js';
|
|
14
|
+
import { ConfirmOrder } from './resources/ConfirmOrder.js';
|
|
15
|
+
import { CancelOrder } from './resources/CancelOrder.js';
|
|
16
|
+
import { CheckTGroupOrder } from './resources/CheckTGroupOrder.js';
|
|
17
|
+
import { PayTGroupOrder } from './resources/PayTGroupOrder.js';
|
|
18
|
+
import { CancelTGroupOrder } from './resources/CancelTGroupOrder.js';
|
|
19
|
+
import { CheckGroupOrder } from './resources/CheckGroupOrder.js';
|
|
20
|
+
import { GetCountries } from './resources/GetCountries.js';
|
|
21
|
+
import { GetStates } from './resources/GetStates.js';
|
|
22
|
+
import { GetCities } from './resources/GetCities.js';
|
|
23
|
+
// ── Help flag ──────────────────────────────────────────────────────
|
|
24
|
+
function printHelp() {
|
|
25
|
+
const help = `
|
|
26
|
+
pcbway-mcp — MCP server for the PCBWay Partner API
|
|
27
|
+
|
|
28
|
+
USAGE
|
|
29
|
+
pcbway-mcp Start MCP server on stdin/stdout
|
|
30
|
+
pcbway-mcp --help Print this help
|
|
31
|
+
|
|
32
|
+
ENVIRONMENT
|
|
33
|
+
PCBWAY_API_KEY (required) Your PCBWay Partner API Key
|
|
34
|
+
PCBWAY_BASE_URL (optional) API base URL
|
|
35
|
+
(default: https://api-partner.pcbway.com)
|
|
36
|
+
PCBWAY_MAX_RETRIES (optional) Max retries for transient failures (default: 3)
|
|
37
|
+
PCBWAY_BASE_DELAY_MS (optional) Base exponential-backoff delay in ms (default: 500)
|
|
38
|
+
PCBWAY_TIMEOUT_MS (optional) Request timeout in ms (default: 30000)
|
|
39
|
+
|
|
40
|
+
TOOLS (exposed via MCP)
|
|
41
|
+
|
|
42
|
+
pcb_quote Get PCB manufacturing price quote
|
|
43
|
+
Required: Country, CountryCode, ShipType, Postalcode,
|
|
44
|
+
City, Length, Width, Qty, Layers
|
|
45
|
+
|
|
46
|
+
smt_quote Get SMT assembly price quote
|
|
47
|
+
Required: Country, CountryCode, ShipType, Postalcode,
|
|
48
|
+
City, FlexibleOption, BoardType, AssemblySide, Qty
|
|
49
|
+
|
|
50
|
+
order_process Get fabrication status / completed steps for an order
|
|
51
|
+
Required: OrderNo
|
|
52
|
+
|
|
53
|
+
order_details Get full order details including all PCB parameters
|
|
54
|
+
Required: OrderNo
|
|
55
|
+
|
|
56
|
+
shipping_freight Get shipping cost for an order (call before payment)
|
|
57
|
+
Required: OrderNo, ShipType, Country, CountryCode,
|
|
58
|
+
Postalcode, City
|
|
59
|
+
|
|
60
|
+
account_balance Query PCBWay account balance, coupon, and points
|
|
61
|
+
|
|
62
|
+
place_order Add PCB order to cart
|
|
63
|
+
Required: PcbFileName, BuildDays, and PCB params
|
|
64
|
+
|
|
65
|
+
confirm_order Confirm orders / make payment
|
|
66
|
+
Required: OrderNo, PayType (+ address when not adding to package)
|
|
67
|
+
|
|
68
|
+
cancel_order Cancel an existing order
|
|
69
|
+
Required: OrderNo
|
|
70
|
+
|
|
71
|
+
check_tgroup_order Check awaiting-payment order package details
|
|
72
|
+
Required: TGroupNo
|
|
73
|
+
|
|
74
|
+
pay_tgroup_order Pay for an awaiting-payment order package
|
|
75
|
+
Required: TGroupNo, PayType
|
|
76
|
+
|
|
77
|
+
cancel_tgroup_order Cancel an awaiting-payment order package
|
|
78
|
+
Required: TGroupNo
|
|
79
|
+
|
|
80
|
+
check_group_order Check a confirmed order package details
|
|
81
|
+
Required: GroupNo
|
|
82
|
+
|
|
83
|
+
get_countries List all supported countries
|
|
84
|
+
|
|
85
|
+
get_states List states/provinces for a country
|
|
86
|
+
Required: Country, CountryCode
|
|
87
|
+
|
|
88
|
+
get_cities List cities for a country/state
|
|
89
|
+
Required: Country, CountryCode
|
|
90
|
+
|
|
91
|
+
SETUP
|
|
92
|
+
1. Obtain your API Key from the PCBWay Partner dashboard
|
|
93
|
+
2. Export the credential:
|
|
94
|
+
export PCBWAY_API_KEY=your_api_key
|
|
95
|
+
3. Run:
|
|
96
|
+
npx pcbway-mcp-server
|
|
97
|
+
|
|
98
|
+
Add to your MCP client config:
|
|
99
|
+
{
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"pcbway": {
|
|
102
|
+
"command": "npx",
|
|
103
|
+
"args": ["-y", "pcbway-mcp-server"],
|
|
104
|
+
"env": {
|
|
105
|
+
"PCBWAY_API_KEY": "..."
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
// eslint-disable-next-line no-console
|
|
112
|
+
console.log(help);
|
|
113
|
+
}
|
|
114
|
+
// ── Tool definitions ───────────────────────────────────────────────
|
|
115
|
+
const tools = [
|
|
116
|
+
{
|
|
117
|
+
name: 'pcb_quote',
|
|
118
|
+
description: 'Get a PCB manufacturing price quote from PCBWay',
|
|
119
|
+
inputSchema: {
|
|
120
|
+
type: 'object',
|
|
121
|
+
properties: {
|
|
122
|
+
Country: { type: 'string', description: 'Country name (e.g. "UNITED STATES OF AMERICA")' },
|
|
123
|
+
CountryCode: { type: 'string', description: 'Country code (e.g. "US")' },
|
|
124
|
+
ShipType: { type: 'number', description: 'Logistics company (1=DHL, 10=FedEx IP, 4=SF Express, etc.)' },
|
|
125
|
+
Postalcode: { type: 'string', description: 'Postal code' },
|
|
126
|
+
City: { type: 'string', description: 'City' },
|
|
127
|
+
Length: { type: 'number', description: 'Board length in mm' },
|
|
128
|
+
Width: { type: 'number', description: 'Board width in mm' },
|
|
129
|
+
Qty: { type: 'number', description: 'Quantity (5-10000)' },
|
|
130
|
+
Layers: { type: 'number', description: 'Number of layers (1,2,4,6,8,10,12,14)' },
|
|
131
|
+
BoardType: { type: 'string', description: 'Board type: "Single PCB" (default), "Panel PCB as design", "Panel PCB by Supplier"' },
|
|
132
|
+
Material: { type: 'string', description: 'PCB material: FR-4 (default), Aluminum, Rogers, HDI, Copper' },
|
|
133
|
+
FR4Tg: { type: 'string', description: 'FR4 Tg grade (default: TG150)' },
|
|
134
|
+
Thickness: { type: 'number', description: 'Board thickness in mm (default: 1.6)' },
|
|
135
|
+
MinTrackSpacing: { type: 'string', description: 'Min track/space (default: "6/6mil")' },
|
|
136
|
+
MinHoleSize: { type: 'number', description: 'Min hole size in mm (default: 0.3)' },
|
|
137
|
+
SolderMask: { type: 'string', description: 'Solder mask color (default: "Green")' },
|
|
138
|
+
Silkscreen: { type: 'string', description: 'Silkscreen color (default: "White")' },
|
|
139
|
+
SurfaceFinish: { type: 'string', description: 'Surface finish (default: "HASL with lead")' },
|
|
140
|
+
ViaProcess: { type: 'string', description: 'Via process (default: "Tenting vias")' },
|
|
141
|
+
FinishedCopper: { type: 'string', description: 'Copper weight (default: "1 oz Cu")' },
|
|
142
|
+
Note: { type: 'string', description: 'Other special requests' },
|
|
143
|
+
},
|
|
144
|
+
required: ['Country', 'CountryCode', 'ShipType', 'Postalcode', 'City', 'Length', 'Width', 'Qty', 'Layers'],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'smt_quote',
|
|
149
|
+
description: 'Get an SMT assembly price quote from PCBWay',
|
|
150
|
+
inputSchema: {
|
|
151
|
+
type: 'object',
|
|
152
|
+
properties: {
|
|
153
|
+
Country: { type: 'string', description: 'Country name' },
|
|
154
|
+
CountryCode: { type: 'string', description: 'Country code (e.g. "US")' },
|
|
155
|
+
ShipType: { type: 'number', description: 'Logistics company (1=DHL, 10=FedEx IP, etc.)' },
|
|
156
|
+
Postalcode: { type: 'string', description: 'Postal code' },
|
|
157
|
+
City: { type: 'string', description: 'City' },
|
|
158
|
+
FlexibleOption: { type: 'string', enum: ['Turnkey', 'Kitted or Consigned', 'Combo'], description: 'Assembly flexible option' },
|
|
159
|
+
BoardType: { type: 'string', enum: ['Single pieces', 'Panelized PCBs'], description: 'Board type' },
|
|
160
|
+
AssemblySide: { type: 'string', enum: ['Top side', 'Bottom side', 'Both sides'], description: 'Assembly side' },
|
|
161
|
+
Qty: { type: 'number', description: 'Quantity to assemble' },
|
|
162
|
+
UniqueParts: { type: 'number', description: 'Number of unique parts (default: 0)' },
|
|
163
|
+
SMTParts: { type: 'number', description: 'Number of SMT parts (default: 0)' },
|
|
164
|
+
HoleParts: { type: 'number', description: 'Number of through-hole parts (default: 0)' },
|
|
165
|
+
},
|
|
166
|
+
required: ['Country', 'CountryCode', 'ShipType', 'Postalcode', 'City', 'FlexibleOption', 'BoardType', 'AssemblySide', 'Qty'],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'order_process',
|
|
171
|
+
description: 'Get fabrication status and completed process steps for a PCBWay order',
|
|
172
|
+
inputSchema: {
|
|
173
|
+
type: 'object',
|
|
174
|
+
properties: {
|
|
175
|
+
OrderNo: { type: 'string', description: 'PCBWay order number (e.g. "W0002AS1")' },
|
|
176
|
+
},
|
|
177
|
+
required: ['OrderNo'],
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'order_details',
|
|
182
|
+
description: 'Get full order details including all PCB parameters',
|
|
183
|
+
inputSchema: {
|
|
184
|
+
type: 'object',
|
|
185
|
+
properties: {
|
|
186
|
+
OrderNo: { type: 'string', description: 'PCBWay order number (e.g. "W0002AS1")' },
|
|
187
|
+
},
|
|
188
|
+
required: ['OrderNo'],
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'shipping_freight',
|
|
193
|
+
description: 'Get shipping cost quote for an order (call before payment)',
|
|
194
|
+
inputSchema: {
|
|
195
|
+
type: 'object',
|
|
196
|
+
properties: {
|
|
197
|
+
OrderNo: { type: 'string', description: 'PCBWay order number (or comma-separated for multiple)' },
|
|
198
|
+
ShipType: { type: 'number', description: 'Logistics company (1=DHL, 10=FedEx IP, etc.)' },
|
|
199
|
+
Country: { type: 'string', description: 'Country name' },
|
|
200
|
+
CountryCode: { type: 'string', description: 'Country code (e.g. "US")' },
|
|
201
|
+
Postalcode: { type: 'string', description: 'Postal code' },
|
|
202
|
+
City: { type: 'string', description: 'City' },
|
|
203
|
+
State: { type: 'string', description: 'State/Province/Region (optional)' },
|
|
204
|
+
AddGroupNo: { type: 'string', description: 'Order package number when adding to package (optional)' },
|
|
205
|
+
},
|
|
206
|
+
required: ['OrderNo', 'ShipType', 'Country', 'CountryCode', 'Postalcode', 'City'],
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: 'account_balance',
|
|
211
|
+
description: 'Query PCBWay account balance, coupon value, and reward points',
|
|
212
|
+
inputSchema: {
|
|
213
|
+
type: 'object',
|
|
214
|
+
properties: {},
|
|
215
|
+
required: [],
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'place_order',
|
|
220
|
+
description: 'Add a PCB order to cart',
|
|
221
|
+
inputSchema: {
|
|
222
|
+
type: 'object',
|
|
223
|
+
properties: {
|
|
224
|
+
PcbFileName: { type: 'string', description: 'PCB file name' },
|
|
225
|
+
BuildDays: { type: 'number', description: 'Production cycle in days (from quote)' },
|
|
226
|
+
Length: { type: 'number', description: 'Board length in mm' },
|
|
227
|
+
Width: { type: 'number', description: 'Board width in mm' },
|
|
228
|
+
Qty: { type: 'number', description: 'Quantity' },
|
|
229
|
+
Layers: { type: 'number', description: 'Number of layers' },
|
|
230
|
+
BoardType: { type: 'string', description: 'Board type (default: "Single PCB")' },
|
|
231
|
+
Material: { type: 'string', description: 'PCB material (default: "FR-4")' },
|
|
232
|
+
Thickness: { type: 'number', description: 'Board thickness in mm (default: 1.6)' },
|
|
233
|
+
SolderMask: { type: 'string', description: 'Solder mask color (default: "Green")' },
|
|
234
|
+
Silkscreen: { type: 'string', description: 'Silkscreen color (default: "White")' },
|
|
235
|
+
SurfaceFinish: { type: 'string', description: 'Surface finish (default: "HASL with lead")' },
|
|
236
|
+
PcbFileUrl: { type: 'string', description: 'URL to PCB file (optional)' },
|
|
237
|
+
Note: { type: 'string', description: 'Order notes (optional)' },
|
|
238
|
+
BuyerEmail: { type: 'string', description: 'Buyer email for contact (optional)' },
|
|
239
|
+
},
|
|
240
|
+
required: ['PcbFileName', 'BuildDays', 'Length', 'Width', 'Qty', 'Layers'],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'confirm_order',
|
|
245
|
+
description: 'Confirm orders and make payment on PCBWay',
|
|
246
|
+
inputSchema: {
|
|
247
|
+
type: 'object',
|
|
248
|
+
properties: {
|
|
249
|
+
OrderNo: { type: 'string', description: 'Order number(s) — comma-separated for multiple' },
|
|
250
|
+
PayType: { type: 'number', description: 'Payment method (1=AccountPay, 2=PCBWayWebPay)' },
|
|
251
|
+
AddGroupNo: { type: 'string', description: 'Order package number when adding to package (optional)' },
|
|
252
|
+
ShipType: { type: 'number', description: 'Logistics company (required unless adding to package)' },
|
|
253
|
+
Country: { type: 'string', description: 'Country name (required unless adding to package)' },
|
|
254
|
+
CountryCode: { type: 'string', description: 'Country code (required unless adding to package)' },
|
|
255
|
+
State: { type: 'string', description: 'State/Province (optional)' },
|
|
256
|
+
Postalcode: { type: 'string', description: 'Postal code (optional)' },
|
|
257
|
+
City: { type: 'string', description: 'City (required unless adding to package)' },
|
|
258
|
+
Addr: { type: 'string', description: 'Delivery address (required unless adding to package)' },
|
|
259
|
+
CompanyName: { type: 'string', description: 'Company name (optional)' },
|
|
260
|
+
ContactName: { type: 'string', description: 'Contact person (optional)' },
|
|
261
|
+
Tel: { type: 'string', description: 'Phone number (required unless adding to package)' },
|
|
262
|
+
BuyerEmail: { type: 'string', description: 'Buyer email for contact (optional)' },
|
|
263
|
+
Tax: { type: 'string', description: 'Tax ID (optional)' },
|
|
264
|
+
},
|
|
265
|
+
required: ['OrderNo', 'PayType'],
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'cancel_order',
|
|
270
|
+
description: 'Cancel an existing PCBWay order',
|
|
271
|
+
inputSchema: {
|
|
272
|
+
type: 'object',
|
|
273
|
+
properties: {
|
|
274
|
+
OrderNo: { type: 'string', description: 'PCBWay order number to cancel' },
|
|
275
|
+
},
|
|
276
|
+
required: ['OrderNo'],
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: 'check_tgroup_order',
|
|
281
|
+
description: 'Check awaiting-payment order package details on PCBWay',
|
|
282
|
+
inputSchema: {
|
|
283
|
+
type: 'object',
|
|
284
|
+
properties: {
|
|
285
|
+
TGroupNo: { type: 'string', description: 'Awaiting-payment order package number' },
|
|
286
|
+
},
|
|
287
|
+
required: ['TGroupNo'],
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: 'pay_tgroup_order',
|
|
292
|
+
description: 'Pay for an awaiting-payment order package on PCBWay',
|
|
293
|
+
inputSchema: {
|
|
294
|
+
type: 'object',
|
|
295
|
+
properties: {
|
|
296
|
+
TGroupNo: { type: 'string', description: 'Awaiting-payment order package number' },
|
|
297
|
+
PayType: { type: 'number', description: 'Payment method (1=AccountPay, 2=PCBWayWebPay)' },
|
|
298
|
+
},
|
|
299
|
+
required: ['TGroupNo', 'PayType'],
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: 'cancel_tgroup_order',
|
|
304
|
+
description: 'Cancel an awaiting-payment order package on PCBWay',
|
|
305
|
+
inputSchema: {
|
|
306
|
+
type: 'object',
|
|
307
|
+
properties: {
|
|
308
|
+
TGroupNo: { type: 'string', description: 'Awaiting-payment order package number' },
|
|
309
|
+
},
|
|
310
|
+
required: ['TGroupNo'],
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: 'check_group_order',
|
|
315
|
+
description: 'Check a confirmed order package details on PCBWay',
|
|
316
|
+
inputSchema: {
|
|
317
|
+
type: 'object',
|
|
318
|
+
properties: {
|
|
319
|
+
GroupNo: { type: 'string', description: 'Order package number' },
|
|
320
|
+
},
|
|
321
|
+
required: ['GroupNo'],
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: 'get_countries',
|
|
326
|
+
description: 'List all supported countries for PCBWay ordering',
|
|
327
|
+
inputSchema: {
|
|
328
|
+
type: 'object',
|
|
329
|
+
properties: {},
|
|
330
|
+
required: [],
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
name: 'get_states',
|
|
335
|
+
description: 'List states/provinces for a country',
|
|
336
|
+
inputSchema: {
|
|
337
|
+
type: 'object',
|
|
338
|
+
properties: {
|
|
339
|
+
Country: { type: 'string', description: 'Country name (e.g. "UNITED STATES OF AMERICA")' },
|
|
340
|
+
CountryCode: { type: 'string', description: 'Country code (e.g. "US")' },
|
|
341
|
+
},
|
|
342
|
+
required: ['Country', 'CountryCode'],
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: 'get_cities',
|
|
347
|
+
description: 'List cities for a country and state',
|
|
348
|
+
inputSchema: {
|
|
349
|
+
type: 'object',
|
|
350
|
+
properties: {
|
|
351
|
+
Country: { type: 'string', description: 'Country name (e.g. "UNITED STATES OF AMERICA")' },
|
|
352
|
+
CountryCode: { type: 'string', description: 'Country code (e.g. "US")' },
|
|
353
|
+
State: { type: 'string', description: 'State/Province to filter by (optional)' },
|
|
354
|
+
},
|
|
355
|
+
required: ['Country', 'CountryCode'],
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
];
|
|
359
|
+
// ── Server bootstrap ───────────────────────────────────────────────
|
|
360
|
+
async function main() {
|
|
361
|
+
// Handle --help before anything else
|
|
362
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
363
|
+
printHelp();
|
|
364
|
+
process.exit(0);
|
|
365
|
+
}
|
|
366
|
+
// Load config (will throw with clear message if env vars missing)
|
|
367
|
+
let config;
|
|
368
|
+
try {
|
|
369
|
+
config = loadConfig();
|
|
370
|
+
}
|
|
371
|
+
catch (err) {
|
|
372
|
+
console.error(`Configuration error: ${err.message}`);
|
|
373
|
+
process.exit(1);
|
|
374
|
+
}
|
|
375
|
+
const client = new PcbWayClient(config);
|
|
376
|
+
const pcbQuote = new PcbQuote(client);
|
|
377
|
+
const smtQuote = new SmtQuote(client);
|
|
378
|
+
const orderProcess = new OrderProcess(client);
|
|
379
|
+
const orderDetails = new OrderDetails(client);
|
|
380
|
+
const shipping = new Shipping(client);
|
|
381
|
+
const account = new Account(client);
|
|
382
|
+
const placeOrder = new PlaceOrder(client);
|
|
383
|
+
const confirmOrder = new ConfirmOrder(client);
|
|
384
|
+
const cancelOrder = new CancelOrder(client);
|
|
385
|
+
const checkTGroupOrder = new CheckTGroupOrder(client);
|
|
386
|
+
const payTGroupOrder = new PayTGroupOrder(client);
|
|
387
|
+
const cancelTGroupOrder = new CancelTGroupOrder(client);
|
|
388
|
+
const checkGroupOrder = new CheckGroupOrder(client);
|
|
389
|
+
const getCountries = new GetCountries(client);
|
|
390
|
+
const getStates = new GetStates(client);
|
|
391
|
+
const getCities = new GetCities(client);
|
|
392
|
+
const server = new Server({
|
|
393
|
+
name: 'pcbway-mcp-server',
|
|
394
|
+
version: '1.0.0',
|
|
395
|
+
}, {
|
|
396
|
+
capabilities: {
|
|
397
|
+
tools: {},
|
|
398
|
+
},
|
|
399
|
+
});
|
|
400
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
401
|
+
tools,
|
|
402
|
+
}));
|
|
403
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
404
|
+
const { name, arguments: args } = request.params;
|
|
405
|
+
try {
|
|
406
|
+
switch (name) {
|
|
407
|
+
case 'pcb_quote': {
|
|
408
|
+
const parsed = PcbQuote.inputSchema.parse(args);
|
|
409
|
+
const text = await pcbQuote.getQuote(parsed);
|
|
410
|
+
return { content: [{ type: 'text', text }] };
|
|
411
|
+
}
|
|
412
|
+
case 'smt_quote': {
|
|
413
|
+
const parsed = SmtQuote.inputSchema.parse(args);
|
|
414
|
+
const text = await smtQuote.getQuote(parsed);
|
|
415
|
+
return { content: [{ type: 'text', text }] };
|
|
416
|
+
}
|
|
417
|
+
case 'order_process': {
|
|
418
|
+
const parsed = OrderProcess.inputSchema.parse(args);
|
|
419
|
+
const text = await orderProcess.getStatus(parsed);
|
|
420
|
+
return { content: [{ type: 'text', text }] };
|
|
421
|
+
}
|
|
422
|
+
case 'order_details': {
|
|
423
|
+
const parsed = OrderDetails.inputSchema.parse(args);
|
|
424
|
+
const text = await orderDetails.getDetails(parsed);
|
|
425
|
+
return { content: [{ type: 'text', text }] };
|
|
426
|
+
}
|
|
427
|
+
case 'shipping_freight': {
|
|
428
|
+
const parsed = Shipping.inputSchema.parse(args);
|
|
429
|
+
const text = await shipping.getFreight(parsed);
|
|
430
|
+
return { content: [{ type: 'text', text }] };
|
|
431
|
+
}
|
|
432
|
+
case 'account_balance': {
|
|
433
|
+
const parsed = Account.inputSchema.parse(args ?? {});
|
|
434
|
+
const text = await account.getBalance(parsed);
|
|
435
|
+
return { content: [{ type: 'text', text }] };
|
|
436
|
+
}
|
|
437
|
+
case 'place_order': {
|
|
438
|
+
const parsed = PlaceOrder.inputSchema.parse(args);
|
|
439
|
+
const text = await placeOrder.place(parsed);
|
|
440
|
+
return { content: [{ type: 'text', text }] };
|
|
441
|
+
}
|
|
442
|
+
case 'confirm_order': {
|
|
443
|
+
const parsed = ConfirmOrder.inputSchema.parse(args);
|
|
444
|
+
const text = await confirmOrder.confirm(parsed);
|
|
445
|
+
return { content: [{ type: 'text', text }] };
|
|
446
|
+
}
|
|
447
|
+
case 'cancel_order': {
|
|
448
|
+
const parsed = CancelOrder.inputSchema.parse(args);
|
|
449
|
+
const text = await cancelOrder.cancel(parsed);
|
|
450
|
+
return { content: [{ type: 'text', text }] };
|
|
451
|
+
}
|
|
452
|
+
case 'check_tgroup_order': {
|
|
453
|
+
const parsed = CheckTGroupOrder.inputSchema.parse(args);
|
|
454
|
+
const text = await checkTGroupOrder.check(parsed);
|
|
455
|
+
return { content: [{ type: 'text', text }] };
|
|
456
|
+
}
|
|
457
|
+
case 'pay_tgroup_order': {
|
|
458
|
+
const parsed = PayTGroupOrder.inputSchema.parse(args);
|
|
459
|
+
const text = await payTGroupOrder.pay(parsed);
|
|
460
|
+
return { content: [{ type: 'text', text }] };
|
|
461
|
+
}
|
|
462
|
+
case 'cancel_tgroup_order': {
|
|
463
|
+
const parsed = CancelTGroupOrder.inputSchema.parse(args);
|
|
464
|
+
const text = await cancelTGroupOrder.cancel(parsed);
|
|
465
|
+
return { content: [{ type: 'text', text }] };
|
|
466
|
+
}
|
|
467
|
+
case 'check_group_order': {
|
|
468
|
+
const parsed = CheckGroupOrder.inputSchema.parse(args);
|
|
469
|
+
const text = await checkGroupOrder.check(parsed);
|
|
470
|
+
return { content: [{ type: 'text', text }] };
|
|
471
|
+
}
|
|
472
|
+
case 'get_countries': {
|
|
473
|
+
const parsed = GetCountries.inputSchema.parse(args ?? {});
|
|
474
|
+
const text = await getCountries.get(parsed);
|
|
475
|
+
return { content: [{ type: 'text', text }] };
|
|
476
|
+
}
|
|
477
|
+
case 'get_states': {
|
|
478
|
+
const parsed = GetStates.inputSchema.parse(args);
|
|
479
|
+
const text = await getStates.get(parsed);
|
|
480
|
+
return { content: [{ type: 'text', text }] };
|
|
481
|
+
}
|
|
482
|
+
case 'get_cities': {
|
|
483
|
+
const parsed = GetCities.inputSchema.parse(args);
|
|
484
|
+
const text = await getCities.get(parsed);
|
|
485
|
+
return { content: [{ type: 'text', text }] };
|
|
486
|
+
}
|
|
487
|
+
default:
|
|
488
|
+
return {
|
|
489
|
+
content: [{ type: 'text', text: `Unknown tool: ${name}` }],
|
|
490
|
+
isError: true,
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
catch (err) {
|
|
495
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
496
|
+
return {
|
|
497
|
+
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
498
|
+
isError: true,
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
const transport = new StdioServerTransport();
|
|
503
|
+
await server.connect(transport);
|
|
504
|
+
}
|
|
505
|
+
main().catch((err) => {
|
|
506
|
+
console.error('Fatal error:', err);
|
|
507
|
+
process.exit(1);
|
|
508
|
+
});
|
|
509
|
+
//# sour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AAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBACtD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,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,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PcbWayClient } from '../client.js';
|
|
3
|
+
/**
|
|
4
|
+
* QueryBalance takes no parameters — empty body.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AccountBalanceInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
7
|
+
export type AccountBalanceInput = z.infer<typeof AccountBalanceInputSchema>;
|
|
8
|
+
export declare class Account {
|
|
9
|
+
private client;
|
|
10
|
+
static inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
11
|
+
constructor(client: PcbWayClient);
|
|
12
|
+
getBalance(_params: AccountBalanceInput): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=Account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../src/resources/Account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD;;GAEG;AACH,eAAO,MAAM,yBAAyB,gDAAe,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,qBAAa,OAAO;IAGN,OAAO,CAAC,MAAM;IAF1B,MAAM,CAAC,WAAW,iDAA6B;gBAE3B,MAAM,EAAE,YAAY;IAElC,UAAU,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;CAahE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* QueryBalance takes no parameters — empty body.
|
|
4
|
+
*/
|
|
5
|
+
export const AccountBalanceInputSchema = z.object({});
|
|
6
|
+
export class Account {
|
|
7
|
+
client;
|
|
8
|
+
static inputSchema = AccountBalanceInputSchema;
|
|
9
|
+
constructor(client) {
|
|
10
|
+
this.client = client;
|
|
11
|
+
}
|
|
12
|
+
async getBalance(_params) {
|
|
13
|
+
const res = await this.client.request('/api/Account/QueryBalance', {});
|
|
14
|
+
return [
|
|
15
|
+
'## PCBWay Account Balance\n',
|
|
16
|
+
`**Cash Balance:** $${res.balance.toFixed(2)}`,
|
|
17
|
+
`**Coupon:** $${res.coupon.toFixed(2)}`,
|
|
18
|
+
`**Points:** ${res.point}`,
|
|
19
|
+
].join('\n');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=Account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Account.js","sourceRoot":"","sources":["../../src/resources/Account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAItD,MAAM,OAAO,OAAO;IAGE;IAFpB,MAAM,CAAC,WAAW,GAAG,yBAAyB,CAAC;IAE/C,YAAoB,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IAE5C,KAAK,CAAC,UAAU,CAAC,OAA4B;QAC3C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACnC,2BAA2B,EAC3B,EAAE,CACH,CAAC;QAEF,OAAO;YACL,6BAA6B;YAC7B,sBAAsB,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC9C,gBAAgB,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACvC,eAAe,GAAG,CAAC,KAAK,EAAE;SAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC"}
|