@open-mena-mcp/aladhan 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 +21 -0
- package/README.md +69 -2
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +16 -0
- package/dist/bin.js.map +1 -0
- package/dist/client.d.ts +21 -0
- package/dist/client.js +60 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +97 -0
- package/dist/server.js +161 -0
- package/dist/server.js.map +1 -0
- package/package.json +52 -3
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,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @open-mena-mcp/aladhan
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MCP server for the [AlAdhan API](https://aladhan.com/prayer-times-api): daily prayer times, Hijri/Gregorian date conversion and Qibla direction. Runs over stdio with the official `@modelcontextprotocol/sdk`, built on `@open-mena-mcp/core` (shared errors, rate limiter, logger) with Zod input schemas. No API key required.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Description | AlAdhan endpoint | Doc source |
|
|
8
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- |
|
|
9
|
+
| `get_prayer_times_by_city` | All daily prayer times for a city + country, with Hijri/Gregorian dates and calculation metadata | `GET /timingsByCity/{date}` (query: `city`_, `country`_, `state`, `method`, `school`, `timezonestring`, `iso8601`) | https://aladhan.com/prayer-times-api |
|
|
10
|
+
| `get_prayer_times_by_coords` | All daily prayer times for a latitude/longitude pair | `GET /timings/{date}` (query: `latitude`_, `longitude`_, `method`, `school`, `timezonestring`, `iso8601`) | https://aladhan.com/prayer-times-api |
|
|
11
|
+
| `convert_date_hijri_gregorian` | Convert a date between Gregorian and Hijri calendars | `GET /gToH/{date}` and `GET /hToG/{date}` (query: `calendarMethod`, `adjustment`) | https://aladhan.com/islamic-calendar-api |
|
|
12
|
+
| `get_qibla_direction` | Qibla direction in degrees clockwise from true north | `GET /qibla/{latitude}/{longitude}` | https://aladhan.com/qibla-api |
|
|
13
|
+
|
|
14
|
+
`*` = required by the API. Base URL: `https://api.aladhan.com/v1`.
|
|
15
|
+
|
|
16
|
+
Every endpoint, query parameter, response shape and error shape above was verified against the official OpenAPI 3.1 specs served by AlAdhan before writing code:
|
|
17
|
+
|
|
18
|
+
- Prayer Times: https://api.aladhan.com/v1/documentation/openapi/prayer-times/yaml (behind https://aladhan.com/prayer-times-api)
|
|
19
|
+
- Qibla: https://api.aladhan.com/v1/documentation/openapi/qibla/yaml (behind https://aladhan.com/qibla-api)
|
|
20
|
+
- Islamic Calendar: https://api.aladhan.com/v1/documentation/openapi/islamic-calendar/yaml (behind https://aladhan.com/islamic-calendar-api)
|
|
21
|
+
- Calculation method ids (0-23 and 99) are enumerated in the prayer-times spec; details per method: https://aladhan.com/calculation-methods
|
|
22
|
+
|
|
23
|
+
Shapes relied on (all confirmed live against the API on 2026-12-05):
|
|
24
|
+
|
|
25
|
+
- Success envelope: `{ "code": 200, "status": "OK", "data": ... }`. Timings `data` carries `timings` (Fajr, Sunrise, Dhuhr, Asr, Sunset, Maghrib, Isha, Imsak, Midnight, Firstthird, Lastthird), `date` (hijri + gregorian) and `meta`. Qibla `data` is `{ latitude, longitude, direction }`. Conversion `data` is `{ hijri, gregorian }`.
|
|
26
|
+
- Error envelope: `{ "code": 400, "status": "BAD_REQUEST", "data": "<message>" }` and `{ "code": 404, "status": "NOT FOUND", "data": "<message>" }`. The client maps these onto `@open-mena-mcp/core` error codes (400 -> INVALID_INPUT, 404 -> NOT_FOUND, etc.).
|
|
27
|
+
|
|
28
|
+
## Run
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm install
|
|
32
|
+
pnpm build
|
|
33
|
+
node packages/mcp-aladhan/dist/bin.js
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Claude Desktop config:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"aladhan": {
|
|
42
|
+
"command": "node",
|
|
43
|
+
"args": ["/absolute/path/to/open-mena-mcp/packages/mcp-aladhan/dist/bin.js"]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Once published to npm: `npx @open-mena-mcp/aladhan` works as the command instead.
|
|
50
|
+
|
|
51
|
+
## Develop
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pnpm --filter @open-mena-mcp/aladhan build
|
|
55
|
+
pnpm --filter @open-mena-mcp/aladhan typecheck
|
|
56
|
+
pnpm --filter @open-mena-mcp/aladhan lint
|
|
57
|
+
pnpm --filter @open-mena-mcp/aladhan test
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Tests are vitest with an injected fetch mock. **Zero live network calls** - the suite never touches api.aladhan.com; URL construction, envelope unwrapping, error mapping, the rate limiter and all four tool handlers are tested against recorded envelopes.
|
|
61
|
+
|
|
62
|
+
## Notes
|
|
63
|
+
|
|
64
|
+
- Dates use the API's `DD-MM-YYYY` format; the `date` parameter defaults to today (UTC).
|
|
65
|
+
- `method` accepts 0-23 or 99 (custom). Common: 2 ISNA, 3 Muslim World League, 4 Umm Al-Qura, 5 Egyptian General Authority of Survey. Omit it to let the API pick the closest authority for the location.
|
|
66
|
+
- A polite local token-bucket rate limiter (from `@open-mena-mcp/core`) guards outbound calls.
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT
|
package/dist/bin.d.ts
ADDED
package/dist/bin.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { createLogger } from "@open-mena-mcp/core";
|
|
4
|
+
import { createServer } from "./server.js";
|
|
5
|
+
async function main() {
|
|
6
|
+
const logger = createLogger({ name: "aladhan" });
|
|
7
|
+
const server = createServer();
|
|
8
|
+
const transport = new StdioServerTransport();
|
|
9
|
+
await server.connect(transport);
|
|
10
|
+
logger.info("MCP server running on stdio");
|
|
11
|
+
}
|
|
12
|
+
main().catch((error) => {
|
|
13
|
+
console.error(error);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AAC7C,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RateLimiter } from "@open-mena-mcp/core";
|
|
2
|
+
/** Base URL of the AlAdhan API v1, per https://aladhan.com/prayer-times-api */
|
|
3
|
+
export declare const ALADHAN_BASE_URL = "https://api.aladhan.com/v1";
|
|
4
|
+
export interface AladhanClientOptions {
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
limiter?: RateLimiter;
|
|
7
|
+
/** Injectable fetch so tests can mock HTTP without any network. */
|
|
8
|
+
fetchImpl?: typeof fetch;
|
|
9
|
+
}
|
|
10
|
+
/** Minimal HTTP client for the AlAdhan API with a polite local rate limit. */
|
|
11
|
+
export declare class AladhanClient {
|
|
12
|
+
private readonly baseUrl;
|
|
13
|
+
private readonly limiter;
|
|
14
|
+
private readonly fetchImpl;
|
|
15
|
+
constructor(options?: AladhanClientOptions);
|
|
16
|
+
/**
|
|
17
|
+
* GET {baseUrl}{path}?{params} and unwrap the data field of the envelope.
|
|
18
|
+
* Throws McpToolError on HTTP errors and on non-200 envelope codes.
|
|
19
|
+
*/
|
|
20
|
+
get(path: string, params?: Record<string, string>): Promise<unknown>;
|
|
21
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { McpToolError, RateLimiter, codeFromHttpStatus } from "@open-mena-mcp/core";
|
|
2
|
+
/** Base URL of the AlAdhan API v1, per https://aladhan.com/prayer-times-api */
|
|
3
|
+
export const ALADHAN_BASE_URL = "https://api.aladhan.com/v1";
|
|
4
|
+
function asEnvelope(body) {
|
|
5
|
+
if (typeof body !== "object" || body === null)
|
|
6
|
+
return undefined;
|
|
7
|
+
const candidate = body;
|
|
8
|
+
if (typeof candidate.code !== "number" || typeof candidate.status !== "string") {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return body;
|
|
12
|
+
}
|
|
13
|
+
function apiErrorMessage(body, fallback) {
|
|
14
|
+
const envelope = asEnvelope(body);
|
|
15
|
+
if (envelope !== undefined && typeof envelope.data === "string") {
|
|
16
|
+
return envelope.data;
|
|
17
|
+
}
|
|
18
|
+
return fallback;
|
|
19
|
+
}
|
|
20
|
+
/** Minimal HTTP client for the AlAdhan API with a polite local rate limit. */
|
|
21
|
+
export class AladhanClient {
|
|
22
|
+
baseUrl;
|
|
23
|
+
limiter;
|
|
24
|
+
fetchImpl;
|
|
25
|
+
constructor(options = {}) {
|
|
26
|
+
this.baseUrl = options.baseUrl ?? ALADHAN_BASE_URL;
|
|
27
|
+
this.limiter = options.limiter ?? new RateLimiter({ capacity: 10, refillPerSecond: 2 });
|
|
28
|
+
this.fetchImpl = options.fetchImpl ?? fetch;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* GET {baseUrl}{path}?{params} and unwrap the data field of the envelope.
|
|
32
|
+
* Throws McpToolError on HTTP errors and on non-200 envelope codes.
|
|
33
|
+
*/
|
|
34
|
+
async get(path, params = {}) {
|
|
35
|
+
if (!this.limiter.tryAcquire()) {
|
|
36
|
+
throw new McpToolError("RATE_LIMITED", "Local rate limit reached; retry in a moment.");
|
|
37
|
+
}
|
|
38
|
+
const query = new URLSearchParams(params).toString();
|
|
39
|
+
const url = this.baseUrl + path + (query.length > 0 ? "?" + query : "");
|
|
40
|
+
const response = await this.fetchImpl(url, { headers: { accept: "application/json" } });
|
|
41
|
+
const body = await response.json().catch(() => undefined);
|
|
42
|
+
if (!response.ok) {
|
|
43
|
+
throw new McpToolError(codeFromHttpStatus(response.status), apiErrorMessage(body, "AlAdhan API responded with HTTP " + String(response.status)), { status: response.status, details: body });
|
|
44
|
+
}
|
|
45
|
+
const envelope = asEnvelope(body);
|
|
46
|
+
if (envelope === undefined) {
|
|
47
|
+
throw new McpToolError("UPSTREAM_ERROR", "Unexpected response shape from the AlAdhan API", {
|
|
48
|
+
details: body,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (envelope.code !== 200) {
|
|
52
|
+
throw new McpToolError("UPSTREAM_ERROR", apiErrorMessage(body, "AlAdhan API error"), {
|
|
53
|
+
status: envelope.code,
|
|
54
|
+
details: body,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return envelope.data;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEpF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,4BAA4B,CAAC;AAgB7D,SAAS,UAAU,CAAC,IAAa;IA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AAC;IACvB,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -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"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { AladhanClient } from "./client.js";
|
|
4
|
+
export declare const GetPrayerTimesByCityInputSchema: z.ZodObject<{
|
|
5
|
+
city: z.ZodString;
|
|
6
|
+
country: z.ZodString;
|
|
7
|
+
state: z.ZodOptional<z.ZodString>;
|
|
8
|
+
date: z.ZodOptional<z.ZodString>;
|
|
9
|
+
method: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
10
|
+
school: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
timezonestring: z.ZodOptional<z.ZodString>;
|
|
12
|
+
iso8601: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
city: string;
|
|
15
|
+
country: string;
|
|
16
|
+
state?: string | undefined;
|
|
17
|
+
date?: string | undefined;
|
|
18
|
+
method?: number | undefined;
|
|
19
|
+
school?: number | undefined;
|
|
20
|
+
timezonestring?: string | undefined;
|
|
21
|
+
iso8601?: boolean | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
city: string;
|
|
24
|
+
country: string;
|
|
25
|
+
state?: string | undefined;
|
|
26
|
+
date?: string | undefined;
|
|
27
|
+
method?: number | undefined;
|
|
28
|
+
school?: number | undefined;
|
|
29
|
+
timezonestring?: string | undefined;
|
|
30
|
+
iso8601?: boolean | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
export type GetPrayerTimesByCityInput = z.infer<typeof GetPrayerTimesByCityInputSchema>;
|
|
33
|
+
export declare const GetPrayerTimesByCoordsInputSchema: z.ZodObject<{
|
|
34
|
+
latitude: z.ZodNumber;
|
|
35
|
+
longitude: z.ZodNumber;
|
|
36
|
+
date: z.ZodOptional<z.ZodString>;
|
|
37
|
+
method: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
38
|
+
school: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
timezonestring: z.ZodOptional<z.ZodString>;
|
|
40
|
+
iso8601: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
latitude: number;
|
|
43
|
+
longitude: number;
|
|
44
|
+
date?: string | undefined;
|
|
45
|
+
method?: number | undefined;
|
|
46
|
+
school?: number | undefined;
|
|
47
|
+
timezonestring?: string | undefined;
|
|
48
|
+
iso8601?: boolean | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
latitude: number;
|
|
51
|
+
longitude: number;
|
|
52
|
+
date?: string | undefined;
|
|
53
|
+
method?: number | undefined;
|
|
54
|
+
school?: number | undefined;
|
|
55
|
+
timezonestring?: string | undefined;
|
|
56
|
+
iso8601?: boolean | undefined;
|
|
57
|
+
}>;
|
|
58
|
+
export type GetPrayerTimesByCoordsInput = z.infer<typeof GetPrayerTimesByCoordsInputSchema>;
|
|
59
|
+
export declare const ConvertDateInputSchema: z.ZodObject<{
|
|
60
|
+
date: z.ZodString;
|
|
61
|
+
direction: z.ZodEnum<["gregorian_to_hijri", "hijri_to_gregorian"]>;
|
|
62
|
+
calendarMethod: z.ZodOptional<z.ZodEnum<["HJCoSA", "UAQ", "DIYANET", "MATHEMATICAL"]>>;
|
|
63
|
+
adjustment: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
date: string;
|
|
66
|
+
direction: "gregorian_to_hijri" | "hijri_to_gregorian";
|
|
67
|
+
calendarMethod?: "HJCoSA" | "UAQ" | "DIYANET" | "MATHEMATICAL" | undefined;
|
|
68
|
+
adjustment?: number | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
date: string;
|
|
71
|
+
direction: "gregorian_to_hijri" | "hijri_to_gregorian";
|
|
72
|
+
calendarMethod?: "HJCoSA" | "UAQ" | "DIYANET" | "MATHEMATICAL" | undefined;
|
|
73
|
+
adjustment?: number | undefined;
|
|
74
|
+
}>;
|
|
75
|
+
export type ConvertDateInput = z.infer<typeof ConvertDateInputSchema>;
|
|
76
|
+
export declare const GetQiblaDirectionInputSchema: z.ZodObject<{
|
|
77
|
+
latitude: z.ZodNumber;
|
|
78
|
+
longitude: z.ZodNumber;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
latitude: number;
|
|
81
|
+
longitude: number;
|
|
82
|
+
}, {
|
|
83
|
+
latitude: number;
|
|
84
|
+
longitude: number;
|
|
85
|
+
}>;
|
|
86
|
+
export type GetQiblaDirectionInput = z.infer<typeof GetQiblaDirectionInputSchema>;
|
|
87
|
+
/** Today's date in UTC, formatted DD-MM-YYYY as the API requires. Exported for tests. */
|
|
88
|
+
export declare function todayDDMMYYYY(now?: Date): string;
|
|
89
|
+
/** GET /timingsByCity/{date} - verified against the Prayer Times API spec. */
|
|
90
|
+
export declare function getPrayerTimesByCity(client: AladhanClient, input: GetPrayerTimesByCityInput): Promise<unknown>;
|
|
91
|
+
/** GET /timings/{date} - verified against the Prayer Times API spec. */
|
|
92
|
+
export declare function getPrayerTimesByCoords(client: AladhanClient, input: GetPrayerTimesByCoordsInput): Promise<unknown>;
|
|
93
|
+
/** GET /gToH/{date} or /hToG/{date} - verified against the Islamic Calendar API spec. */
|
|
94
|
+
export declare function convertDateHijriGregorian(client: AladhanClient, input: ConvertDateInput): Promise<unknown>;
|
|
95
|
+
/** GET /qibla/{latitude}/{longitude} - verified against the Qibla Direction API spec. */
|
|
96
|
+
export declare function getQiblaDirection(client: AladhanClient, input: GetQiblaDirectionInput): Promise<unknown>;
|
|
97
|
+
export declare function createServer(client?: AladhanClient): McpServer;
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { wrapTool } from "@open-mena-mcp/core";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { AladhanClient } from "./client.js";
|
|
5
|
+
const DATE_PATTERN = /^\d{2}-\d{2}-\d{4}$/;
|
|
6
|
+
const dateField = z
|
|
7
|
+
.string()
|
|
8
|
+
.regex(DATE_PATTERN, "Expected DD-MM-YYYY")
|
|
9
|
+
.describe("Date in DD-MM-YYYY format (the format the AlAdhan API requires). Defaults to today (UTC).");
|
|
10
|
+
const methodField = z
|
|
11
|
+
.number()
|
|
12
|
+
.int()
|
|
13
|
+
.refine((v) => v === 99 || (v >= 0 && v <= 23), {
|
|
14
|
+
message: "method must be 0-23 or 99 (custom)",
|
|
15
|
+
})
|
|
16
|
+
.describe("Prayer time calculation method id (0-23 or 99=custom). Common values: 2 = ISNA, 3 = Muslim World League, 4 = Umm Al-Qura Makkah, 5 = Egyptian General Authority of Survey. Full list: https://aladhan.com/calculation-methods. Omit to use the closest authority for the location.");
|
|
17
|
+
const schoolField = z
|
|
18
|
+
.number()
|
|
19
|
+
.int()
|
|
20
|
+
.min(0)
|
|
21
|
+
.max(1)
|
|
22
|
+
.describe("Juristic school for Asr calculation: 0 = Shafi (standard), 1 = Hanafi.");
|
|
23
|
+
const timezoneField = z
|
|
24
|
+
.string()
|
|
25
|
+
.min(1)
|
|
26
|
+
.describe("A valid timezone name, e.g. Africa/Cairo. If omitted the API derives it from the coordinates.");
|
|
27
|
+
const iso8601Field = z
|
|
28
|
+
.boolean()
|
|
29
|
+
.describe("Return prayer times in ISO 8601 format instead of HH:MM.");
|
|
30
|
+
const calendarMethodField = z
|
|
31
|
+
.enum(["HJCoSA", "UAQ", "DIYANET", "MATHEMATICAL"])
|
|
32
|
+
.describe("Hijri calendar calculation method: HJCoSA (default, used on aladhan.com), UAQ (Umm al-Qura), DIYANET or MATHEMATICAL.");
|
|
33
|
+
const adjustmentField = z
|
|
34
|
+
.number()
|
|
35
|
+
.int()
|
|
36
|
+
.describe("Days to adjust the converted date by (e.g. 1 or -1). Only applies when calendarMethod is MATHEMATICAL.");
|
|
37
|
+
const latitudeField = z.number().min(-90).max(90).describe("Latitude of the location (-90 to 90).");
|
|
38
|
+
const longitudeField = z
|
|
39
|
+
.number()
|
|
40
|
+
.min(-180)
|
|
41
|
+
.max(180)
|
|
42
|
+
.describe("Longitude of the location (-180 to 180).");
|
|
43
|
+
export const GetPrayerTimesByCityInputSchema = z.object({
|
|
44
|
+
city: z.string().min(1).describe("Name of the city, e.g. Cairo."),
|
|
45
|
+
country: z.string().min(1).describe("Country name or 2-letter ISO 3166 code, e.g. EG or Egypt."),
|
|
46
|
+
state: z.string().min(1).describe("State or region within the country, if needed.").optional(),
|
|
47
|
+
date: dateField.optional(),
|
|
48
|
+
method: methodField.optional(),
|
|
49
|
+
school: schoolField.optional(),
|
|
50
|
+
timezonestring: timezoneField.optional(),
|
|
51
|
+
iso8601: iso8601Field.optional(),
|
|
52
|
+
});
|
|
53
|
+
export const GetPrayerTimesByCoordsInputSchema = z.object({
|
|
54
|
+
latitude: latitudeField,
|
|
55
|
+
longitude: longitudeField,
|
|
56
|
+
date: dateField.optional(),
|
|
57
|
+
method: methodField.optional(),
|
|
58
|
+
school: schoolField.optional(),
|
|
59
|
+
timezonestring: timezoneField.optional(),
|
|
60
|
+
iso8601: iso8601Field.optional(),
|
|
61
|
+
});
|
|
62
|
+
export const ConvertDateInputSchema = z.object({
|
|
63
|
+
date: z
|
|
64
|
+
.string()
|
|
65
|
+
.regex(DATE_PATTERN, "Expected DD-MM-YYYY")
|
|
66
|
+
.describe("Date to convert in DD-MM-YYYY format. For hijri_to_gregorian the year is a Hijri year (e.g. 25-06-1448); for gregorian_to_hijri a Gregorian year."),
|
|
67
|
+
direction: z
|
|
68
|
+
.enum(["gregorian_to_hijri", "hijri_to_gregorian"])
|
|
69
|
+
.describe("Conversion direction: gregorian_to_hijri (gToH) or hijri_to_gregorian (hToG)."),
|
|
70
|
+
calendarMethod: calendarMethodField.optional(),
|
|
71
|
+
adjustment: adjustmentField.optional(),
|
|
72
|
+
});
|
|
73
|
+
export const GetQiblaDirectionInputSchema = z.object({
|
|
74
|
+
latitude: latitudeField,
|
|
75
|
+
longitude: longitudeField,
|
|
76
|
+
});
|
|
77
|
+
/** Today's date in UTC, formatted DD-MM-YYYY as the API requires. Exported for tests. */
|
|
78
|
+
export function todayDDMMYYYY(now = new Date()) {
|
|
79
|
+
const dd = String(now.getUTCDate()).padStart(2, "0");
|
|
80
|
+
const mm = String(now.getUTCMonth() + 1).padStart(2, "0");
|
|
81
|
+
const yyyy = String(now.getUTCFullYear());
|
|
82
|
+
return dd + "-" + mm + "-" + yyyy;
|
|
83
|
+
}
|
|
84
|
+
function sharedTimingsParams(input) {
|
|
85
|
+
const params = {};
|
|
86
|
+
if (input.method !== undefined)
|
|
87
|
+
params.method = String(input.method);
|
|
88
|
+
if (input.school !== undefined)
|
|
89
|
+
params.school = String(input.school);
|
|
90
|
+
if (input.timezonestring !== undefined)
|
|
91
|
+
params.timezonestring = input.timezonestring;
|
|
92
|
+
if (input.iso8601 !== undefined)
|
|
93
|
+
params.iso8601 = String(input.iso8601);
|
|
94
|
+
return params;
|
|
95
|
+
}
|
|
96
|
+
/** GET /timingsByCity/{date} - verified against the Prayer Times API spec. */
|
|
97
|
+
export async function getPrayerTimesByCity(client, input) {
|
|
98
|
+
const date = input.date ?? todayDDMMYYYY();
|
|
99
|
+
const params = { city: input.city, country: input.country };
|
|
100
|
+
if (input.state !== undefined)
|
|
101
|
+
params.state = input.state;
|
|
102
|
+
Object.assign(params, sharedTimingsParams(input));
|
|
103
|
+
return client.get("/timingsByCity/" + date, params);
|
|
104
|
+
}
|
|
105
|
+
/** GET /timings/{date} - verified against the Prayer Times API spec. */
|
|
106
|
+
export async function getPrayerTimesByCoords(client, input) {
|
|
107
|
+
const date = input.date ?? todayDDMMYYYY();
|
|
108
|
+
const params = {
|
|
109
|
+
latitude: String(input.latitude),
|
|
110
|
+
longitude: String(input.longitude),
|
|
111
|
+
};
|
|
112
|
+
Object.assign(params, sharedTimingsParams(input));
|
|
113
|
+
return client.get("/timings/" + date, params);
|
|
114
|
+
}
|
|
115
|
+
/** GET /gToH/{date} or /hToG/{date} - verified against the Islamic Calendar API spec. */
|
|
116
|
+
export async function convertDateHijriGregorian(client, input) {
|
|
117
|
+
const path = input.direction === "gregorian_to_hijri" ? "/gToH/" : "/hToG/";
|
|
118
|
+
const params = {};
|
|
119
|
+
if (input.calendarMethod !== undefined)
|
|
120
|
+
params.calendarMethod = input.calendarMethod;
|
|
121
|
+
if (input.adjustment !== undefined)
|
|
122
|
+
params.adjustment = String(input.adjustment);
|
|
123
|
+
return client.get(path + input.date, params);
|
|
124
|
+
}
|
|
125
|
+
/** GET /qibla/{latitude}/{longitude} - verified against the Qibla Direction API spec. */
|
|
126
|
+
export async function getQiblaDirection(client, input) {
|
|
127
|
+
return client.get("/qibla/" + String(input.latitude) + "/" + String(input.longitude));
|
|
128
|
+
}
|
|
129
|
+
const READ_ONLY = { readOnlyHint: true, idempotentHint: true, openWorldHint: true };
|
|
130
|
+
export function createServer(client = new AladhanClient()) {
|
|
131
|
+
const server = new McpServer({
|
|
132
|
+
name: "@open-mena-mcp/aladhan",
|
|
133
|
+
version: "0.1.0",
|
|
134
|
+
});
|
|
135
|
+
server.registerTool("get_prayer_times_by_city", {
|
|
136
|
+
title: "Prayer Times by City",
|
|
137
|
+
description: "Get all daily prayer times for a city and country from the AlAdhan API (GET /timingsByCity/{date}). Returns timings, Hijri and Gregorian dates and calculation metadata.",
|
|
138
|
+
inputSchema: GetPrayerTimesByCityInputSchema.shape,
|
|
139
|
+
annotations: READ_ONLY,
|
|
140
|
+
}, wrapTool((input) => getPrayerTimesByCity(client, input)));
|
|
141
|
+
server.registerTool("get_prayer_times_by_coords", {
|
|
142
|
+
title: "Prayer Times by Coordinates",
|
|
143
|
+
description: "Get all daily prayer times for a latitude/longitude pair from the AlAdhan API (GET /timings/{date}). Returns timings, Hijri and Gregorian dates and calculation metadata.",
|
|
144
|
+
inputSchema: GetPrayerTimesByCoordsInputSchema.shape,
|
|
145
|
+
annotations: READ_ONLY,
|
|
146
|
+
}, wrapTool((input) => getPrayerTimesByCoords(client, input)));
|
|
147
|
+
server.registerTool("convert_date_hijri_gregorian", {
|
|
148
|
+
title: "Convert Hijri / Gregorian Date",
|
|
149
|
+
description: "Convert a date between the Gregorian and Hijri calendars using the AlAdhan API (GET /gToH/{date} and GET /hToG/{date}). Returns both calendar representations of the date.",
|
|
150
|
+
inputSchema: ConvertDateInputSchema.shape,
|
|
151
|
+
annotations: READ_ONLY,
|
|
152
|
+
}, wrapTool((input) => convertDateHijriGregorian(client, input)));
|
|
153
|
+
server.registerTool("get_qibla_direction", {
|
|
154
|
+
title: "Qibla Direction",
|
|
155
|
+
description: "Get the Qibla direction in degrees clockwise from true north for a latitude/longitude pair (GET /qibla/{latitude}/{longitude}).",
|
|
156
|
+
inputSchema: GetQiblaDirectionInputSchema.shape,
|
|
157
|
+
annotations: READ_ONLY,
|
|
158
|
+
}, wrapTool((input) => getQiblaDirection(client, input)));
|
|
159
|
+
return server;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,YAAY,GAAG,qBAAqB,CAAC;AAE3C,MAAM,SAAS,GAAG,CAAC;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AC,CAAC,CACpF,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,4BAA4B,EAC5B;QACE,KAAK,EAAE,6BAA6B;QACpC,WAAW,EACT,2KAA2K;QAC7K,WAAW,EAAE,iCAAiC,CAAC,KAAK;QACpD,WAAW,EAAE,SAAS;KACvB,EACD,QAAQ,CAAC,CAAC,KAAkC,EAAE,EAAE,CAAC,sBAAsB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CACxF,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,8BAA8B,EAC9B;QACE,KAAK,EAAE,gCAAgC;QACvC,WAAW,EACT,4KAA4K;QAC9K,WAAW,EAAE,sBAAsB,CAAC,KAAK;QACzC,WAAW,EAAE,SAAS;KACvB,EACD,QAAQ,CAAC,CAAC,KAAuB,EAAE,EAAE,CAAC,yBAAyB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAChF,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,qBAAqB,EACrB;QACE,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACT,iIAAiI;QACnI,WAAW,EAAE,4BAA4B,CAAC,KAAK;QAC/C,WAAW,EAAE,SAAS;KACvB,EACD,QAAQ,CAAC,CAAC,KAA6B,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAC9E,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mena-mcp/aladhan",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for the AlAdhan API: prayer times, Hijri date conversion and Qibla direction.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"mcp-aladhan": "./dist/bin.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
25
|
+
"zod": "^3.25.0",
|
|
26
|
+
"@open-mena-mcp/core": "0.1.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^22.7.4",
|
|
30
|
+
"typescript": "^5.6.3",
|
|
31
|
+
"vitest": "^4.1.12"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/Dinaelsayed99/open-mena-mcp.git",
|
|
36
|
+
"directory": "packages/mcp-aladhan"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/Dinaelsayed99/open-mena-mcp/tree/main/packages/mcp-aladhan#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
|
}
|