@open-mena-mcp/bosta 0.0.0-stage → 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dinaelsayed99
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,128 @@
1
- # Temporary Holding Version
1
+ # @open-mena-mcp/bosta
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ MCP server for the [Bosta](https://bosta.co) v2 logistics API: track a delivery, search deliveries, list pickup locations and estimate a shipping fee.
4
+
5
+ Part of the [open-mena-mcp](https://github.com/Dinaelsayed99/open-mena-mcp) monorepo. All four tools are read-only and need a Bosta API key.
6
+
7
+ ## Requirements
8
+
9
+ - Node 20 or later.
10
+ - A Bosta API key from the dashboard: **Settings → API Integration → Request OTP → Create API key**. A read-only key is enough for every tool here.
11
+
12
+ ## Configuration
13
+
14
+ | Variable | Required | Default | Purpose |
15
+ | ------------------- | -------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
16
+ | `BOSTA_API_KEY` | yes | none | Sent in the `Authorization` header exactly as Bosta's "Get Your API Key" page shows it. Never logged and never included in an error message. |
17
+ | `BOSTA_BASE_URL` | no | `https://app.bosta.co/api/v2` | API base URL. Use `https://stg-app.bosta.co/api/v2` for staging. |
18
+ | `BOSTA_AUTH_PREFIX` | no | empty | Text placed before the key in the header, for example `Bearer ` if your account expects that form. |
19
+ | `BOSTA_TIMEOUT_MS` | no | `15000` | Per-request timeout. |
20
+ | `LOG_LEVEL` | no | `info` | `debug` adds debug logging on stderr. |
21
+
22
+ Without a key the server still starts and lists its tools; each call then returns an `AUTH_MISSING` error result.
23
+
24
+ ## Tools
25
+
26
+ | Tool | Method and path | What it does |
27
+ | ---------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
28
+ | `track_delivery` | `GET /deliveries/business/{trackingNumber}` | One delivery by tracking number: state, masked state, addresses, receiver, COD, package specs, timestamps. |
29
+ | `list_deliveries` | `POST /deliveries/search` | Search by `type`, `trackingNumbers`, `mobilePhones`, `businessReference` or `stateCodes`. At least one filter is required. |
30
+ | `list_pickup_locations` | `GET /pickup-locations` | The business's pickup locations. Each `_id` is the `businessLocationId` used when creating deliveries. |
31
+ | `calculate_delivery_pricing` | `GET /pricing/shipment/calculator` | Shipping fee estimate from `dropOffCity`, `pickupCity`, `cod`, `type` and `size`. |
32
+
33
+ Responses are returned as Bosta sends them: the `{ success, message, data }` envelope is not reshaped, so nothing is hidden from the client.
34
+
35
+ ## Run it
36
+
37
+ ### Claude Desktop
38
+
39
+ ```json
40
+ {
41
+ "mcpServers": {
42
+ "bosta": {
43
+ "command": "npx",
44
+ "args": ["-y", "@open-mena-mcp/bosta"],
45
+ "env": {
46
+ "BOSTA_API_KEY": "your-api-key"
47
+ }
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ ### Claude Code
54
+
55
+ ```bash
56
+ claude mcp add bosta -e BOSTA_API_KEY=your-api-key -- npx -y @open-mena-mcp/bosta
57
+ ```
58
+
59
+ ### From this monorepo
60
+
61
+ ```bash
62
+ pnpm install
63
+ pnpm --filter @open-mena-mcp/bosta build
64
+ BOSTA_API_KEY=your-api-key node packages/mcp-bosta/dist/bin.js
65
+ ```
66
+
67
+ ## Endpoint verification
68
+
69
+ Every path, method and parameter in this package was taken from Bosta's own OpenAPI document, `https://docs.bosta.co/api/api.yaml` (OpenAPI 3.0.1, `info.version: 2.0.0`, `title: Bosta Server APIs`), which the reference at `https://docs.bosta.co/api/` is rendered from. Nothing here comes from memory, a third-party SDK or a blog post.
70
+
71
+ | Check | Result |
72
+ | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
73
+ | `GET /deliveries/business/{trackingNumber}` documented | Yes, "Business view delivery", path parameter `trackingNumber` |
74
+ | `POST /deliveries/search` documented | Yes, body schema `DeliverySearchParams` |
75
+ | `GET /pickup-locations` documented | Yes, "List business pickup-locations" |
76
+ | `GET /pricing/shipment/calculator` documented | Yes, "Get Shipping fees estimate" with five query parameters |
77
+ | HTTPS base URL | `https://app.bosta.co/api/v2` answers; `http://` returns `308` to `https://`; `GET /api/v2/cities` returns `200` |
78
+ | Paths resolve on the live API | All four paths answer `401` `{"success":false,"message":"Invalid authorization token or API key.","errorCode":1028}` without a key, which shows the routes exist and only the credential is missing |
79
+
80
+ ## Documented ambiguities
81
+
82
+ These are places where the official document is incomplete or inconsistent. Each one is handled as described, not guessed away:
83
+
84
+ 1. **Base URL scheme.** The OpenAPI `servers` entry says `http://app.bosta.co/api/v2/`, but `http` redirects to `https` with `308`. This package defaults to `https`.
85
+ 2. **Auth scheme.** `components.securitySchemes` declares both `Bearer` (`type: http, scheme: bearer`) and `ApiKey` (`type: apiKey, name: Authorization, in: header`), while the official "Get Your API Key" page shows `Authorization: <API_KEY>` with no `Bearer` prefix. The default is the header-only form; set `BOSTA_AUTH_PREFIX="Bearer "` if your account wants the prefix.
86
+ 3. **`mobilePhones` type.** `DeliverySearchParams` declares `type: string` but the description talks about phone numbers in the plural and adds `items: string`. The tool takes a single string per call.
87
+ 4. **`trackingNumbers` type.** Declared `type: array` of strings, with the example shown as a comma-joined string (`"5108002, 5108003"`). The tool sends an array, matching the declared type.
88
+ 5. **No pagination on `/deliveries/search`.** `DeliverySearchParams` has no `page`, `limit` or `skip` field, and the response schema is a single-object example. The tool sends no pagination parameters and returns whatever the API answers.
89
+ 6. **Pickup location pagination.** `GET /pickup-locations` declares `parameters: []`, yet its example response carries `page`, `limit` and `pages`. The tool sends no query parameters; the API's own defaults apply.
90
+ 7. **Pricing parameters.** All five parameters of `/pricing/shipment/calculator` are `required: false` and the `200` response has no documented schema. The tool requires at least one parameter and returns the body unchanged.
91
+ 8. **Two pricing endpoints.** `GET /pricing/calculator` is a _plan_ pricing endpoint (`tierIdSelector`, `pickupSectorId`, `vatIncluded`), not a shipment fee estimate, so it is not exposed here.
92
+ 9. **Delivery type sets differ.** `search` accepts `SEND, CASH_COLLECTION, RETURN, RTO, EXCHANGE, CUSTOMER_RETURN_PICKUP`; the pricing calculator accepts `SEND, CASH_COLLECTION, CUSTOMER_RETURN_PICKUP, EXCHANGE, SIGN_AND_RETURN`. The two tools use their own enum, so a type valid in one is not silently accepted in the other.
93
+ 10. **No published rate limits.** The document states none, so this package adds no local limiter.
94
+
95
+ ## Errors
96
+
97
+ Failures come back as MCP error results carrying a code, so a client can show the message and decide what to do:
98
+
99
+ | Code | When |
100
+ | ---------------- | ------------------------------------------------------------------------------- |
101
+ | `AUTH_MISSING` | `BOSTA_API_KEY` is not set |
102
+ | `AUTH_FAILED` | HTTP 401 or 403, for example Bosta `errorCode` 1028 |
103
+ | `NOT_FOUND` | HTTP 404 |
104
+ | `INVALID_INPUT` | The input fails the Zod schema, or a search or estimate was sent with no filter |
105
+ | `RATE_LIMITED` | HTTP 429 |
106
+ | `TIMEOUT` | No answer within `BOSTA_TIMEOUT_MS` |
107
+ | `UPSTREAM_ERROR` | Any other HTTP error, a non-JSON body, or a network failure |
108
+
109
+ ## Security notes
110
+
111
+ - The key is read from the environment only and sent only in the `Authorization` header. It is never written to a log line, a tool result or an error message, and a test asserts that.
112
+ - Every tool is annotated read-only. Nothing in this package creates, updates, terminates or deletes anything on Bosta.
113
+ - The test suite stubs `fetch`; no test makes a live request and no test needs a real key.
114
+
115
+ ## Develop
116
+
117
+ ```bash
118
+ pnpm --filter @open-mena-mcp/bosta build
119
+ pnpm --filter @open-mena-mcp/bosta typecheck
120
+ pnpm --filter @open-mena-mcp/bosta lint
121
+ pnpm --filter @open-mena-mcp/bosta test
122
+ ```
123
+
124
+ 32 tests: 6 for configuration, 11 for the HTTP client (auth header, query building, error mapping, timeout, key redaction), 9 for the tool-to-request mapping, and 6 for the MCP layer including a real stdio handshake against the built entrypoint.
125
+
126
+ ## License
127
+
128
+ MIT
package/dist/bin.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * stdio entrypoint for @open-mena-mcp/bosta.
4
+ *
5
+ * Nothing may be written to stdout except MCP protocol frames, so all logging goes to
6
+ * stderr through the core structured logger. The API key is never logged.
7
+ */
8
+ export {};
package/dist/bin.js ADDED
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * stdio entrypoint for @open-mena-mcp/bosta.
4
+ *
5
+ * Nothing may be written to stdout except MCP protocol frames, so all logging goes to
6
+ * stderr through the core structured logger. The API key is never logged.
7
+ */
8
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
9
+ import { createLogger } from "@open-mena-mcp/core";
10
+ import { SERVER_NAME, SERVER_VERSION, createServer, describeTarget } from "./server.js";
11
+ async function main() {
12
+ const level = process.env.LOG_LEVEL === "debug" ? "debug" : "info";
13
+ const logger = createLogger({ name: "bosta", level });
14
+ if (process.env.BOSTA_API_KEY === undefined || process.env.BOSTA_API_KEY.trim() === "") {
15
+ logger.warn("BOSTA_API_KEY is not set: tool calls will fail with AUTH_MISSING", {
16
+ hint: "Create a key in the Bosta dashboard under Settings > API Integration.",
17
+ });
18
+ }
19
+ const server = createServer();
20
+ const transport = new StdioServerTransport();
21
+ await server.connect(transport);
22
+ logger.info("MCP server running on stdio", {
23
+ server: SERVER_NAME,
24
+ version: SERVER_VERSION,
25
+ api: describeTarget(),
26
+ });
27
+ }
28
+ main().catch((error) => {
29
+ const message = error instanceof Error ? error.message : String(error);
30
+ process.stderr.write(`Failed to start ${SERVER_NAME}: ${message}\n`);
31
+ process.exit(1);
32
+ });
33
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAExF,KAAK,UAAU,IAAI;IACjB,MAAM,KAAK,GAAa,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAC7E,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAEtD,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACvF,MAAM,CAAC,IAAI,CAAC,kEAAkE,EAAE;YAC9E,IAAI,EAAE,uEAAuE;SAC9E,CAAC,CAAC;IACL,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE;QACzC,MAAM,EAAE,WAAW;QACnB,OAAO,EAAE,cAAc;QACvB,GAAG,EAAE,cAAc,EAAE;KACtB,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,WAAW,KAAK,OAAO,IAAI,CAAC,CAAC;IACrE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Minimal Bosta v2 HTTP client.
3
+ *
4
+ * Every request goes through `BostaClient.request`, which keeps the transport in one
5
+ * place: tests replace `fetch` with a stub, so the suite makes no live network call and
6
+ * needs no API key.
7
+ */
8
+ import type { BostaConfig } from "./config.js";
9
+ export type HttpMethod = "GET" | "POST";
10
+ export interface RequestInitLike {
11
+ method: string;
12
+ headers: Record<string, string>;
13
+ body?: string;
14
+ signal?: AbortSignal;
15
+ }
16
+ export interface ResponseLike {
17
+ ok: boolean;
18
+ status: number;
19
+ text(): Promise<string>;
20
+ }
21
+ /** The slice of fetch this client needs, so tests can pass a plain function. */
22
+ export type FetchLike = (url: string, init: RequestInitLike) => Promise<ResponseLike>;
23
+ export interface RequestOptions {
24
+ /** Query parameters; undefined values are dropped. */
25
+ query?: Record<string, string | number | boolean | undefined>;
26
+ /** JSON request body. */
27
+ body?: unknown;
28
+ }
29
+ export declare class BostaClient {
30
+ private readonly config;
31
+ private readonly fetchImpl;
32
+ constructor(config: BostaConfig, fetchImpl?: FetchLike);
33
+ /** Send a request and return the parsed JSON body of a successful response. */
34
+ request(method: HttpMethod, path: string, options?: RequestOptions): Promise<unknown>;
35
+ }
package/dist/client.js ADDED
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Minimal Bosta v2 HTTP client.
3
+ *
4
+ * Every request goes through `BostaClient.request`, which keeps the transport in one
5
+ * place: tests replace `fetch` with a stub, so the suite makes no live network call and
6
+ * needs no API key.
7
+ */
8
+ import { McpToolError, codeFromHttpStatus } from "@open-mena-mcp/core";
9
+ function asEnvelope(value) {
10
+ return typeof value === "object" && value !== null ? value : null;
11
+ }
12
+ function parseJson(text) {
13
+ if (text.trim() === "")
14
+ return null;
15
+ try {
16
+ return JSON.parse(text);
17
+ }
18
+ catch {
19
+ return undefined;
20
+ }
21
+ }
22
+ function bostaError(status, payload) {
23
+ const envelope = asEnvelope(payload);
24
+ const message = typeof envelope?.message === "string" && envelope.message !== ""
25
+ ? envelope.message
26
+ : `Bosta API returned HTTP ${String(status)}`;
27
+ const details = { status };
28
+ if (envelope?.errorCode !== undefined)
29
+ details.errorCode = envelope.errorCode;
30
+ return new McpToolError(codeFromHttpStatus(status), message, { status, details });
31
+ }
32
+ export class BostaClient {
33
+ config;
34
+ fetchImpl;
35
+ constructor(config, fetchImpl = fetch) {
36
+ this.config = config;
37
+ this.fetchImpl = fetchImpl;
38
+ }
39
+ /** Send a request and return the parsed JSON body of a successful response. */
40
+ async request(method, path, options = {}) {
41
+ const url = new URL(this.config.baseUrl + path);
42
+ for (const [key, value] of Object.entries(options.query ?? {})) {
43
+ if (value === undefined)
44
+ continue;
45
+ url.searchParams.set(key, String(value));
46
+ }
47
+ const headers = {
48
+ accept: "application/json",
49
+ authorization: this.config.authPrefix + this.config.apiKey,
50
+ };
51
+ const init = {
52
+ method,
53
+ headers,
54
+ signal: AbortSignal.timeout(this.config.timeoutMs),
55
+ };
56
+ if (options.body !== undefined) {
57
+ headers["content-type"] = "application/json";
58
+ init.body = JSON.stringify(options.body);
59
+ }
60
+ let response;
61
+ try {
62
+ response = await this.fetchImpl(url.toString(), init);
63
+ }
64
+ catch (error) {
65
+ const name = error instanceof Error ? error.name : "";
66
+ if (name === "TimeoutError" || name === "AbortError") {
67
+ throw new McpToolError("TIMEOUT", `The Bosta API did not answer within ${String(this.config.timeoutMs)} ms`, { cause: error });
68
+ }
69
+ const reason = error instanceof Error ? error.message : String(error);
70
+ throw new McpToolError("UPSTREAM_ERROR", `Could not reach the Bosta API: ${reason}`, {
71
+ cause: error,
72
+ });
73
+ }
74
+ const payload = parseJson(await response.text());
75
+ if (!response.ok)
76
+ throw bostaError(response.status, payload);
77
+ if (payload === undefined) {
78
+ throw new McpToolError("UPSTREAM_ERROR", "The Bosta API returned a non-JSON response", {
79
+ status: response.status,
80
+ });
81
+ }
82
+ const envelope = asEnvelope(payload);
83
+ if (envelope !== null && envelope.success === false)
84
+ throw bostaError(response.status, payload);
85
+ return payload;
86
+ }
87
+ }
88
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAoCvE,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACpE,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,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AAE,KAAK;aACb,CAAC,CAAC;QACL,CAAC;QAED,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAEjD,IAAI,CAAC,QAAQ,CAAC,EAAE;YAAE,MAAM,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7D,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,YAAY,CAAC,gBAAgB,EAAE,4CAA4C,EAAE;gBACrF,MAAM,EAAE,QAAQ,CAAC,MAAM;aACxB,CAAC,CAAC;QACL,CAAC;QACD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,OAAO,KAAK,KAAK;YAAE,MAAM,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAChG,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Runtime configuration for the Bosta client.
3
+ *
4
+ * The API key is read from the environment only. It is never written to a log, an
5
+ * error message or a tool result: the client sends it in the Authorization header and
6
+ * nothing else in this package touches it.
7
+ */
8
+ /** Bosta v2 base URL. The OpenAPI document lists http, but http redirects (308) to https. */
9
+ export declare const DEFAULT_BASE_URL = "https://app.bosta.co/api/v2";
10
+ export declare const DEFAULT_TIMEOUT_MS = 15000;
11
+ export interface BostaConfig {
12
+ /** Bosta API key, sent verbatim in the Authorization header. */
13
+ apiKey: string;
14
+ /** Base URL without a trailing slash, for example https://app.bosta.co/api/v2 */
15
+ baseUrl: string;
16
+ /** Optional prefix put before the key, for example "Bearer " on accounts that expect it. */
17
+ authPrefix: string;
18
+ /** Per-request timeout in milliseconds. */
19
+ timeoutMs: number;
20
+ }
21
+ /** Read the client configuration from the environment, throwing AUTH_MISSING without a key. */
22
+ export declare function readConfig(env?: Record<string, string | undefined>): BostaConfig;
package/dist/config.js ADDED
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Runtime configuration for the Bosta client.
3
+ *
4
+ * The API key is read from the environment only. It is never written to a log, an
5
+ * error message or a tool result: the client sends it in the Authorization header and
6
+ * nothing else in this package touches it.
7
+ */
8
+ import { McpToolError, requireEnv } from "@open-mena-mcp/core";
9
+ /** Bosta v2 base URL. The OpenAPI document lists http, but http redirects (308) to https. */
10
+ export const DEFAULT_BASE_URL = "https://app.bosta.co/api/v2";
11
+ export const DEFAULT_TIMEOUT_MS = 15_000;
12
+ function readTimeout(raw) {
13
+ if (raw === undefined || raw.trim() === "")
14
+ return DEFAULT_TIMEOUT_MS;
15
+ const parsed = Number.parseInt(raw, 10);
16
+ if (!Number.isFinite(parsed) || parsed <= 0) {
17
+ throw new McpToolError("INVALID_INPUT", "BOSTA_TIMEOUT_MS must be a positive integer");
18
+ }
19
+ return parsed;
20
+ }
21
+ function readBaseUrl(raw) {
22
+ const value = (raw ?? DEFAULT_BASE_URL).trim().replace(/\/+$/u, "");
23
+ if (!/^https?:\/\//u.test(value)) {
24
+ throw new McpToolError("INVALID_INPUT", "BOSTA_BASE_URL must start with http:// or https://");
25
+ }
26
+ return value;
27
+ }
28
+ /** Read the client configuration from the environment, throwing AUTH_MISSING without a key. */
29
+ export function readConfig(env = process.env) {
30
+ const apiKey = requireEnv("BOSTA_API_KEY", env).trim();
31
+ if (apiKey === "") {
32
+ throw new McpToolError("AUTH_MISSING", "BOSTA_API_KEY is set but empty");
33
+ }
34
+ return {
35
+ apiKey,
36
+ baseUrl: readBaseUrl(env.BOSTA_BASE_URL),
37
+ authPrefix: env.BOSTA_AUTH_PREFIX ?? "",
38
+ timeoutMs: readTimeout(env.BOSTA_TIMEOUT_MS),
39
+ };
40
+ }
41
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,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AAC,GAAG,CAAC,cAAc,CAAC;QACxC,UAAU,EAAE,GAAG,CAAC,iBAAiB,IAAI,EAAE;QACvC,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC,gBAAgB,CAAC;KAC7C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./server.js";
2
+ export * from "./client.js";
3
+ export * from "./config.js";
4
+ export * from "./schemas.js";
5
+ export * from "./tools.js";
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ // Library entry: importing this module never starts a server.
2
+ // The stdio bootstrap lives in ./bin.ts and is the only file referenced by "bin".
3
+ export * from "./server.js";
4
+ export * from "./client.js";
5
+ export * from "./config.js";
6
+ export * from "./schemas.js";
7
+ export * from "./tools.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,kFAAkF;AAClF,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Zod input schemas for the Bosta tools.
3
+ *
4
+ * Field names and enums follow the Bosta OpenAPI document
5
+ * (https://docs.bosta.co/api/api.yaml) exactly; the tool-side names are snake_case and
6
+ * mapped to the API's camelCase in `tools.ts`. Every field carries a `.describe()`.
7
+ */
8
+ import { z } from "zod";
9
+ /** Delivery types accepted by POST /deliveries/search. */
10
+ export declare const searchDeliveryTypeSchema: z.ZodEnum<["SEND", "CASH_COLLECTION", "RETURN", "RTO", "EXCHANGE", "CUSTOMER_RETURN_PICKUP"]>;
11
+ /** Delivery types accepted by GET /pricing/shipment/calculator (a different set). */
12
+ export declare const pricingDeliveryTypeSchema: z.ZodEnum<["SEND", "CASH_COLLECTION", "CUSTOMER_RETURN_PICKUP", "EXCHANGE", "SIGN_AND_RETURN"]>;
13
+ export declare const trackDeliverySchema: z.ZodObject<{
14
+ tracking_number: z.ZodString;
15
+ }, "strip", z.ZodTypeAny, {
16
+ tracking_number: string;
17
+ }, {
18
+ tracking_number: string;
19
+ }>;
20
+ export declare const listDeliveriesSchema: z.ZodObject<{
21
+ type: z.ZodOptional<z.ZodEnum<["SEND", "CASH_COLLECTION", "RETURN", "RTO", "EXCHANGE", "CUSTOMER_RETURN_PICKUP"]>>;
22
+ tracking_numbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23
+ mobile_phones: z.ZodOptional<z.ZodString>;
24
+ business_reference: z.ZodOptional<z.ZodString>;
25
+ state_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ type?: "SEND" | "CASH_COLLECTION" | "RETURN" | "RTO" | "EXCHANGE" | "CUSTOMER_RETURN_PICKUP" | undefined;
28
+ tracking_numbers?: string[] | undefined;
29
+ mobile_phones?: string | undefined;
30
+ business_reference?: string | undefined;
31
+ state_codes?: string[] | undefined;
32
+ }, {
33
+ type?: "SEND" | "CASH_COLLECTION" | "RETURN" | "RTO" | "EXCHANGE" | "CUSTOMER_RETURN_PICKUP" | undefined;
34
+ tracking_numbers?: string[] | undefined;
35
+ mobile_phones?: string | undefined;
36
+ business_reference?: string | undefined;
37
+ state_codes?: string[] | undefined;
38
+ }>;
39
+ export declare const listPickupLocationsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
40
+ export declare const calculateDeliveryPricingSchema: z.ZodObject<{
41
+ drop_off_city: z.ZodOptional<z.ZodString>;
42
+ pickup_city: z.ZodOptional<z.ZodString>;
43
+ cod: z.ZodOptional<z.ZodNumber>;
44
+ type: z.ZodOptional<z.ZodEnum<["SEND", "CASH_COLLECTION", "CUSTOMER_RETURN_PICKUP", "EXCHANGE", "SIGN_AND_RETURN"]>>;
45
+ size: z.ZodOptional<z.ZodEnum<["Normal", "Light Bulky", "Heavy Bulky"]>>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ type?: "SEND" | "CASH_COLLECTION" | "EXCHANGE" | "CUSTOMER_RETURN_PICKUP" | "SIGN_AND_RETURN" | undefined;
48
+ drop_off_city?: string | undefined;
49
+ pickup_city?: string | undefined;
50
+ cod?: number | undefined;
51
+ size?: "Normal" | "Light Bulky" | "Heavy Bulky" | undefined;
52
+ }, {
53
+ type?: "SEND" | "CASH_COLLECTION" | "EXCHANGE" | "CUSTOMER_RETURN_PICKUP" | "SIGN_AND_RETURN" | undefined;
54
+ drop_off_city?: string | undefined;
55
+ pickup_city?: string | undefined;
56
+ cod?: number | undefined;
57
+ size?: "Normal" | "Light Bulky" | "Heavy Bulky" | undefined;
58
+ }>;
59
+ export type TrackDeliveryInput = z.infer<typeof trackDeliverySchema>;
60
+ export type ListDeliveriesInput = z.infer<typeof listDeliveriesSchema>;
61
+ export type CalculateDeliveryPricingInput = z.infer<typeof calculateDeliveryPricingSchema>;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Zod input schemas for the Bosta tools.
3
+ *
4
+ * Field names and enums follow the Bosta OpenAPI document
5
+ * (https://docs.bosta.co/api/api.yaml) exactly; the tool-side names are snake_case and
6
+ * mapped to the API's camelCase in `tools.ts`. Every field carries a `.describe()`.
7
+ */
8
+ import { z } from "zod";
9
+ /** Delivery types accepted by POST /deliveries/search. */
10
+ export const searchDeliveryTypeSchema = z
11
+ .enum(["SEND", "CASH_COLLECTION", "RETURN", "RTO", "EXCHANGE", "CUSTOMER_RETURN_PICKUP"])
12
+ .describe("Delivery type to filter by: SEND, CASH_COLLECTION, RETURN, RTO, EXCHANGE or CUSTOMER_RETURN_PICKUP.");
13
+ /** Delivery types accepted by GET /pricing/shipment/calculator (a different set). */
14
+ export const pricingDeliveryTypeSchema = z
15
+ .enum(["SEND", "CASH_COLLECTION", "CUSTOMER_RETURN_PICKUP", "EXCHANGE", "SIGN_AND_RETURN"])
16
+ .describe("Delivery type for the estimate: SEND, CASH_COLLECTION, CUSTOMER_RETURN_PICKUP, EXCHANGE or SIGN_AND_RETURN. The pricing endpoint does not accept RETURN or RTO.");
17
+ export const trackDeliverySchema = z.object({
18
+ tracking_number: z
19
+ .string()
20
+ .min(1)
21
+ .max(64)
22
+ .regex(/^[A-Za-z0-9_-]+$/u, "Tracking numbers are letters, digits, hyphens or underscores")
23
+ .describe('Bosta tracking number of the delivery to look up, for example "5108002". This is the customer-facing tracking number, not the internal delivery id.'),
24
+ });
25
+ export const listDeliveriesSchema = z.object({
26
+ type: searchDeliveryTypeSchema.optional(),
27
+ tracking_numbers: z
28
+ .array(z.string().min(1))
29
+ .min(1)
30
+ .max(50)
31
+ .optional()
32
+ .describe("Tracking numbers to search for. The OpenAPI document declares trackingNumbers as an array of strings, so pass a list; at least one filter is required."),
33
+ mobile_phones: z
34
+ .string()
35
+ .min(1)
36
+ .optional()
37
+ .describe("Customer phone number to search for. The OpenAPI document declares mobilePhones as a single string, so pass one number per call."),
38
+ business_reference: z
39
+ .string()
40
+ .min(1)
41
+ .optional()
42
+ .describe("Your own order reference (businessReference) to search for."),
43
+ state_codes: z
44
+ .array(z.string().min(1))
45
+ .min(1)
46
+ .max(20)
47
+ .optional()
48
+ .describe('Delivery state codes to filter by, for example ["10","40"]. Codes come from Bosta delivery states, not from this server.'),
49
+ });
50
+ export const listPickupLocationsSchema = z.object({});
51
+ export const calculateDeliveryPricingSchema = z.object({
52
+ drop_off_city: z
53
+ .string()
54
+ .min(1)
55
+ .optional()
56
+ .describe('City the order is delivered to, as a city name such as "Cairo".'),
57
+ pickup_city: z
58
+ .string()
59
+ .min(1)
60
+ .optional()
61
+ .describe('City the order is picked up from, as a city name such as "Cairo".'),
62
+ cod: z
63
+ .number()
64
+ .min(0)
65
+ .optional()
66
+ .describe("Cash-on-delivery amount in EGP, which changes the fee. Use 0 when there is no collection."),
67
+ type: pricingDeliveryTypeSchema.optional(),
68
+ size: z
69
+ .enum(["Normal", "Light Bulky", "Heavy Bulky"])
70
+ .optional()
71
+ .describe("Shipment size used for the estimate. The pricing endpoint documents Normal, Light Bulky and Heavy Bulky."),
72
+ });
73
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0DAA0D;AAC1D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,IAAI,CAAC,CAAC,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,wBAAwB,CAAC,CAAC;KACxF,QAAQ,CACP,qGAAqG,CACtG,CAAC;AAEJ,qFAAqF;AACrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,IAAI,CAAC,CAAC,MAAM,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC;KAC1F,QAAQ,CACP,iKAAiK,CAClK,CAAC;AAEJ,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,KAAK,CAAC,mBAAmB,EAAE,8DAA8D,CAAC;SAC1F,QAAQ,CACP,qJAAqJ,CACtJ;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IACzC,gBAAgB,EAAE,CAAC;SAChB,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACxB,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,QAAQ,CACP,wJAAwJ,CAC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for @open-mena-mcp/bosta.
3
+ *
4
+ * All four tools are read-only calls against the Bosta v2 API. The client is created on
5
+ * first use so the server can start and list its tools even when BOSTA_API_KEY is
6
+ * missing; a call made without a key returns an AUTH_MISSING error result instead.
7
+ */
8
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
9
+ import { BostaClient } from "./client.js";
10
+ export declare const SERVER_NAME = "@open-mena-mcp/bosta";
11
+ export declare const SERVER_VERSION = "0.1.0";
12
+ export declare const SERVER_INSTRUCTIONS: string;
13
+ export interface ServerOptions {
14
+ /** Pre-built client, for tests. Defaults to one built from the environment on first use. */
15
+ client?: BostaClient;
16
+ }
17
+ export declare function createServer(options?: ServerOptions): McpServer;
18
+ /** Where the client will send requests, for logs and diagnostics. Never includes the key. */
19
+ export declare function describeTarget(env?: Record<string, string | undefined>): string;
package/dist/server.js ADDED
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Tool registration for @open-mena-mcp/bosta.
3
+ *
4
+ * All four tools are read-only calls against the Bosta v2 API. The client is created on
5
+ * first use so the server can start and list its tools even when BOSTA_API_KEY is
6
+ * missing; a call made without a key returns an AUTH_MISSING error result instead.
7
+ */
8
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
9
+ import { BostaClient } from "./client.js";
10
+ import { DEFAULT_BASE_URL, readConfig } from "./config.js";
11
+ import { calculateDeliveryPricingSchema, listDeliveriesSchema, listPickupLocationsSchema, trackDeliverySchema, } from "./schemas.js";
12
+ import { calculateDeliveryPricing, listDeliveries, listPickupLocations, trackDelivery, } from "./tools.js";
13
+ import { defineTool } from "./toolkit.js";
14
+ export const SERVER_NAME = "@open-mena-mcp/bosta";
15
+ export const SERVER_VERSION = "0.1.0";
16
+ export const SERVER_INSTRUCTIONS = "Bosta (Egyptian shipping) read tools: track_delivery looks up one delivery by tracking " +
17
+ "number, list_deliveries searches deliveries by type, tracking numbers, phone, business " +
18
+ "reference or state codes, list_pickup_locations returns the business pickup locations, " +
19
+ "and calculate_delivery_pricing estimates a shipping fee. Every call needs a Bosta API " +
20
+ "key in the BOSTA_API_KEY environment variable. All four tools are read-only.";
21
+ const READ_ONLY = { readOnlyHint: true, idempotentHint: true, openWorldHint: true };
22
+ export function createServer(options = {}) {
23
+ let cached = options.client;
24
+ const getClient = () => {
25
+ cached ??= new BostaClient(readConfig());
26
+ return cached;
27
+ };
28
+ const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION }, { instructions: SERVER_INSTRUCTIONS });
29
+ server.registerTool("track_delivery", {
30
+ title: "Track a Bosta delivery",
31
+ description: "Look up one Bosta delivery by its tracking number (GET /deliveries/business/{trackingNumber}). Returns the Bosta response envelope unchanged: current state, masked state, addresses, receiver, COD amount, package specs and timestamps. Read-only; needs BOSTA_API_KEY.",
32
+ inputSchema: trackDeliverySchema.shape,
33
+ annotations: READ_ONLY,
34
+ }, defineTool(trackDeliverySchema, (input) => trackDelivery(getClient(), input)));
35
+ server.registerTool("list_deliveries", {
36
+ title: "Search Bosta deliveries",
37
+ description: "Search the business's deliveries (POST /deliveries/search) by type, tracking numbers, customer phone, business reference or state codes. At least one filter is required. The Bosta document defines no pagination parameters for this endpoint, so results come back as the API sends them. Read-only; needs BOSTA_API_KEY.",
38
+ inputSchema: listDeliveriesSchema.shape,
39
+ annotations: READ_ONLY,
40
+ }, defineTool(listDeliveriesSchema, (input) => listDeliveries(getClient(), input)));
41
+ server.registerTool("list_pickup_locations", {
42
+ title: "List Bosta pickup locations",
43
+ description: "List the business's pickup locations (GET /pickup-locations), the addresses Bosta collects from and returns to. Each location's _id is the businessLocationId used when creating deliveries. The response includes page, limit and pages fields; the document defines no query parameters for this endpoint. Read-only; needs BOSTA_API_KEY.",
44
+ inputSchema: listPickupLocationsSchema.shape,
45
+ annotations: READ_ONLY,
46
+ }, defineTool(listPickupLocationsSchema, () => listPickupLocations(getClient())));
47
+ server.registerTool("calculate_delivery_pricing", {
48
+ title: "Estimate a Bosta shipping fee",
49
+ description: "Estimate a shipping fee (GET /pricing/shipment/calculator) from pickup city, drop-off city, COD amount, delivery type and size. The document marks every parameter optional and documents no response schema, so pass what you know and read the fee from the response. Read-only; needs BOSTA_API_KEY.",
50
+ inputSchema: calculateDeliveryPricingSchema.shape,
51
+ annotations: READ_ONLY,
52
+ }, defineTool(calculateDeliveryPricingSchema, (input) => calculateDeliveryPricing(getClient(), input)));
53
+ return server;
54
+ }
55
+ /** Where the client will send requests, for logs and diagnostics. Never includes the key. */
56
+ export function describeTarget(env = process.env) {
57
+ return (env.BOSTA_BASE_URL ?? DEFAULT_BASE_URL).trim().replace(/\/+$/u, "");
58
+ }
59
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,8BAA8B,EAC9B,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACnB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,CAAC,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAClD,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,MAAM,CAAC,MAAM,mBAAmB,GAC9B,yFAAyF;IACzF,yFAAyF;IACzF,yFAAyF;IACzF,wFAAwF;IACxF,8EAA8E,CAAC;AAOjF,MAAM,SAAS,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAW,CAAC;AAE7F,MAAM,UAAU,Y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B,4BAA4B,EAC5B;QACE,KAAK,EAAE,+BAA+B;QACtC,WAAW,EACT,ySAAyS;QAC3S,WAAW,EAAE,8BAA8B,CAAC,KAAK;QACjD,WAAW,EAAE,SAAS;KACvB,EACD,UAAU,CAAC,8BAA8B,EAAE,CAAC,KAAK,EAAE,EAAE,CACnD,wBAAwB,CAAC,SAAS,EAAE,EAAE,KAAK,CAAC,CAC7C,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,cAAc,CAAC,MAA0C,OAAO,CAAC,GAAG;IAClF,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Glue between @open-mena-mcp/core and the MCP SDK: validate input with Zod, turn
3
+ * thrown errors into MCP error results, and shape the reply the way the SDK expects.
4
+ */
5
+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
6
+ import { type ToolResult } from "@open-mena-mcp/core";
7
+ import type { z } from "zod";
8
+ /** Adapt a core ToolResult to the SDK's CallToolResult shape. */
9
+ export declare function toCallToolResult(result: ToolResult): CallToolResult;
10
+ /**
11
+ * Build an MCP tool handler from a Zod object schema and a function.
12
+ * Input is parsed against the schema, so a handler always receives typed, validated data.
13
+ */
14
+ export declare function defineTool<S extends z.ZodTypeAny>(schema: S, run: (input: z.infer<S>) => unknown): (raw: unknown) => Promise<CallToolResult>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Glue between @open-mena-mcp/core and the MCP SDK: validate input with Zod, turn
3
+ * thrown errors into MCP error results, and shape the reply the way the SDK expects.
4
+ */
5
+ import { parseInput, wrapTool } from "@open-mena-mcp/core";
6
+ /** Adapt a core ToolResult to the SDK's CallToolResult shape. */
7
+ export function toCallToolResult(result) {
8
+ const content = result.content.map((entry) => ({ type: "text", text: entry.text }));
9
+ return result.isError === true ? { isError: true, content } : { content };
10
+ }
11
+ /**
12
+ * Build an MCP tool handler from a Zod object schema and a function.
13
+ * Input is parsed against the schema, so a handler always receives typed, validated data.
14
+ */
15
+ export function defineTool(schema, run) {
16
+ const wrapped = wrapTool((raw) => run(parseInput(schema, raw)));
17
+ return async (raw) => toCallToolResult(await wrapped(raw));
18
+ }
19
+ //# sourceMappingURL=toolkit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolkit.js","sourceRoot":"","sources":["../src/toolkit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAmB,MAAM,qBAAqB,CAAC;AAG5E,iEAAiE;AACjE,MAAM,UAAU,gBAAgB,CAAC,MAAkB;IACjD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7F,OAAO,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;AAC5E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,MAAS,EACT,GAAmC;IAEnC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,GAAY,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACzE,OAAO,KAAK,EAAE,GAAY,EAA2B,EAAE,CAAC,gBAAgB,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/F,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The four Bosta read tools, as plain functions over a client.
3
+ *
4
+ * Each one calls exactly the path and method documented in the Bosta OpenAPI document
5
+ * (https://docs.bosta.co/api/api.yaml). Responses are returned as Bosta sends them: the
6
+ * `{ success, message, data }` envelope is not reshaped, so nothing is hidden from the
7
+ * client. Where the document is ambiguous, the ambiguity is written down in the tool
8
+ * description and in the README instead of being guessed away.
9
+ */
10
+ import type { BostaClient } from "./client.js";
11
+ import type { CalculateDeliveryPricingInput, ListDeliveriesInput, TrackDeliveryInput } from "./schemas.js";
12
+ /** GET /deliveries/business/{trackingNumber} */
13
+ export declare function trackDelivery(client: BostaClient, input: TrackDeliveryInput): Promise<unknown>;
14
+ /** POST /deliveries/search */
15
+ export declare function listDeliveries(client: BostaClient, input: ListDeliveriesInput): Promise<unknown>;
16
+ /** GET /pickup-locations */
17
+ export declare function listPickupLocations(client: BostaClient): Promise<unknown>;
18
+ /** GET /pricing/shipment/calculator */
19
+ export declare function calculateDeliveryPricing(client: BostaClient, input: CalculateDeliveryPricingInput): Promise<unknown>;
package/dist/tools.js ADDED
@@ -0,0 +1,52 @@
1
+ /**
2
+ * The four Bosta read tools, as plain functions over a client.
3
+ *
4
+ * Each one calls exactly the path and method documented in the Bosta OpenAPI document
5
+ * (https://docs.bosta.co/api/api.yaml). Responses are returned as Bosta sends them: the
6
+ * `{ success, message, data }` envelope is not reshaped, so nothing is hidden from the
7
+ * client. Where the document is ambiguous, the ambiguity is written down in the tool
8
+ * description and in the README instead of being guessed away.
9
+ */
10
+ import { McpToolError } from "@open-mena-mcp/core";
11
+ /** GET /deliveries/business/{trackingNumber} */
12
+ export async function trackDelivery(client, input) {
13
+ const trackingNumber = input.tracking_number.trim();
14
+ return client.request("GET", `/deliveries/business/${encodeURIComponent(trackingNumber)}`);
15
+ }
16
+ /** POST /deliveries/search */
17
+ export async function listDeliveries(client, input) {
18
+ const body = {};
19
+ if (input.type !== undefined)
20
+ body.type = input.type;
21
+ if (input.tracking_numbers !== undefined)
22
+ body.trackingNumbers = input.tracking_numbers;
23
+ if (input.mobile_phones !== undefined)
24
+ body.mobilePhones = input.mobile_phones;
25
+ if (input.business_reference !== undefined)
26
+ body.businessReference = input.business_reference;
27
+ if (input.state_codes !== undefined)
28
+ body.stateCodes = input.state_codes;
29
+ if (Object.keys(body).length === 0) {
30
+ throw new McpToolError("INVALID_INPUT", "Provide at least one search filter: type, tracking_numbers, mobile_phones, business_reference or state_codes");
31
+ }
32
+ return client.request("POST", "/deliveries/search", { body });
33
+ }
34
+ /** GET /pickup-locations */
35
+ export async function listPickupLocations(client) {
36
+ return client.request("GET", "/pickup-locations");
37
+ }
38
+ /** GET /pricing/shipment/calculator */
39
+ export async function calculateDeliveryPricing(client, input) {
40
+ const query = {
41
+ dropOffCity: input.drop_off_city,
42
+ pickupCity: input.pickup_city,
43
+ cod: input.cod,
44
+ type: input.type,
45
+ size: input.size,
46
+ };
47
+ if (Object.values(query).every((value) => value === undefined)) {
48
+ throw new McpToolError("INVALID_INPUT", "Provide at least one parameter: drop_off_city, pickup_city, cod, type or size");
49
+ }
50
+ return client.request("GET", "/pricing/shipment/calculator", { query });
51
+ }
52
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASnD,gDAAgD;AAChD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAmB,EACnB,KAAyB;IAEzB,MAAM,cAAc,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IACpD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,wBAAwB,kBAAkB,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;AAC7F,CAAC;AAED,8BAA8B;AAC9B,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAmB,EACnB,KAA0B;IAE1B,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,IAAI,KAAK,CAAC,IAAI,KAA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AAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE,CAAC;QAC/D,MAAM,IAAI,YAAY,CACpB,eAAe,EACf,+EAA+E,CAChF,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,8BAA8B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "@open-mena-mcp/bosta",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "MCP server for the Bosta v2 logistics API: track a delivery, search deliveries, list pickup locations and estimate shipping fees.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "bin": {
10
+ "mcp-bosta": "./dist/bin.js"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "LICENSE",
15
+ "README.md"
16
+ ],
17
+ "engines": {
18
+ "node": ">=20"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/Dinaelsayed99/open-mena-mcp.git",
23
+ "directory": "packages/mcp-bosta"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "dependencies": {
29
+ "@modelcontextprotocol/sdk": "^1.12.0",
30
+ "zod": "^3.25.0",
31
+ "@open-mena-mcp/core": "0.1.0"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^22.7.4",
35
+ "typescript": "^5.6.3",
36
+ "vitest": "^4.1.12"
37
+ },
38
+ "homepage": "https://github.com/Dinaelsayed99/open-mena-mcp/tree/main/packages/mcp-bosta#readme",
39
+ "bugs": {
40
+ "url": "https://github.com/Dinaelsayed99/open-mena-mcp/issues"
41
+ },
42
+ "exports": {
43
+ ".": {
44
+ "types": "./dist/index.d.ts",
45
+ "import": "./dist/index.js"
46
+ }
47
+ },
48
+ "scripts": {
49
+ "build": "tsc -p tsconfig.build.json",
50
+ "typecheck": "tsc --noEmit -p tsconfig.json",
51
+ "lint": "eslint src",
52
+ "test": "vitest run",
53
+ "start": "node dist/index.js"
54
+ }
6
55
  }