@statsmcp/asub 0.0.0-stage → 0.6.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 Tadej Polajnar
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,49 @@
1
- # Temporary Holding Version
1
+ # @statsmcp/asub
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
+ An MCP server for the [PxWeb database](https://pxweb.asub.ax/PXWeb/pxweb/en/Statistik/) of Statistics and Research Åland (ÅSUB). It gives AI assistants access to the official statistics of the Åland Islands in Swedish and English.
4
+
5
+ > This project is not affiliated with or endorsed by ÅSUB.
6
+
7
+ ## Use the server
8
+
9
+ ### Hosted
10
+
11
+ Add `https://statsmcp.dev/ax/mcp` as a remote MCP server. It uses Streamable HTTP and needs no authentication. For the steps for each client, refer to [statsmcp.dev/aland-islands](https://statsmcp.dev/aland-islands/).
12
+
13
+ ### Local
14
+
15
+ You need Node.js 20 or later.
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "asub": { "command": "npx", "args": ["-y", "@statsmcp/asub"] }
21
+ }
22
+ }
23
+ ```
24
+
25
+ For Claude Code:
26
+
27
+ ```sh
28
+ claude mcp add asub -- npx -y @statsmcp/asub
29
+ ```
30
+
31
+ ## Tools
32
+
33
+ | Tool | What it does |
34
+ | -------------------- | ------------------------------------------------------------------------------------------------ |
35
+ | `search_tables` | Finds tables by keywords. Swedish words find the most tables. |
36
+ | `get_table_metadata` | Lists the variables of a table and their value codes. Use `valueFilter` to find a value by name. |
37
+ | `query_table` | Returns data as CSV with readable labels. Use `latest` for recent periods. |
38
+
39
+ All tools are read-only.
40
+
41
+ ## Data licence and attribution
42
+
43
+ ÅSUB publishes its material under the [Creative Commons Attribution 4.0 licence (CC BY 4.0)](https://www.asub.ax/sv/om-asub/om-asubax/anvandarvillkor). You can copy, change and share it, also commercially, if you name ÅSUB as the source and state your changes.
44
+
45
+ Each result contains the source line and a link to the table. If you change the data or calculate new figures, say so, for example: `ÅSUB and own calculations`.
46
+
47
+ ## Licence
48
+
49
+ The code is under the MIT licence. The data belongs to Statistics and Research Åland.
package/dist/bin.d.mts ADDED
@@ -0,0 +1 @@
1
+ export {}
package/dist/bin.mjs ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { t as createAsubServer } from "./src-BhahGGEc.mjs";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
4
+ // src/bin.ts
5
+ await createAsubServer().connect(new StdioServerTransport());
6
+ export {};
@@ -0,0 +1,5 @@
1
+ import { PresetServerOptions, PxwebPreset } from "@statsmcp/core";
2
+ import { McpServer } from "@modelcontextprotocol/server";
3
+ export declare const asubPreset: PxwebPreset;
4
+ export type AsubServerOptions = Pick<PresetServerOptions, 'cache' | 'userAgent'>;
5
+ export declare function createAsubServer(options?: AsubServerOptions): McpServer;
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export { n as asubPreset, t as createAsubServer } from "./src-BhahGGEc.mjs";
@@ -0,0 +1,58 @@
1
+ import { createPresetServer } from "@statsmcp/core";
2
+ // src/preset.ts
3
+ const TERMS = "https://www.asub.ax/sv/om-asub/om-asubax/anvandarvillkor";
4
+ const ATTRIBUTION = {
5
+ sv: `Källa: ÅSUB, CC BY 4.0 (${TERMS})`,
6
+ en: `Source: Statistics and Research Åland (ÅSUB), CC BY 4.0 (${TERMS})`
7
+ };
8
+ const asubPreset = {
9
+ name: "asub",
10
+ title: "PxWeb database of Statistics and Research Åland (ÅSUB official statistics)",
11
+ version: "0.6.0",
12
+ apiBaseUrl: "https://pxweb.asub.ax/PXWeb/api/v1",
13
+ database: "Statistik",
14
+ languages: ["sv", "en"],
15
+ attribution: (lang) => lang === "sv" ? ATTRIBUTION.sv : ATTRIBUTION.en,
16
+ tableUrl: (lang, tableId) => {
17
+ const pageLang = lang === "sv" ? "sv" : "en";
18
+ const segments = tableId.split("/").map(encodeURIComponent);
19
+ const file = segments.pop() ?? tableId;
20
+ return `https://pxweb.asub.ax/PXWeb/pxweb/${pageLang}/Statistik/${["Statistik", ...segments].join("__")}/${file}/`;
21
+ },
22
+ isArchived: (hit) => hit.path?.split("/").some((segment) => segment.startsWith("Avslutade")) ?? false,
23
+ instructions: `Official statistics for the Åland Islands from the PxWeb database of Statistics and Research Åland (ÅSUB). This server is not affiliated with or endorsed by ÅSUB.
24
+
25
+ To answer a question with data:
26
+ 1. Call \`search_tables\` with short topic keywords in Swedish ("sv") or English ("en"). Swedish words find more tables, for example "befolkning" or "konsumentprisindex". Results marked "archived" are discontinued tables; prefer current tables.
27
+ 2. Call \`get_table_metadata\` on the best table to see its variables and value codes. Use \`valueFilter\` to find a municipality by name.
28
+ 3. Call \`query_table\` with only the values you need. Use \`latest\` for recent periods.
29
+
30
+ ÅSUB allows about 10 API calls per 10 seconds. Always cite the source line that each result ends with. If you change the data or calculate new figures, say so, for example "ÅSUB and own calculations".`,
31
+ maxCells: 5e3,
32
+ searchLimit: 10,
33
+ searchAliases: {
34
+ en: [{
35
+ terms: ["inflation", "consumer prices"],
36
+ query: "consumer price index"
37
+ }, {
38
+ terms: [
39
+ "housing price",
40
+ "house price",
41
+ "home price"
42
+ ],
43
+ query: "purchases of dwellings"
44
+ }],
45
+ sv: [{
46
+ terms: ["inflation", "priser"],
47
+ query: "konsumentprisindex"
48
+ }, {
49
+ terms: ["bostadspris", "huspris"],
50
+ query: "aktiebostadsöverlåtelser"
51
+ }]
52
+ }
53
+ };
54
+ // src/index.ts
55
+ function createAsubServer(options = {}) {
56
+ return createPresetServer(asubPreset, options);
57
+ }
58
+ export { asubPreset as n, createAsubServer as t };
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@statsmcp/asub",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.6.0",
4
+ "description": "MCP server for the PxWeb database of Statistics and Research Åland (ÅSUB)",
5
+ "license": "MIT",
6
+ "author": "Tadej Polajnar",
7
+ "homepage": "https://statsmcp.dev/aland-islands/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Stats-MCP/statsmcp.git",
11
+ "directory": "packages/asub"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/Stats-MCP/statsmcp/issues"
15
+ },
16
+ "type": "module",
17
+ "engines": {
18
+ "node": ">=20"
19
+ },
20
+ "keywords": [
21
+ "mcp",
22
+ "asub",
23
+ "aland",
24
+ "åland",
25
+ "statistics",
26
+ "pxweb"
27
+ ],
28
+ "bin": {
29
+ "asub-mcp": "./dist/bin.mjs"
30
+ },
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.mts",
34
+ "default": "./dist/index.mjs"
35
+ }
36
+ },
37
+ "files": [
38
+ "dist"
39
+ ],
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "dependencies": {
44
+ "@modelcontextprotocol/server": "^2.4.0",
45
+ "@statsmcp/core": "0.6.0"
46
+ },
47
+ "devDependencies": {
48
+ "@types/node": "26.6.6",
49
+ "tsdown": "0.23.4",
50
+ "typescript": "7.0.2",
51
+ "vitest": "5.0.5"
52
+ },
53
+ "scripts": {
54
+ "build": "tsdown",
55
+ "typecheck": "tsc --noEmit",
56
+ "test": "vitest run"
57
+ }
6
58
  }