@statsmcp/statbel 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,67 @@
1
- # Temporary Holding Version
1
+ # @statsmcp/statbel
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 [Be.STAT](https://bestat.statbel.fgov.be/bestat/), the database of Statbel, the national statistics office of Belgium. It gives AI assistants access to more than 1,300 tables (views) in Dutch, French and English.
4
+
5
+ > This project is not affiliated with or endorsed by Statbel.
6
+
7
+ ## Use the server
8
+
9
+ ### Hosted
10
+
11
+ Add `https://statsmcp.dev/be/mcp` as a remote MCP server. It uses Streamable HTTP and needs no authentication. For the steps for each client, refer to [statsmcp.dev/belgium](https://statsmcp.dev/belgium/).
12
+
13
+ ### Local
14
+
15
+ You need Node.js 20 or later.
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "statbel": { "command": "npx", "args": ["-y", "@statsmcp/statbel"] }
21
+ }
22
+ }
23
+ ```
24
+
25
+ For Claude Code:
26
+
27
+ ```sh
28
+ claude mcp add statbel -- npx -y @statsmcp/statbel
29
+ ```
30
+
31
+ The server reads the list of views from the Be.STAT API and searches it locally.
32
+
33
+ ## Tools
34
+
35
+ | Tool | What it does |
36
+ | -------------------- | ---------------------------------------------------------------------------------------- |
37
+ | `search_tables` | Finds tables by keywords in Dutch, French or English. |
38
+ | `get_table_metadata` | Lists the variables of a table and their value codes. Use `valueFilter` to find a value. |
39
+ | `query_table` | Returns data as CSV with readable labels. Use `latest` for recent periods. |
40
+
41
+ All tools are read-only.
42
+
43
+ ## Use it in your own server
44
+
45
+ ```sh
46
+ npm install @statsmcp/statbel
47
+ ```
48
+
49
+ ```ts
50
+ import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
51
+ import { createStatbelServer } from '@statsmcp/statbel';
52
+
53
+ const server = createStatbelServer({ userAgent: 'my-app/1.0' });
54
+ await server.connect(new StdioServerTransport());
55
+ ```
56
+
57
+ `createStatbelServer` returns an `McpServer`. It also accepts a `cache`.
58
+
59
+ ## Data licence and attribution
60
+
61
+ Statbel publishes its data under the [Creative Commons Attribution 4.0 licence (CC BY 4.0)](https://statbel.fgov.be/en/cc-40). You can reuse it freely, also commercially, if you credit `Source: Statbel`, link the licence, say when you changed the data, and do not suggest that Statbel supports your use.
62
+
63
+ Each result contains the source line and a link to the view.
64
+
65
+ ## Licence
66
+
67
+ The code is under the MIT licence. The data belongs to Statbel.
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 createStatbelServer } from "./src-BJtOQUbL.mjs";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
4
+ // src/bin.ts
5
+ await createStatbelServer().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 statbelPreset: PxwebPreset;
4
+ export type StatbelServerOptions = Pick<PresetServerOptions, 'cache' | 'userAgent'>;
5
+ export declare function createStatbelServer(options?: StatbelServerOptions): McpServer;
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export { t as createStatbelServer, n as statbelPreset } from "./src-BJtOQUbL.mjs";
@@ -0,0 +1,62 @@
1
+ import { createPresetServer } from "@statsmcp/core";
2
+ // src/preset.ts
3
+ const TERMS = "https://statbel.fgov.be/en/cc-40";
4
+ const ATTRIBUTION = {
5
+ nl: `Bron: Statbel, CC BY 4.0 (${TERMS})`,
6
+ fr: `Source : Statbel, CC BY 4.0 (${TERMS})`,
7
+ en: `Source: Statbel, CC BY 4.0 (${TERMS})`
8
+ };
9
+ function attribution(lang) {
10
+ if (lang === "nl") return ATTRIBUTION.nl;
11
+ if (lang === "fr") return ATTRIBUTION.fr;
12
+ return ATTRIBUTION.en;
13
+ }
14
+ const statbelPreset = {
15
+ name: "statbel",
16
+ title: "Be.STAT, the database of Statbel (official statistics of Belgium)",
17
+ version: "0.6.0",
18
+ apiBaseUrl: "https://bestat.statbel.fgov.be/bestat/api",
19
+ api: "statbel",
20
+ languages: [
21
+ "nl",
22
+ "fr",
23
+ "en"
24
+ ],
25
+ attribution,
26
+ tableUrl: (_lang, tableId) => `https://bestat.statbel.fgov.be/bestat/crosstable.xhtml?view=${encodeURIComponent(tableId)}`,
27
+ instructions: `Official statistics for Belgium from Be.STAT, the database of Statbel. This server is not affiliated with or endorsed by Statbel.
28
+
29
+ To answer a question with data:
30
+ 1. Call \`search_tables\` with short topic keywords in Dutch ("nl"), French ("fr") or English ("en"). Each table (view) exists in one language only, so use a table id only in the language that returned it. Many views cover only the last 13 months or the last quarters; prefer the view with the latest update.
31
+ 2. Call \`get_table_metadata\` on the best view to see its variables and value codes. An optional variable that you leave out returns its total; a required one returns all its values.
32
+ 3. Call \`query_table\` with only the values you need. Use \`latest\` on the period for recent periods.
33
+
34
+ Rates are fractions: 0.061 means 6.1 %. Always cite the source line that each result ends with. If you change the data or calculate new figures, say so.`,
35
+ maxCells: 5e3,
36
+ searchLimit: 10,
37
+ searchAliases: {
38
+ en: [{
39
+ terms: ["inflation", "cpi"],
40
+ query: "consumer price index"
41
+ }, {
42
+ terms: ["jobless"],
43
+ query: "unemployment rate"
44
+ }],
45
+ nl: [{
46
+ terms: ["inflatie"],
47
+ query: "consumptieprijsindex"
48
+ }, {
49
+ terms: ["werkloosheid"],
50
+ query: "werkloosheidsgraad"
51
+ }],
52
+ fr: [{
53
+ terms: ["inflation"],
54
+ query: "indice des prix à la consommation"
55
+ }]
56
+ }
57
+ };
58
+ // src/index.ts
59
+ function createStatbelServer(options = {}) {
60
+ return createPresetServer(statbelPreset, options);
61
+ }
62
+ export { statbelPreset as n, createStatbelServer as t };
package/package.json CHANGED
@@ -1,6 +1,57 @@
1
1
  {
2
2
  "name": "@statsmcp/statbel",
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 Be.STAT, the database of Statbel (Belgium)",
5
+ "license": "MIT",
6
+ "author": "Tadej Polajnar",
7
+ "homepage": "https://statsmcp.dev/belgium/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Stats-MCP/statsmcp.git",
11
+ "directory": "packages/statbel"
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
+ "statbel",
23
+ "bestat",
24
+ "belgium",
25
+ "statistics"
26
+ ],
27
+ "bin": {
28
+ "statbel-mcp": "./dist/bin.mjs"
29
+ },
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.mts",
33
+ "default": "./dist/index.mjs"
34
+ }
35
+ },
36
+ "files": [
37
+ "dist"
38
+ ],
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "dependencies": {
43
+ "@modelcontextprotocol/server": "^2.4.0",
44
+ "@statsmcp/core": "0.6.0"
45
+ },
46
+ "devDependencies": {
47
+ "@types/node": "26.6.6",
48
+ "tsdown": "0.23.4",
49
+ "typescript": "7.0.2",
50
+ "vitest": "5.0.5"
51
+ },
52
+ "scripts": {
53
+ "build": "tsdown",
54
+ "typecheck": "tsc --noEmit",
55
+ "test": "vitest run"
56
+ }
6
57
  }