@codespar/mcp-coordinadora 0.1.0 → 0.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -6
- package/dist/index.d.ts +11 -0
- package/dist/index.js +251 -2
- package/package.json +13 -4
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# MCP Coordinadora
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
> **Alpha release** — published under the `alpha` npm dist-tag. Endpoint paths follow public docs and BACEN/provider conventions but have not been fully live-validated. Pin exact versions during `0.x.x-alpha`. Install with `npm install <pkg>@alpha`.
|
|
5
|
+
|
|
3
6
|
MCP server for **Coordinadora** — one of Colombia's largest courier and logistics companies, offering domestic and international shipping services.
|
|
4
7
|
|
|
5
8
|
## Quick Start
|
|
@@ -25,18 +28,29 @@ npx tsx packages/colombia/coordinadora/src/index.ts --http
|
|
|
25
28
|
| `MCP_HTTP` | No | Set to `"true"` to enable HTTP transport |
|
|
26
29
|
| `MCP_PORT` | No | HTTP port (default: 3000) |
|
|
27
30
|
|
|
28
|
-
## Tools
|
|
31
|
+
## Tools (19)
|
|
29
32
|
|
|
30
|
-
| Tool |
|
|
31
|
-
|
|
33
|
+
| Tool | Purpose |
|
|
34
|
+
|---|---|
|
|
32
35
|
| `create_shipment` | Create a new shipment |
|
|
33
36
|
| `get_shipment` | Get shipment details by guide number |
|
|
34
|
-
| `track_shipment` | Track a shipment |
|
|
37
|
+
| `track_shipment` | Track a shipment by guide number |
|
|
35
38
|
| `get_rates` | Get shipping rates/quotes |
|
|
36
39
|
| `list_cities` | List available cities for shipping |
|
|
37
|
-
| `create_pickup` | Schedule a pickup |
|
|
38
|
-
| `get_coverage` | Check
|
|
40
|
+
| `create_pickup` | Schedule a pickup at an address |
|
|
41
|
+
| `get_coverage` | Check if a location is within coverage area |
|
|
39
42
|
| `cancel_shipment` | Cancel a shipment |
|
|
43
|
+
| `get_guia_pdf` | Download a guía label as PDF (returns base64 or URL) |
|
|
44
|
+
| `get_pickup` | Get pickup (recolección) details by id |
|
|
45
|
+
| `cancel_pickup` | Cancel a scheduled pickup (recolección) |
|
|
46
|
+
| `get_tracking_history` | Get full tracking event history for a guía |
|
|
47
|
+
| `list_shipments_by_date` | List guías created within a date range |
|
|
48
|
+
| `validate_coverage` | Validate that a city + postal code combination is covered |
|
|
49
|
+
| `list_services` | List available service types for a given origin/destination |
|
|
50
|
+
| `list_offices` | List Coordinadora branch offices (oficinas) |
|
|
51
|
+
| `create_return` | Create a reverse-logistics return guía |
|
|
52
|
+
| `list_returns` | List existing return guías |
|
|
53
|
+
| `create_bulk_guias` | Create multiple guías in a single batch operation |
|
|
40
54
|
|
|
41
55
|
## Auth
|
|
42
56
|
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,17 @@
|
|
|
11
11
|
* - create_pickup: Schedule a pickup
|
|
12
12
|
* - get_coverage: Check coverage for a location
|
|
13
13
|
* - cancel_shipment: Cancel a shipment
|
|
14
|
+
* - get_guia_pdf: Download guía label as PDF
|
|
15
|
+
* - get_pickup: Get pickup/recolección details
|
|
16
|
+
* - cancel_pickup: Cancel a scheduled pickup
|
|
17
|
+
* - get_tracking_history: Full tracking event history
|
|
18
|
+
* - list_shipments_by_date: List shipments within a date range
|
|
19
|
+
* - validate_coverage: Validate coverage for a city + postal code
|
|
20
|
+
* - list_services: List available service types per coverage
|
|
21
|
+
* - list_offices: List Coordinadora branch offices (oficinas)
|
|
22
|
+
* - create_return: Create a reverse-logistics return guía
|
|
23
|
+
* - list_returns: List existing return guías
|
|
24
|
+
* - create_bulk_guias: Create multiple guías in a single batch
|
|
14
25
|
*
|
|
15
26
|
* Environment:
|
|
16
27
|
* COORDINADORA_API_KEY — API key
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,17 @@
|
|
|
11
11
|
* - create_pickup: Schedule a pickup
|
|
12
12
|
* - get_coverage: Check coverage for a location
|
|
13
13
|
* - cancel_shipment: Cancel a shipment
|
|
14
|
+
* - get_guia_pdf: Download guía label as PDF
|
|
15
|
+
* - get_pickup: Get pickup/recolección details
|
|
16
|
+
* - cancel_pickup: Cancel a scheduled pickup
|
|
17
|
+
* - get_tracking_history: Full tracking event history
|
|
18
|
+
* - list_shipments_by_date: List shipments within a date range
|
|
19
|
+
* - validate_coverage: Validate coverage for a city + postal code
|
|
20
|
+
* - list_services: List available service types per coverage
|
|
21
|
+
* - list_offices: List Coordinadora branch offices (oficinas)
|
|
22
|
+
* - create_return: Create a reverse-logistics return guía
|
|
23
|
+
* - list_returns: List existing return guías
|
|
24
|
+
* - create_bulk_guias: Create multiple guías in a single batch
|
|
14
25
|
*
|
|
15
26
|
* Environment:
|
|
16
27
|
* COORDINADORA_API_KEY — API key
|
|
@@ -42,7 +53,7 @@ async function coordinadoraRequest(method, path, body) {
|
|
|
42
53
|
}
|
|
43
54
|
return res.json();
|
|
44
55
|
}
|
|
45
|
-
const server = new Server({ name: "mcp-coordinadora", version: "0.
|
|
56
|
+
const server = new Server({ name: "mcp-coordinadora", version: "0.2.0-alpha.2" }, { capabilities: { tools: {} } });
|
|
46
57
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
47
58
|
tools: [
|
|
48
59
|
{
|
|
@@ -186,6 +197,162 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
186
197
|
required: ["guideNumber"],
|
|
187
198
|
},
|
|
188
199
|
},
|
|
200
|
+
{
|
|
201
|
+
name: "get_guia_pdf",
|
|
202
|
+
description: "Download a guía label as PDF (returns base64 or URL)",
|
|
203
|
+
inputSchema: {
|
|
204
|
+
type: "object",
|
|
205
|
+
properties: {
|
|
206
|
+
guideNumber: { type: "string", description: "Guide number" },
|
|
207
|
+
format: { type: "string", description: "Label format (pdf, zpl). Default pdf." },
|
|
208
|
+
},
|
|
209
|
+
required: ["guideNumber"],
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "get_pickup",
|
|
214
|
+
description: "Get pickup (recolección) details by id",
|
|
215
|
+
inputSchema: {
|
|
216
|
+
type: "object",
|
|
217
|
+
properties: { pickupId: { type: "string", description: "Pickup id" } },
|
|
218
|
+
required: ["pickupId"],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "cancel_pickup",
|
|
223
|
+
description: "Cancel a scheduled pickup (recolección)",
|
|
224
|
+
inputSchema: {
|
|
225
|
+
type: "object",
|
|
226
|
+
properties: {
|
|
227
|
+
pickupId: { type: "string", description: "Pickup id" },
|
|
228
|
+
reason: { type: "string", description: "Cancellation reason" },
|
|
229
|
+
},
|
|
230
|
+
required: ["pickupId"],
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "get_tracking_history",
|
|
235
|
+
description: "Get full tracking event history for a guía",
|
|
236
|
+
inputSchema: {
|
|
237
|
+
type: "object",
|
|
238
|
+
properties: {
|
|
239
|
+
guideNumber: { type: "string", description: "Guide number" },
|
|
240
|
+
include_proof: { type: "boolean", description: "Include proof of delivery image/signature" },
|
|
241
|
+
},
|
|
242
|
+
required: ["guideNumber"],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: "list_shipments_by_date",
|
|
247
|
+
description: "List guías created within a date range",
|
|
248
|
+
inputSchema: {
|
|
249
|
+
type: "object",
|
|
250
|
+
properties: {
|
|
251
|
+
date_from: { type: "string", description: "Start date (YYYY-MM-DD)" },
|
|
252
|
+
date_to: { type: "string", description: "End date (YYYY-MM-DD)" },
|
|
253
|
+
status: { type: "string", description: "Filter by shipment status" },
|
|
254
|
+
page: { type: "number", description: "Page number" },
|
|
255
|
+
page_size: { type: "number", description: "Items per page" },
|
|
256
|
+
},
|
|
257
|
+
required: ["date_from", "date_to"],
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: "validate_coverage",
|
|
262
|
+
description: "Validate that a city + postal code combination is covered",
|
|
263
|
+
inputSchema: {
|
|
264
|
+
type: "object",
|
|
265
|
+
properties: {
|
|
266
|
+
city: { type: "string", description: "City DANE code or name" },
|
|
267
|
+
postal_code: { type: "string", description: "Postal code" },
|
|
268
|
+
service_type: { type: "string", description: "Optional service type to validate" },
|
|
269
|
+
},
|
|
270
|
+
required: ["city", "postal_code"],
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "list_services",
|
|
275
|
+
description: "List available service types for a given origin/destination",
|
|
276
|
+
inputSchema: {
|
|
277
|
+
type: "object",
|
|
278
|
+
properties: {
|
|
279
|
+
origin_city: { type: "string", description: "Origin city DANE code" },
|
|
280
|
+
destination_city: { type: "string", description: "Destination city DANE code" },
|
|
281
|
+
},
|
|
282
|
+
required: ["origin_city", "destination_city"],
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: "list_offices",
|
|
287
|
+
description: "List Coordinadora branch offices (oficinas)",
|
|
288
|
+
inputSchema: {
|
|
289
|
+
type: "object",
|
|
290
|
+
properties: {
|
|
291
|
+
city: { type: "string", description: "Filter by city DANE code" },
|
|
292
|
+
department: { type: "string", description: "Filter by department" },
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
name: "create_return",
|
|
298
|
+
description: "Create a reverse-logistics return guía",
|
|
299
|
+
inputSchema: {
|
|
300
|
+
type: "object",
|
|
301
|
+
properties: {
|
|
302
|
+
original_guide: { type: "string", description: "Original guide number being returned" },
|
|
303
|
+
origin_city: { type: "string", description: "Origin (current location) city DANE code" },
|
|
304
|
+
destination_city: { type: "string", description: "Destination city DANE code" },
|
|
305
|
+
sender: {
|
|
306
|
+
type: "object",
|
|
307
|
+
properties: {
|
|
308
|
+
name: { type: "string" },
|
|
309
|
+
phone: { type: "string" },
|
|
310
|
+
address: { type: "string" },
|
|
311
|
+
},
|
|
312
|
+
required: ["name", "phone", "address"],
|
|
313
|
+
},
|
|
314
|
+
recipient: {
|
|
315
|
+
type: "object",
|
|
316
|
+
properties: {
|
|
317
|
+
name: { type: "string" },
|
|
318
|
+
phone: { type: "string" },
|
|
319
|
+
address: { type: "string" },
|
|
320
|
+
},
|
|
321
|
+
required: ["name", "phone", "address"],
|
|
322
|
+
},
|
|
323
|
+
reason: { type: "string", description: "Return reason" },
|
|
324
|
+
weight: { type: "number", description: "Weight in kg" },
|
|
325
|
+
},
|
|
326
|
+
required: ["origin_city", "destination_city", "sender", "recipient", "weight"],
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: "list_returns",
|
|
331
|
+
description: "List existing return guías",
|
|
332
|
+
inputSchema: {
|
|
333
|
+
type: "object",
|
|
334
|
+
properties: {
|
|
335
|
+
date_from: { type: "string", description: "Start date (YYYY-MM-DD)" },
|
|
336
|
+
date_to: { type: "string", description: "End date (YYYY-MM-DD)" },
|
|
337
|
+
status: { type: "string", description: "Filter by status" },
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: "create_bulk_guias",
|
|
343
|
+
description: "Create multiple guías in a single batch operation",
|
|
344
|
+
inputSchema: {
|
|
345
|
+
type: "object",
|
|
346
|
+
properties: {
|
|
347
|
+
shipments: {
|
|
348
|
+
type: "array",
|
|
349
|
+
description: "Array of shipment objects (same shape as create_shipment payload)",
|
|
350
|
+
items: { type: "object" },
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
required: ["shipments"],
|
|
354
|
+
},
|
|
355
|
+
},
|
|
189
356
|
],
|
|
190
357
|
}));
|
|
191
358
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
@@ -255,6 +422,88 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
255
422
|
payload.motivo = args.reason;
|
|
256
423
|
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("DELETE", `/guias/${args?.guideNumber}`, payload), null, 2) }] };
|
|
257
424
|
}
|
|
425
|
+
case "get_guia_pdf": {
|
|
426
|
+
const params = new URLSearchParams();
|
|
427
|
+
if (args?.format)
|
|
428
|
+
params.set("formato", args.format);
|
|
429
|
+
const qs = params.toString() ? `?${params}` : "";
|
|
430
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("GET", `/guias/${args?.guideNumber}/pdf${qs}`), null, 2) }] };
|
|
431
|
+
}
|
|
432
|
+
case "get_pickup":
|
|
433
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("GET", `/recolecciones/${args?.pickupId}`), null, 2) }] };
|
|
434
|
+
case "cancel_pickup": {
|
|
435
|
+
const payload = {};
|
|
436
|
+
if (args?.reason)
|
|
437
|
+
payload.motivo = args.reason;
|
|
438
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("DELETE", `/recolecciones/${args?.pickupId}`, payload), null, 2) }] };
|
|
439
|
+
}
|
|
440
|
+
case "get_tracking_history": {
|
|
441
|
+
const params = new URLSearchParams();
|
|
442
|
+
if (args?.include_proof)
|
|
443
|
+
params.set("incluirEvidencia", "true");
|
|
444
|
+
const qs = params.toString() ? `?${params}` : "";
|
|
445
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("GET", `/guias/${args?.guideNumber}/eventos${qs}`), null, 2) }] };
|
|
446
|
+
}
|
|
447
|
+
case "list_shipments_by_date": {
|
|
448
|
+
const params = new URLSearchParams();
|
|
449
|
+
params.set("fechaDesde", args?.date_from);
|
|
450
|
+
params.set("fechaHasta", args?.date_to);
|
|
451
|
+
if (args?.status)
|
|
452
|
+
params.set("estado", args.status);
|
|
453
|
+
if (args?.page)
|
|
454
|
+
params.set("pagina", String(args.page));
|
|
455
|
+
if (args?.page_size)
|
|
456
|
+
params.set("tamanoPagina", String(args.page_size));
|
|
457
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("GET", `/guias?${params}`), null, 2) }] };
|
|
458
|
+
}
|
|
459
|
+
case "validate_coverage": {
|
|
460
|
+
const params = new URLSearchParams();
|
|
461
|
+
params.set("ciudad", args?.city);
|
|
462
|
+
params.set("codigoPostal", args?.postal_code);
|
|
463
|
+
if (args?.service_type)
|
|
464
|
+
params.set("tipoServicio", args.service_type);
|
|
465
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("GET", `/cobertura/validar?${params}`), null, 2) }] };
|
|
466
|
+
}
|
|
467
|
+
case "list_services": {
|
|
468
|
+
const params = new URLSearchParams();
|
|
469
|
+
params.set("ciudadOrigen", args?.origin_city);
|
|
470
|
+
params.set("ciudadDestino", args?.destination_city);
|
|
471
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("GET", `/servicios?${params}`), null, 2) }] };
|
|
472
|
+
}
|
|
473
|
+
case "list_offices": {
|
|
474
|
+
const params = new URLSearchParams();
|
|
475
|
+
if (args?.city)
|
|
476
|
+
params.set("ciudad", args.city);
|
|
477
|
+
if (args?.department)
|
|
478
|
+
params.set("departamento", args.department);
|
|
479
|
+
const qs = params.toString() ? `?${params}` : "";
|
|
480
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("GET", `/oficinas${qs}`), null, 2) }] };
|
|
481
|
+
}
|
|
482
|
+
case "create_return":
|
|
483
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("POST", "/devoluciones", {
|
|
484
|
+
guiaOriginal: args?.original_guide,
|
|
485
|
+
ciudadOrigen: args?.origin_city,
|
|
486
|
+
ciudadDestino: args?.destination_city,
|
|
487
|
+
remitente: args?.sender,
|
|
488
|
+
destinatario: args?.recipient,
|
|
489
|
+
motivo: args?.reason,
|
|
490
|
+
peso: args?.weight,
|
|
491
|
+
}), null, 2) }] };
|
|
492
|
+
case "list_returns": {
|
|
493
|
+
const params = new URLSearchParams();
|
|
494
|
+
if (args?.date_from)
|
|
495
|
+
params.set("fechaDesde", args.date_from);
|
|
496
|
+
if (args?.date_to)
|
|
497
|
+
params.set("fechaHasta", args.date_to);
|
|
498
|
+
if (args?.status)
|
|
499
|
+
params.set("estado", args.status);
|
|
500
|
+
const qs = params.toString() ? `?${params}` : "";
|
|
501
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("GET", `/devoluciones${qs}`), null, 2) }] };
|
|
502
|
+
}
|
|
503
|
+
case "create_bulk_guias":
|
|
504
|
+
return { content: [{ type: "text", text: JSON.stringify(await coordinadoraRequest("POST", "/guias/lote", {
|
|
505
|
+
guias: args?.shipments,
|
|
506
|
+
}), null, 2) }] };
|
|
258
507
|
default:
|
|
259
508
|
return { content: [{ type: "text", text: `Unknown tool: ${name}` }], isError: true };
|
|
260
509
|
}
|
|
@@ -281,7 +530,7 @@ async function main() {
|
|
|
281
530
|
const t = new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID(), onsessioninitialized: (id) => { transports.set(id, t); } });
|
|
282
531
|
t.onclose = () => { if (t.sessionId)
|
|
283
532
|
transports.delete(t.sessionId); };
|
|
284
|
-
const s = new Server({ name: "mcp-coordinadora", version: "0.
|
|
533
|
+
const s = new Server({ name: "mcp-coordinadora", version: "0.2.0-alpha.2" }, { capabilities: { tools: {} } });
|
|
285
534
|
server._requestHandlers.forEach((v, k) => s._requestHandlers.set(k, v));
|
|
286
535
|
server._notificationHandlers?.forEach((v, k) => s._notificationHandlers.set(k, v));
|
|
287
536
|
await s.connect(t);
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codespar/mcp-coordinadora",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "MCP server for Coordinadora
|
|
3
|
+
"version": "0.2.0-alpha.2",
|
|
4
|
+
"description": "MCP server for Coordinadora \u2014 Colombian courier and logistics",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"mcp-coordinadora": "dist/index.js"
|
|
9
9
|
},
|
|
10
|
-
"files": [
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
11
13
|
"scripts": {
|
|
12
14
|
"build": "tsc",
|
|
13
15
|
"start": "node dist/index.js"
|
|
@@ -20,6 +22,13 @@
|
|
|
20
22
|
"typescript": "^5.8.0"
|
|
21
23
|
},
|
|
22
24
|
"license": "MIT",
|
|
23
|
-
"keywords": [
|
|
25
|
+
"keywords": [
|
|
26
|
+
"coordinadora",
|
|
27
|
+
"courier",
|
|
28
|
+
"logistics",
|
|
29
|
+
"colombia",
|
|
30
|
+
"shipping",
|
|
31
|
+
"mcp"
|
|
32
|
+
],
|
|
24
33
|
"mcpName": "io.github.codespar/mcp-coordinadora"
|
|
25
34
|
}
|