@catlabtech/mycal-mcp-server 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +106 -0
  3. package/dist/index.js +2306 -54
  4. package/package.json +10 -5
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CatLab Tech
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 ADDED
@@ -0,0 +1,106 @@
1
+ # @catlabtech/mycal-mcp-server
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@catlabtech/mycal-mcp-server.svg)](https://www.npmjs.com/package/@catlabtech/mycal-mcp-server)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Junhui20/malaysia-calendar-api/blob/main/LICENSE)
5
+
6
+ MCP (Model Context Protocol) server exposing the **Malaysia Calendar API** as 12 ready-to-use tools for Claude, ChatGPT, and other AI agents.
7
+
8
+ > Data sourced from the official Malaysian government gazette (JPM BKPP), JAKIM, KPM, and MPM.
9
+
10
+ ## Why
11
+
12
+ LLMs are notoriously bad at Malaysia-specific calendar questions:
13
+
14
+ - They get Islamic holidays wrong (incorrect Hijri → Gregorian mapping)
15
+ - They don't know about cuti peristiwa announced after their training cutoff
16
+ - They confuse state-specific vs federal holidays
17
+ - They default to Sat–Sun weekends — wrong for Kedah, Kelantan, Terengganu (Fri–Sat)
18
+
19
+ Drop this MCP server into your AI client and all those questions get answered from the live gazette-backed API instead of hallucinated.
20
+
21
+ ## Setup with Claude Desktop
22
+
23
+ Edit your Claude Desktop config:
24
+
25
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
26
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
27
+ - **Linux:** `~/.config/Claude/claude_desktop_config.json`
28
+
29
+ Add (or merge into the existing `mcpServers` block):
30
+
31
+ ```json
32
+ {
33
+ "mcpServers": {
34
+ "malaysia-calendar": {
35
+ "command": "npx",
36
+ "args": ["-y", "@catlabtech/mycal-mcp-server"]
37
+ }
38
+ }
39
+ }
40
+ ```
41
+
42
+ Completely quit Claude Desktop and reopen. Test with:
43
+
44
+ > *"Is March 21, 2026 a public holiday in Selangor?"*
45
+ > *"What are the long weekends for KL in 2026?"*
46
+
47
+ ## Setup with Claude Code
48
+
49
+ ```bash
50
+ claude mcp add malaysia-calendar --scope user -- npx -y @catlabtech/mycal-mcp-server
51
+ ```
52
+
53
+ Or commit to your repo's `.mcp.json` for team-wide setup. Verify with `/mcp` in a Claude Code session.
54
+
55
+ ## Available tools (12)
56
+
57
+ | Tool | What it does |
58
+ |------|-------------|
59
+ | `get_malaysia_holidays` | List holidays (filter by year, state, type, status, month) |
60
+ | `check_malaysia_holiday` | Is this date a holiday, weekend, working day, or school day? |
61
+ | `next_malaysia_holiday` | Next N upcoming holidays |
62
+ | `malaysia_business_days` | Count working days in range, or add N business days to a date |
63
+ | `malaysia_long_weekends` | All 3+ day non-working stretches in the year |
64
+ | `list_malaysia_states` | 16 states + 3 FTs with weekend config |
65
+ | `resolve_malaysia_state` | Alias (`kl`, `jb`, `n9`) → canonical code |
66
+ | `malaysia_holiday_changes` | Recent additions / changes — useful for cuti peristiwa tracking |
67
+ | `malaysia_school_terms` | KPM school term dates + school-day counts |
68
+ | `malaysia_school_holidays` | Cuti penggal, pertengahan, akhir, perayaan |
69
+ | `malaysia_exams` | SPM, STPM, MUET, PT3 schedules |
70
+ | `malaysia_is_school_day` | Is this date a school day for this state/group? |
71
+
72
+ ## How it works
73
+
74
+ ```
75
+ Your AI client MyCal MCP server Calendar API
76
+ (Claude, etc.) ──────▶ (local npx process) ────▶ (Cloudflare Workers)
77
+ stdio JSON-RPC HTTPS
78
+ ```
79
+
80
+ The server runs locally via `npx`. It speaks MCP over stdio on one side and HTTPS to the API on the other. Nothing to host yourself. No API key needed.
81
+
82
+ ## Troubleshooting
83
+
84
+ **"Command not found: npx"** — install Node 18+ from [nodejs.org](https://nodejs.org/).
85
+
86
+ **"Server disconnected" / MCP not responding** — check `node -v` is ≥ 18. Older Node versions lack ESM/fetch features the server needs.
87
+
88
+ **First call is slow** — `npx` downloads the package on first use. Subsequent calls are fast.
89
+
90
+ **Corporate network blocked** — the server needs outbound HTTPS to `mycal-api.huijun00100101.workers.dev`.
91
+
92
+ ## Documentation
93
+
94
+ - **Full guide:** [https://mycal-web.pages.dev/docs/mcp-server/what-is-mcp](https://mycal-web.pages.dev/docs/mcp-server/what-is-mcp)
95
+ - **Tool reference:** [https://mycal-web.pages.dev/docs/mcp-server/tools](https://mycal-web.pages.dev/docs/mcp-server/tools)
96
+
97
+ ## Related packages
98
+
99
+ - **[`@catlabtech/mycal-sdk`](https://www.npmjs.com/package/@catlabtech/mycal-sdk)** — TypeScript client SDK for direct REST usage
100
+ - **[`@catlabtech/mycal-core`](https://www.npmjs.com/package/@catlabtech/mycal-core)** — shared types and schemas
101
+
102
+ ## License
103
+
104
+ MIT — © catlab.tech
105
+
106
+ Issues and contributions: [github.com/Junhui20/malaysia-calendar-api](https://github.com/Junhui20/malaysia-calendar-api)