@unclick/sendle-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.
- package/LICENSE +15 -0
- package/README.md +35 -0
- package/dist/index.js +89 -0
- package/dist/sendle-tool.js +145 -0
- package/package.json +45 -0
- package/server.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Apache License 2.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UnClick / malamutemayhem
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Sendle MCP by UnClick
|
|
2
|
+
|
|
3
|
+
Sendle shipping quotes, orders, and parcel tracking.
|
|
4
|
+
|
|
5
|
+
> By UnClick. 180+ tools plus persistent agent memory in one install: https://unclick.world
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Installs straight from GitHub, no npm account needed.
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"sendle": {
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": ["-y", "https://github.com/malamutemayhem/unclick/releases/download/standalone-mcps-latest/sendle.tgz"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Tools
|
|
23
|
+
|
|
24
|
+
- `sendle_get_quote`
|
|
25
|
+
- `sendle_create_order`
|
|
26
|
+
- `sendle_track_parcel`
|
|
27
|
+
|
|
28
|
+
## Want the rest?
|
|
29
|
+
|
|
30
|
+
This is one connector. [UnClick](https://unclick.world) bundles 180+ tools plus
|
|
31
|
+
persistent cross-session agent memory in a single install.
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
Apache-2.0
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Sendle MCP. Standalone MCP server by UnClick.
|
|
3
|
+
// By UnClick. 180+ tools plus persistent agent memory in one install: https://unclick.world
|
|
4
|
+
//
|
|
5
|
+
// Generated from the UnClick connector by scripts/generate-standalone-mcp.mjs.
|
|
6
|
+
// Edit the connector in the UnClick monorepo, not here.
|
|
7
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
8
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
10
|
+
import { getSendleQuote, createSendleOrder, trackSendleParcel, } from "./sendle-tool.js";
|
|
11
|
+
const TOOLS = [
|
|
12
|
+
{
|
|
13
|
+
name: "sendle_get_quote",
|
|
14
|
+
description: "Get a shipping quote from Sendle.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
properties: {
|
|
19
|
+
pickup_suburb: { type: "string" },
|
|
20
|
+
pickup_postcode: { type: "string" },
|
|
21
|
+
pickup_country: { type: "string" },
|
|
22
|
+
delivery_suburb: { type: "string" },
|
|
23
|
+
delivery_postcode: { type: "string" },
|
|
24
|
+
delivery_country: { type: "string" },
|
|
25
|
+
weight_value: { type: "number" },
|
|
26
|
+
weight_units: { type: "string" },
|
|
27
|
+
api_key: { type: "string" },
|
|
28
|
+
},
|
|
29
|
+
required: ["pickup_postcode", "delivery_postcode", "weight_value"],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "sendle_create_order",
|
|
34
|
+
description: "Create a Sendle shipping order.",
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: "object",
|
|
37
|
+
additionalProperties: false,
|
|
38
|
+
properties: {
|
|
39
|
+
sender: { type: "object", additionalProperties: true },
|
|
40
|
+
receiver: { type: "object", additionalProperties: true },
|
|
41
|
+
parcel_contents: { type: "array", items: {} },
|
|
42
|
+
api_key: { type: "string" },
|
|
43
|
+
},
|
|
44
|
+
required: ["sender", "receiver"],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "sendle_track_parcel",
|
|
49
|
+
description: "Track a Sendle parcel by tracking number.",
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object",
|
|
52
|
+
additionalProperties: false,
|
|
53
|
+
properties: {
|
|
54
|
+
tracking_id: { type: "string" },
|
|
55
|
+
api_key: { type: "string" },
|
|
56
|
+
},
|
|
57
|
+
required: ["tracking_id"],
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
const HANDLERS = {
|
|
62
|
+
sendle_get_quote: (args) => getSendleQuote(args),
|
|
63
|
+
sendle_create_order: (args) => createSendleOrder(args),
|
|
64
|
+
sendle_track_parcel: (args) => trackSendleParcel(args),
|
|
65
|
+
};
|
|
66
|
+
const server = new Server({ name: "io.github.malamutemayhem/sendle", version: "0.1.0" }, { capabilities: { tools: {} } });
|
|
67
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
68
|
+
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
69
|
+
const handler = HANDLERS[req.params.name];
|
|
70
|
+
if (!handler) {
|
|
71
|
+
return { content: [{ type: "text", text: `Unknown tool: ${req.params.name}` }], isError: true };
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
const result = await handler((req.params.arguments ?? {}));
|
|
75
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
79
|
+
return { content: [{ type: "text", text: message }], isError: true };
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
async function main() {
|
|
83
|
+
const transport = new StdioServerTransport();
|
|
84
|
+
await server.connect(transport);
|
|
85
|
+
}
|
|
86
|
+
main().catch((err) => {
|
|
87
|
+
process.stderr.write(`[sendle-mcp] fatal: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
});
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// Sendle AU courier integration.
|
|
2
|
+
// Quote, order, and track domestic and international courier shipments.
|
|
3
|
+
// Docs: https://developers.sendle.com/
|
|
4
|
+
// Auth: SENDLE_ID + SENDLE_API_KEY env vars (HTTP Basic Auth).
|
|
5
|
+
// Base URL: https://api.sendle.com/api/
|
|
6
|
+
const SENDLE_BASE = "https://api.sendle.com/api";
|
|
7
|
+
function getAuth(args) {
|
|
8
|
+
const id = String(args.sendle_id ?? process.env.SENDLE_ID ?? "").trim();
|
|
9
|
+
const key = String(args.api_key ?? process.env.SENDLE_API_KEY ?? "").trim();
|
|
10
|
+
if (!id)
|
|
11
|
+
throw new Error("sendle_id is required (or set SENDLE_ID env var).");
|
|
12
|
+
if (!key)
|
|
13
|
+
throw new Error("api_key is required (or set SENDLE_API_KEY env var).");
|
|
14
|
+
return { id, key };
|
|
15
|
+
}
|
|
16
|
+
function basicAuth(auth) {
|
|
17
|
+
return "Basic " + Buffer.from(`${auth.id}:${auth.key}`).toString("base64");
|
|
18
|
+
}
|
|
19
|
+
async function sendleFetch(auth, path, method = "GET", body) {
|
|
20
|
+
const res = await fetch(`${SENDLE_BASE}${path}`, {
|
|
21
|
+
method,
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: basicAuth(auth),
|
|
24
|
+
"Content-Type": "application/json",
|
|
25
|
+
Accept: "application/json",
|
|
26
|
+
},
|
|
27
|
+
...(body ? { body: JSON.stringify(body) } : {}),
|
|
28
|
+
});
|
|
29
|
+
if (res.status === 401 || res.status === 403)
|
|
30
|
+
throw new Error("Invalid Sendle credentials.");
|
|
31
|
+
if (res.status === 404)
|
|
32
|
+
throw new Error("Resource not found.");
|
|
33
|
+
if (res.status === 422) {
|
|
34
|
+
const text = await res.text().catch(() => "");
|
|
35
|
+
throw new Error(`Sendle validation error: ${text.slice(0, 300)}`);
|
|
36
|
+
}
|
|
37
|
+
if (res.status === 429)
|
|
38
|
+
throw new Error("Sendle API rate limit exceeded.");
|
|
39
|
+
if (!res.ok) {
|
|
40
|
+
const text = await res.text().catch(() => "");
|
|
41
|
+
throw new Error(`Sendle API HTTP ${res.status}${text ? `: ${text.slice(0, 200)}` : ""}`);
|
|
42
|
+
}
|
|
43
|
+
return res.json();
|
|
44
|
+
}
|
|
45
|
+
// ─── get_sendle_quote ─────────────────────────────────────────────────────────
|
|
46
|
+
export async function getSendleQuote(args) {
|
|
47
|
+
try {
|
|
48
|
+
const auth = getAuth(args);
|
|
49
|
+
const pickupPostcode = String(args.pickup_postcode ?? "").trim();
|
|
50
|
+
const deliveryPostcode = String(args.delivery_postcode ?? "").trim();
|
|
51
|
+
if (!pickupPostcode)
|
|
52
|
+
return { error: "pickup_postcode is required." };
|
|
53
|
+
if (!deliveryPostcode)
|
|
54
|
+
return { error: "delivery_postcode is required." };
|
|
55
|
+
const params = new URLSearchParams({
|
|
56
|
+
"pickup_suburb": String(args.pickup_suburb ?? ""),
|
|
57
|
+
"pickup_postcode": pickupPostcode,
|
|
58
|
+
"pickup_country": String(args.pickup_country ?? "AU"),
|
|
59
|
+
"delivery_suburb": String(args.delivery_suburb ?? ""),
|
|
60
|
+
"delivery_postcode": deliveryPostcode,
|
|
61
|
+
"delivery_country": String(args.delivery_country ?? "AU"),
|
|
62
|
+
"weight_value": String(args.weight_kg ?? "1"),
|
|
63
|
+
"weight_units": "kg",
|
|
64
|
+
});
|
|
65
|
+
if (args.volume_l)
|
|
66
|
+
params.set("volume_value", String(args.volume_l));
|
|
67
|
+
if (args.volume_l)
|
|
68
|
+
params.set("volume_units", "l");
|
|
69
|
+
const data = await sendleFetch(auth, `/quote?${params}`);
|
|
70
|
+
return {
|
|
71
|
+
pickup_postcode: pickupPostcode,
|
|
72
|
+
delivery_postcode: deliveryPostcode,
|
|
73
|
+
weight_kg: args.weight_kg ?? 1,
|
|
74
|
+
quotes: Array.isArray(data)
|
|
75
|
+
? data.map((q) => ({
|
|
76
|
+
plan: q["plan_name"],
|
|
77
|
+
product: q["product"],
|
|
78
|
+
eta_days_min: q["eta"]?.["days_range"]?.[0],
|
|
79
|
+
eta_days_max: q["eta"]?.["days_range"]?.[1],
|
|
80
|
+
price_aud: q["quote"]?.["gross"],
|
|
81
|
+
price_aud_tax: q["quote"]?.["tax"],
|
|
82
|
+
}))
|
|
83
|
+
: [],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// ─── create_sendle_order ──────────────────────────────────────────────────────
|
|
91
|
+
export async function createSendleOrder(args) {
|
|
92
|
+
try {
|
|
93
|
+
const auth = getAuth(args);
|
|
94
|
+
const body = {
|
|
95
|
+
pickup_date: args.pickup_date,
|
|
96
|
+
description: args.description ?? "Parcel",
|
|
97
|
+
weight: { value: Number(args.weight_kg ?? 1), units: "kg" },
|
|
98
|
+
sender: args.sender,
|
|
99
|
+
receiver: args.receiver,
|
|
100
|
+
};
|
|
101
|
+
if (args.customer_reference)
|
|
102
|
+
body["customer_reference"] = args.customer_reference;
|
|
103
|
+
if (args.metadata)
|
|
104
|
+
body["metadata"] = args.metadata;
|
|
105
|
+
const data = await sendleFetch(auth, "/orders", "POST", body);
|
|
106
|
+
return {
|
|
107
|
+
order_id: data["order_id"],
|
|
108
|
+
state: data["state"],
|
|
109
|
+
tracking_url: data["tracking_url"],
|
|
110
|
+
label_url: data["labels"]?.[0]?.["url"],
|
|
111
|
+
sendle_reference: data["sendle_reference"],
|
|
112
|
+
customer_reference: data["customer_reference"],
|
|
113
|
+
pickup_date: data["pickup_date"],
|
|
114
|
+
eta: data["eta"],
|
|
115
|
+
price_aud: data["quote"]?.["gross"],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// ─── track_sendle_parcel ──────────────────────────────────────────────────────
|
|
123
|
+
export async function trackSendleParcel(args) {
|
|
124
|
+
try {
|
|
125
|
+
const auth = getAuth(args);
|
|
126
|
+
const ref = String(args.tracking_ref ?? args.sendle_reference ?? "").trim();
|
|
127
|
+
if (!ref)
|
|
128
|
+
return { error: "tracking_ref is required (Sendle reference number)." };
|
|
129
|
+
const data = await sendleFetch(auth, `/tracking/${encodeURIComponent(ref)}`);
|
|
130
|
+
return {
|
|
131
|
+
tracking_ref: ref,
|
|
132
|
+
state: data["state"],
|
|
133
|
+
tracking_events: data["tracking_events"]?.map((e) => ({
|
|
134
|
+
event_type: e["event_type"],
|
|
135
|
+
description: e["description"],
|
|
136
|
+
scan_time: e["scan_time"],
|
|
137
|
+
location: e["location"],
|
|
138
|
+
})),
|
|
139
|
+
estimated_delivery: data["estimated_delivery"],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
catch (err) {
|
|
143
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
144
|
+
}
|
|
145
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unclick/sendle-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"mcpName": "io.github.malamutemayhem/sendle",
|
|
5
|
+
"description": "Sendle shipping quotes, orders, and parcel tracking. By UnClick (https://unclick.world).",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"mcp",
|
|
8
|
+
"model-context-protocol",
|
|
9
|
+
"unclick",
|
|
10
|
+
"sendle",
|
|
11
|
+
"shipping",
|
|
12
|
+
"parcel",
|
|
13
|
+
"australia"
|
|
14
|
+
],
|
|
15
|
+
"author": "UnClick (https://unclick.world)",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"bin": {
|
|
18
|
+
"sendle-mcp": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md",
|
|
24
|
+
"server.json"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"start": "node dist/index.js",
|
|
29
|
+
"prepublishOnly": "npm run build"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.15.1"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"typescript": "^5.6.0",
|
|
36
|
+
"@types/node": "^22.0.0"
|
|
37
|
+
},
|
|
38
|
+
"license": "Apache-2.0",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/malamutemayhem/unclick.git",
|
|
42
|
+
"directory": "packages/standalone/sendle-mcp"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://unclick.world"
|
|
45
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.malamutemayhem/sendle",
|
|
4
|
+
"title": "Sendle MCP by UnClick",
|
|
5
|
+
"description": "Sendle shipping quotes, orders, and parcel tracking. By UnClick.",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://unclick.world",
|
|
8
|
+
"icons": [
|
|
9
|
+
{
|
|
10
|
+
"src": "https://unclick.world/favicon.png",
|
|
11
|
+
"mimeType": "image/png",
|
|
12
|
+
"sizes": [
|
|
13
|
+
"512x512"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"url": "https://github.com/malamutemayhem/unclick.git",
|
|
19
|
+
"source": "github",
|
|
20
|
+
"subfolder": "packages/standalone/sendle-mcp"
|
|
21
|
+
},
|
|
22
|
+
"packages": [
|
|
23
|
+
{
|
|
24
|
+
"registryType": "npm",
|
|
25
|
+
"identifier": "@unclick/sendle-mcp",
|
|
26
|
+
"version": "0.1.0",
|
|
27
|
+
"runtimeHint": "npx",
|
|
28
|
+
"transport": {
|
|
29
|
+
"type": "stdio"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|