@pipeworx/mcp-macau-stats 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/.pipeworx-staged-ok +6 -0
- package/LICENSE +21 -0
- package/README.md +170 -0
- package/bin/cli.js +17 -0
- package/package.json +28 -0
- package/server.json +18 -0
- package/src/index.ts +1112 -0
- package/src/server.ts +45 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"staged_at": "2026-09-23T20:27:11.107Z",
|
|
3
|
+
"publisher_blob": "da6994091dc9dcc6a7433084251ca4bbd58b4bed",
|
|
4
|
+
"publisher_commit": "1c417b2cfcdac06e2d9210e869265722ef013f20",
|
|
5
|
+
"note": "Written by scripts/publish-pack.sh as its LAST step. Its presence is the ONLY thing that lets stage-unpublished-packs.sh skip this pack. Deleting this dir is the correct way to force a rebuild."
|
|
6
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mojibake Inc.
|
|
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,170 @@
|
|
|
1
|
+
# @pipeworx/macau-stats
|
|
2
|
+
|
|
3
|
+
Macau (Macao SAR) official statistics — 143 headline indicators (population,
|
|
4
|
+
visitor arrivals, gaming revenue, CPI, unemployment, births/deaths and more)
|
|
5
|
+
from DSEC, the Macao Statistics and Census Service (澳門統計暨普查局 /
|
|
6
|
+
Direcção dos Serviços de Estatística e Censos).
|
|
7
|
+
|
|
8
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1663+ live data sources.
|
|
9
|
+
|
|
10
|
+
## Tools
|
|
11
|
+
|
|
12
|
+
- `macau_indicators({ query? })` — the catalogue of all 143 key indicators
|
|
13
|
+
(id, name in English/中文/Portuguese, reporting frequency). Pass `query` to
|
|
14
|
+
filter by keyword in any of the three languages.
|
|
15
|
+
- `macau_indicator({ id?, name?, periods? })` — latest value for one
|
|
16
|
+
indicator by numeric id or name/keyword, plus a historical series when a
|
|
17
|
+
reliable match exists in DSEC's general statistics database (see the
|
|
18
|
+
ID-space note below). `periods` defaults to 24.
|
|
19
|
+
- `macau_gaming_revenue()` — Macau's monthly gross revenue of games of chance
|
|
20
|
+
(澳門博彩毛收入) in million MOP — the same figure the gaming regulator DICJ
|
|
21
|
+
publishes as an HTML table, sourced here as structured data instead.
|
|
22
|
+
- `macau_population()` — total resident population, quarterly.
|
|
23
|
+
- `macau_tourism()` — visitor arrivals, monthly.
|
|
24
|
+
- `macau_employment()` — unemployment rate, total employment and median
|
|
25
|
+
monthly earnings in one call.
|
|
26
|
+
|
|
27
|
+
## Auth
|
|
28
|
+
|
|
29
|
+
Keyless. No registration, no API key, despite the DSEC
|
|
30
|
+
`/zh-MO/Service/WebService` page describing a "contact us" styled-widget
|
|
31
|
+
product — that copy is about the branded embed, not the raw data call used
|
|
32
|
+
here.
|
|
33
|
+
|
|
34
|
+
## Data sources
|
|
35
|
+
|
|
36
|
+
- `https://www.dsec.gov.mo/TimeSeriesDatabase.asmx` — DSEC's public SOAP web
|
|
37
|
+
service (WSDL at `?WSDL`). Old-school ASP.NET ASMX: every SOAP operation
|
|
38
|
+
also answers a plain HTTP GET (the framework's HttpGet binding), so this
|
|
39
|
+
pack calls it with GET + query string and parses the XML response — no SOAP
|
|
40
|
+
envelope needed.
|
|
41
|
+
|
|
42
|
+
### Traps for the next person
|
|
43
|
+
|
|
44
|
+
- **Two disjoint id spaces.** The 143 curated `KeyIndicatorID`s
|
|
45
|
+
(`getKeyIndicatorList`/`getKeyIndicatorValue`) are NOT the same numbering as
|
|
46
|
+
the general `IndicatorID` catalog (`getIndicatorID`/`getIndicatorByID`/
|
|
47
|
+
`getIndicatorLatestNValues`) — `getIndicatorByID(15)` for KeyIndicatorID 15
|
|
48
|
+
returns an empty result. There is no documented mapping table. This pack
|
|
49
|
+
resolves a mapping by searching the general catalog for a description that
|
|
50
|
+
matches a key indicator's own name, and only trusts the match when it
|
|
51
|
+
resolves to exactly one series (an ambiguous or empty search means "no
|
|
52
|
+
reliable history", not a guess) — confirmed working for "Live births" ->
|
|
53
|
+
IndicatorID 9014, confirmed absent for "Gross revenue of games of chance"
|
|
54
|
+
(it exists only in the curated key-indicator set, not the general catalog).
|
|
55
|
+
- **The curated key-indicator endpoint (`getKeyIndicatorValue`) returns only
|
|
56
|
+
the LATEST value** — no period parameter, no history. Real time series
|
|
57
|
+
require the general-catalog mapping above, which does not resolve for
|
|
58
|
+
every indicator.
|
|
59
|
+
- **Chart operations (`getChart`, `getCommonChart`) return a base64-encoded
|
|
60
|
+
PNG image (`ChartData`), not structured numbers** — not usable for a data
|
|
61
|
+
API, so this pack does not call them.
|
|
62
|
+
- **Language enum values**: `English`, `TraditionalChinese`,
|
|
63
|
+
`SimplifiedChinese`, `Portuguese` — NOT `Chinese` (that value 500s with a
|
|
64
|
+
.NET conversion error).
|
|
65
|
+
- This pack supersedes any DICJ (gaming regulator) HTML-table scrape — the
|
|
66
|
+
same monthly gross-gaming-revenue number is available here as clean XML.
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"mcpServers": {
|
|
75
|
+
"macau-stats": {
|
|
76
|
+
"url": "https://gateway.pipeworx.io/macau-stats/mcp"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### What this endpoint actually serves
|
|
83
|
+
|
|
84
|
+
`tools/list` at `https://gateway.pipeworx.io/macau-stats/mcp` returns the tools in the table
|
|
85
|
+
above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
|
|
86
|
+
`discover_tools`, `search_within`, `remember`/`recall` and the rest of the
|
|
87
|
+
gateway-wide set. So the tool count you see is larger than this table: a
|
|
88
|
+
single-pack endpoint currently lists roughly 30 shared tools alongside the
|
|
89
|
+
pack's own. The connection's `initialize` response states its exact scope, and
|
|
90
|
+
is the authoritative answer for a given day.
|
|
91
|
+
|
|
92
|
+
This is deliberate, not multiplexing by accident. The meta-tools are what let a
|
|
93
|
+
scoped connection answer a question this pack does not cover — via
|
|
94
|
+
`ask_pipeworx`, which routes across the whole catalog — without you adding a
|
|
95
|
+
second MCP server. There is currently no way to mount a pack endpoint without
|
|
96
|
+
them; if the extra schemas cost you more context than the routing is worth,
|
|
97
|
+
connect to the full gateway once rather than to several pack endpoints.
|
|
98
|
+
|
|
99
|
+
Or connect to the full Pipeworx gateway to get every pack's tools listed
|
|
100
|
+
directly, instead of just this one's:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"mcpServers": {
|
|
105
|
+
"pipeworx": {
|
|
106
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Both URLs reach the same gateway and the same 1663+ data sources. The
|
|
113
|
+
only difference is which pack's tools are listed **directly**; `ask_pipeworx`
|
|
114
|
+
reaches all of them from either one.
|
|
115
|
+
|
|
116
|
+
## No MCP client? Call it over HTTP
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
curl -X POST https://gateway.pipeworx.io/v1/tools/macau_indicators \
|
|
120
|
+
-H 'Content-Type: application/json' \
|
|
121
|
+
-d '{}'
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/macau_indicators`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
|
|
125
|
+
|
|
126
|
+
## Standalone (no gateway account)
|
|
127
|
+
|
|
128
|
+
This package also runs as a local stdio MCP server — no Pipeworx account, no
|
|
129
|
+
gateway round-trip:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"mcpServers": {
|
|
134
|
+
"macau-stats": {
|
|
135
|
+
"command": "npx",
|
|
136
|
+
"args": ["-y", "@pipeworx/mcp-macau-stats"]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Or run it directly to confirm it starts:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npx -y @pipeworx/mcp-macau-stats
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
|
|
149
|
+
for **only** this pack's tools — none of the shared meta-tools the gateway
|
|
150
|
+
connection above adds. Same source, same tools, no ask_pipeworx routing.
|
|
151
|
+
|
|
152
|
+
## Using with ask_pipeworx
|
|
153
|
+
|
|
154
|
+
Instead of calling tools directly, you can ask questions in plain English —
|
|
155
|
+
this works on the pack endpoint above as well as on the full gateway:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
ask_pipeworx({ question: "your question about Macau Stats data" })
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
162
|
+
|
|
163
|
+
## More
|
|
164
|
+
|
|
165
|
+
- [Docs and guides](https://pipeworx.io/docs)
|
|
166
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
//
|
|
3
|
+
// Entry point for `npx @pipeworx/mcp-<slug>`.
|
|
4
|
+
//
|
|
5
|
+
// Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
|
|
6
|
+
// tsx sidesteps every extensionless-import / bare-JSON-import edge case a
|
|
7
|
+
// per-pack tsc build would have to solve one pack at a time). This file
|
|
8
|
+
// registers tsx's ESM loader programmatically, then hands off to src/server.ts,
|
|
9
|
+
// which wraps the pack's {tools, callTool} export in a stdio MCP server.
|
|
10
|
+
//
|
|
11
|
+
// Copied verbatim into every published pack repo by scripts/publish-pack.sh —
|
|
12
|
+
// edit this file, not a per-pack copy.
|
|
13
|
+
import { register } from 'tsx/esm/api';
|
|
14
|
+
|
|
15
|
+
register();
|
|
16
|
+
|
|
17
|
+
await import('../src/server.ts');
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-macau-stats",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Macau Statistics MCP — DSEC (Direcção dos Serviços de Estatística e Censos",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"mcp-macau-stats": "bin/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "macau-stats"],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/pipeworx-io/mcp-macau-stats.git"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"typecheck": "tsc --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
22
|
+
"tsx": "^4.19.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"@cloudflare/workers-types": "^4.20260405.1"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/macau-stats",
|
|
4
|
+
"title": "Macau Stats",
|
|
5
|
+
"description": "Macau Statistics MCP — DSEC (Direcção dos Serviços de Estatística e Censos",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/macau-stats",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-macau-stats",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/macau-stats/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|