@cyanheads/eurostat-mcp-server 0.1.1

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 (57) hide show
  1. package/CLAUDE.md +391 -0
  2. package/Dockerfile +98 -0
  3. package/LICENSE +201 -0
  4. package/README.md +303 -0
  5. package/changelog/0.1.x/0.1.0.md +20 -0
  6. package/changelog/0.1.x/0.1.1.md +21 -0
  7. package/changelog/template.md +119 -0
  8. package/dist/config/server-config.d.ts +12 -0
  9. package/dist/config/server-config.d.ts.map +1 -0
  10. package/dist/config/server-config.js +28 -0
  11. package/dist/config/server-config.js.map +1 -0
  12. package/dist/index.d.ts +7 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +36 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.d.ts +28 -0
  17. package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.d.ts.map +1 -0
  18. package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.js +49 -0
  19. package/dist/mcp-server/resources/definitions/eurostat-dataset.resource.js.map +1 -0
  20. package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.d.ts +30 -0
  21. package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.d.ts.map +1 -0
  22. package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.js +85 -0
  23. package/dist/mcp-server/tools/definitions/eurostat-browse-themes.tool.js.map +1 -0
  24. package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.d.ts +40 -0
  25. package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.d.ts.map +1 -0
  26. package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js +106 -0
  27. package/dist/mcp-server/tools/definitions/eurostat-get-dataset-info.tool.js.map +1 -0
  28. package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.d.ts +31 -0
  29. package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.d.ts.map +1 -0
  30. package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.js +68 -0
  31. package/dist/mcp-server/tools/definitions/eurostat-get-dimension-values.tool.js.map +1 -0
  32. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.d.ts +70 -0
  33. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.d.ts.map +1 -0
  34. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.js +152 -0
  35. package/dist/mcp-server/tools/definitions/eurostat-query-dataset.tool.js.map +1 -0
  36. package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.d.ts +31 -0
  37. package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.d.ts.map +1 -0
  38. package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.js +107 -0
  39. package/dist/mcp-server/tools/definitions/eurostat-search-datasets.tool.js.map +1 -0
  40. package/dist/services/eurostat-catalogue/eurostat-catalogue-service.d.ts +53 -0
  41. package/dist/services/eurostat-catalogue/eurostat-catalogue-service.d.ts.map +1 -0
  42. package/dist/services/eurostat-catalogue/eurostat-catalogue-service.js +254 -0
  43. package/dist/services/eurostat-catalogue/eurostat-catalogue-service.js.map +1 -0
  44. package/dist/services/eurostat-catalogue/types.d.ts +48 -0
  45. package/dist/services/eurostat-catalogue/types.d.ts.map +1 -0
  46. package/dist/services/eurostat-catalogue/types.js +6 -0
  47. package/dist/services/eurostat-catalogue/types.js.map +1 -0
  48. package/dist/services/eurostat-data/eurostat-data-service.d.ts +36 -0
  49. package/dist/services/eurostat-data/eurostat-data-service.d.ts.map +1 -0
  50. package/dist/services/eurostat-data/eurostat-data-service.js +278 -0
  51. package/dist/services/eurostat-data/eurostat-data-service.js.map +1 -0
  52. package/dist/services/eurostat-data/types.d.ts +109 -0
  53. package/dist/services/eurostat-data/types.d.ts.map +1 -0
  54. package/dist/services/eurostat-data/types.js +13 -0
  55. package/dist/services/eurostat-data/types.js.map +1 -0
  56. package/package.json +81 -0
  57. package/server.json +127 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Casey Hand @cyanheads
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,303 @@
1
+ <div align="center">
2
+ <h1>@cyanheads/eurostat-mcp-server</h1>
3
+ <p><b>Search and query Eurostat statistical data — 8,933 datasets covering EU economy, demography, trade, health, and regional NUTS data. STDIO or Streamable HTTP.</b>
4
+ <div>5 Tools • 1 Resource</div>
5
+ </p>
6
+ </div>
7
+
8
+ <div align="center">
9
+
10
+
11
+
12
+ [![Version](https://img.shields.io/badge/Version-0.1.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/eurostat-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/eurostat-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/eurostat-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.2-blueviolet.svg?style=flat-square)](https://bun.sh/)
13
+
14
+ </div>
15
+
16
+ <div align="center">
17
+
18
+ [![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/eurostat-mcp-server/releases/latest/download/eurostat-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=eurostat-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvZXVyb3N0YXQtbWNwLXNlcnZlciJdfQ==) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22eurostat-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Feurostat-mcp-server%22%5D%7D)
19
+
20
+ [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
21
+
22
+ </div>
23
+
24
+ <div align="center">
25
+
26
+ **Public Hosted Server:** [https://eurostat.caseyjhand.com/mcp](https://eurostat.caseyjhand.com/mcp)
27
+
28
+ </div>
29
+
30
+ ---
31
+
32
+ ## Tools
33
+
34
+ 5 tools for discovering and querying Eurostat statistical datasets:
35
+
36
+ | Tool | Description |
37
+ |:---|:---|
38
+ | `eurostat_search_datasets` | Search the Eurostat catalogue (8,933 datasets) by keyword — returns codes, descriptions, period coverage, and theme breadcrumbs |
39
+ | `eurostat_browse_themes` | Navigate the Eurostat theme hierarchy — list root themes or drill into subthemes and datasets |
40
+ | `eurostat_get_dataset_info` | Fetch metadata for a dataset: dimensions with sample values, time range, observation count, and last-update date |
41
+ | `eurostat_get_dimension_values` | List all valid codes for a specific dimension (e.g., all geo codes, all unit codes); supports NUTS hierarchy filtering |
42
+ | `eurostat_query_dataset` | Fetch decoded statistical observations with dimension filters, NUTS geo-level, and time-range controls |
43
+
44
+ ### `eurostat_search_datasets`
45
+
46
+ Search the Eurostat dataset catalogue by keyword.
47
+
48
+ - Case-insensitive substring match against dataset labels across 8,933 datasets
49
+ - Returns code, label, type (dataset/table), period coverage, observation count, and theme breadcrumb
50
+ - Configurable result limit (1–100, default 20); reports total matches before the limit
51
+ - Catalogue loaded once per session from the Eurostat TOC file
52
+ - Pair with `eurostat_browse_themes` for structured domain exploration when keywords are unclear
53
+
54
+ ---
55
+
56
+ ### `eurostat_browse_themes`
57
+
58
+ Navigate the Eurostat theme tree.
59
+
60
+ - Without `theme_code`: returns the 11 top-level themes (Economy and finance, Population, Transport, etc.)
61
+ - With `theme_code`: returns immediate children — subtheme folders and datasets in that branch
62
+ - Each entry includes code, label, type (folder/dataset/table), data period, and observation count where available
63
+ - Returns a breadcrumb path from root to the current node
64
+ - Use for structured discovery when you know the domain but not the exact dataset code
65
+
66
+ ---
67
+
68
+ ### `eurostat_get_dataset_info`
69
+
70
+ Fetch metadata for a Eurostat dataset before querying it.
71
+
72
+ - Returns all dimensions with their codes, labels, and up to 10 sample values each
73
+ - Reports overall time range and total observation count across all periods
74
+ - Uses a minimal Statistics API call (most recent period only) for efficiency
75
+ - For dimensions with more than 10 values, use `eurostat_get_dimension_values` for the full list
76
+ - Provides a link to the ESMS metadata page when available
77
+
78
+ ---
79
+
80
+ ### `eurostat_get_dimension_values`
81
+
82
+ List all valid values for a specific dataset dimension.
83
+
84
+ - Retrieves the complete set of valid codes and labels for any dimension (unit, na_item, geo, etc.)
85
+ - For the `geo` dimension, supports NUTS hierarchy filtering: `aggregate` (EU/EA totals), `country` (41 states), `nuts1` (127 major regions), `nuts2` (309 basic regions), `nuts3` (1,343 small regions)
86
+ - Prevents silent no-data returns — invalid dimension values in `eurostat_query_dataset` return nothing without error; verify codes here first
87
+
88
+ ---
89
+
90
+ ### `eurostat_query_dataset`
91
+
92
+ Fetch statistical data from a Eurostat dataset.
93
+
94
+ - Accepts dimension filters as a map of `{dimension_code: [value1, value2, ...]}`
95
+ - NUTS geo-level filter (`aggregate`, `country`, `nuts1`, `nuts2`, `nuts3`) — mutually exclusive with a `geo` key in filters
96
+ - Time range via `since_period`/`until_period` (e.g., `"2020"`, `"2023-Q1"`) or `last_n_periods` for the N most recent
97
+ - Returns decoded observations with dimension codes and labels, numeric values, and status flags (`p` = provisional, `e` = estimated, etc.)
98
+ - Reports total observation count, missing value count, and effective time range of the result
99
+ - Async-response detection — large unfiltered queries return an actionable error with filter guidance rather than silently timing out
100
+
101
+ ## Resource
102
+
103
+ | Type | Name | Description |
104
+ |:---|:---|:---|
105
+ | Resource | `eurostat://dataset/{dataset_code}` | Dataset metadata (dimensions, time range, obs count, last-updated) accessible by URI for cache-injectable context |
106
+
107
+ ## Features
108
+
109
+ Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):
110
+
111
+ - Declarative tool definitions — single file per tool, framework handles registration and validation
112
+ - Unified error handling across all tools
113
+ - Pluggable auth (`none`, `jwt`, `oauth`)
114
+ - Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`
115
+ - Structured logging with optional OpenTelemetry tracing
116
+ - Runs locally (stdio/HTTP) or on Cloudflare Workers from the same codebase
117
+
118
+ Eurostat-specific:
119
+
120
+ - Session-level in-memory cache for the TOC file — loaded once, reused across all search and browse calls
121
+ - JSON-stat 2.0 stride-based decoder for the Statistics API response format
122
+ - Async-response detection — Eurostat returns a warning object rather than an error for over-limit queries; the server intercepts it and returns an actionable error with filter guidance
123
+ - NUTS hierarchy geo-level filtering across query and dimension-value tools
124
+ - Status flag decoding (provisional, estimated, definition differs, etc.)
125
+
126
+ Agent-friendly output:
127
+
128
+ - Discovery workflow: `eurostat_search_datasets` / `eurostat_browse_themes` → `eurostat_get_dataset_info` → `eurostat_get_dimension_values` → `eurostat_query_dataset`
129
+ - Invalid dimension codes in query filters silently return no data from Eurostat — the `eurostat_get_dimension_values` tool prevents this by letting agents verify codes first
130
+ - Structured error contracts with typed reasons and recovery hints on all tools
131
+
132
+ ## Getting started
133
+
134
+ ### Public Hosted Instance
135
+
136
+ A public instance is available at `https://eurostat.caseyjhand.com/mcp` — no installation required. Point any MCP client at it via Streamable HTTP:
137
+
138
+ ```json
139
+ {
140
+ "mcpServers": {
141
+ "eurostat": {
142
+ "type": "streamable-http",
143
+ "url": "https://eurostat.caseyjhand.com/mcp"
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ ### Self-Hosted / Local
150
+
151
+ Add the following to your MCP client configuration file.
152
+
153
+ ```json
154
+ {
155
+ "mcpServers": {
156
+ "eurostat": {
157
+ "type": "stdio",
158
+ "command": "bunx",
159
+ "args": ["@cyanheads/eurostat-mcp-server@latest"],
160
+ "env": {
161
+ "MCP_TRANSPORT_TYPE": "stdio",
162
+ "MCP_LOG_LEVEL": "info"
163
+ }
164
+ }
165
+ }
166
+ }
167
+ ```
168
+
169
+ Or with npx (no Bun required):
170
+
171
+ ```json
172
+ {
173
+ "mcpServers": {
174
+ "eurostat": {
175
+ "type": "stdio",
176
+ "command": "npx",
177
+ "args": ["-y", "@cyanheads/eurostat-mcp-server@latest"],
178
+ "env": {
179
+ "MCP_TRANSPORT_TYPE": "stdio",
180
+ "MCP_LOG_LEVEL": "info"
181
+ }
182
+ }
183
+ }
184
+ }
185
+ ```
186
+
187
+ Or with Docker:
188
+
189
+ ```json
190
+ {
191
+ "mcpServers": {
192
+ "eurostat": {
193
+ "type": "stdio",
194
+ "command": "docker",
195
+ "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/eurostat-mcp-server:latest"]
196
+ }
197
+ }
198
+ }
199
+ ```
200
+
201
+ For Streamable HTTP, set the transport and start the server:
202
+
203
+ ```sh
204
+ MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
205
+ # Server listens at http://localhost:3010/mcp
206
+ ```
207
+
208
+ ### Prerequisites
209
+
210
+ - [Bun v1.3.2](https://bun.sh/) or higher. No API key required — Eurostat's dissemination API is public.
211
+
212
+ ### Installation
213
+
214
+ 1. **Clone the repository:**
215
+
216
+ ```sh
217
+ git clone https://github.com/cyanheads/eurostat-mcp-server.git
218
+ ```
219
+
220
+ 2. **Navigate into the directory:**
221
+
222
+ ```sh
223
+ cd eurostat-mcp-server
224
+ ```
225
+
226
+ 3. **Install dependencies:**
227
+
228
+ ```sh
229
+ bun install
230
+ ```
231
+
232
+ ## Configuration
233
+
234
+ All configuration is validated at startup via Zod schemas in `src/config/server-config.ts`. Key environment variables:
235
+
236
+ | Variable | Description | Default |
237
+ |:---|:---|:---|
238
+ | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http` | `stdio` |
239
+ | `MCP_HTTP_PORT` | HTTP server port | `3010` |
240
+ | `MCP_HTTP_ENDPOINT_PATH` | HTTP endpoint path | `/mcp` |
241
+ | `MCP_PUBLIC_URL` | Public origin override for TLS-terminating reverse-proxy deployments | none |
242
+ | `MCP_AUTH_MODE` | Authentication: `none`, `jwt`, or `oauth` | `none` |
243
+ | `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`, etc.) | `info` |
244
+ | `MCP_GC_PRESSURE_INTERVAL_MS` | Opt-in Bun-only forced-GC pressure loop (ms). Recommended starting point if heap growth is observed: `60000`. | `0` (disabled) |
245
+ | `LOGS_DIR` | Directory for log files (Node.js only) | `<project-root>/logs` |
246
+ | `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1` | `in-memory` |
247
+ | `EUROSTAT_BASE_URL` | Eurostat API base URL | `https://ec.europa.eu/eurostat/api/dissemination` |
248
+ | `EUROSTAT_REQUEST_TIMEOUT_MS` | HTTP request timeout in ms | `30000` |
249
+ | `OTEL_ENABLED` | Enable OpenTelemetry | `false` |
250
+
251
+ ## Running the server
252
+
253
+ ### Local development
254
+
255
+ - **Build and run the production version**:
256
+
257
+ ```sh
258
+ # One-time build
259
+ bun run rebuild
260
+
261
+ # Run the built server
262
+ bun run start:http
263
+ # or
264
+ bun run start:stdio
265
+ ```
266
+
267
+ - **Run checks and tests**:
268
+ ```sh
269
+ bun run devcheck # Lints, formats, type-checks, and more
270
+ bun run test # Runs the test suite
271
+ ```
272
+
273
+ ## Project structure
274
+
275
+ | Directory | Purpose |
276
+ |:---|:---|
277
+ | `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Five tools for discovery and data access. |
278
+ | `src/mcp-server/resources` | Resource definitions. Dataset metadata resource. |
279
+ | `src/services/eurostat-catalogue` | Catalogue service — fetches and parses the Eurostat TOC TXT file; session-level in-memory cache. |
280
+ | `src/services/eurostat-data` | Data service — Statistics API HTTP client, JSON-stat 2.0 decoder, async-response detection. |
281
+ | `src/config` | Server-specific environment variable parsing and validation with Zod. |
282
+ | `tests/` | Unit and integration tests, mirroring the `src/` structure. |
283
+
284
+ ## Development guide
285
+
286
+ See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
287
+
288
+ - Handlers throw, framework catches — no `try/catch` in tool logic
289
+ - Use `ctx.log` for logging, `ctx.state` for storage
290
+ - Register new tools and resources in the `createApp()` arrays
291
+
292
+ ## Contributing
293
+
294
+ Issues and pull requests are welcome. Run checks and tests before submitting:
295
+
296
+ ```sh
297
+ bun run devcheck
298
+ bun run test
299
+ ```
300
+
301
+ ## License
302
+
303
+ This project is licensed under the Apache 2.0 License. See the [LICENSE](./LICENSE) file for details.
@@ -0,0 +1,20 @@
1
+ ---
2
+ summary: "Initial release — Eurostat statistical data server with 5 tools and 1 resource"
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.1.0 — 2026-05-23
8
+
9
+ ## Added
10
+
11
+ - **`eurostat_search_datasets`** — keyword search across 8,933 Eurostat datasets using the session-cached TOC TXT file
12
+ - **`eurostat_browse_themes`** — tree navigation of the Eurostat theme hierarchy (11 root themes, hierarchical subthemes)
13
+ - **`eurostat_get_dataset_info`** — dataset metadata including dimensions, valid values, time range, obs count, and last-updated date
14
+ - **`eurostat_get_dimension_values`** — full list of valid values for a specific dataset dimension; supports NUTS geo-level filtering
15
+ - **`eurostat_query_dataset`** — decoded JSON-stat 2.0 observations with dimension filters, NUTS geo-level, and time-range support
16
+ - **`eurostat://dataset/{dataset_code}`** resource — dataset metadata accessible by URI
17
+ - `EurostatCatalogueService` — fetches and parses the TOC TXT file; session-level in-memory cache for search and tree navigation
18
+ - `EurostatDataService` — Statistics API HTTP client with JSON-stat 2.0 stride-based decoder, async-response detection, and retry logic
19
+ - `EUROSTAT_BASE_URL` env var — override API base URL (default: `https://ec.europa.eu/eurostat/api/dissemination`)
20
+ - `EUROSTAT_REQUEST_TIMEOUT_MS` env var — HTTP request timeout in ms (default: `30000`)
@@ -0,0 +1,21 @@
1
+ ---
2
+ summary: "First public release — 5 tools, 1 resource, full Eurostat implementation covering 8,900+ datasets and NUTS regional data"
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.1.1 — 2026-05-23
8
+
9
+ ## Added
10
+
11
+ - **`eurostat_search_datasets`** — keyword search across 8,933 Eurostat datasets using a session-cached TOC TXT file
12
+ - **`eurostat_browse_themes`** — hierarchical navigation of the Eurostat theme tree (11 root themes)
13
+ - **`eurostat_get_dataset_info`** — dataset metadata: dimensions, valid values, time range, obs count, last-updated date
14
+ - **`eurostat_get_dimension_values`** — full value list for a specific dataset dimension; supports NUTS geo-level filtering
15
+ - **`eurostat_query_dataset`** — decoded JSON-stat 2.0 observations with dimension filters, NUTS geo-level, and time-range support
16
+ - **`eurostat://dataset/{dataset_code}`** resource — dataset metadata accessible by URI
17
+ - `EurostatCatalogueService` — fetches and parses the TOC TXT file with session-level in-memory cache
18
+ - `EurostatDataService` — Statistics API HTTP client with JSON-stat 2.0 stride decoder, async-response polling, and retry logic
19
+ - `EUROSTAT_BASE_URL` env var — override API base URL (default: `https://ec.europa.eu/eurostat/api/dissemination`)
20
+ - `EUROSTAT_REQUEST_TIMEOUT_MS` env var — HTTP request timeout in ms (default: `30000`)
21
+ - 37 tests across all tools and the dataset resource
@@ -0,0 +1,119 @@
1
+ ---
2
+ # FORMAT REFERENCE — do not edit. Copy this file to
3
+ # `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.8.x/0.8.6.md`)
4
+ # to author a new release. Set that file's H1 to `# <version> — YYYY-MM-DD`
5
+ # with a concrete date.
6
+
7
+ # Required. One-line GitHub Release-style headline. 350 character cap.
8
+ # Default short and scannable. Don't pad, don't stitch unrelated changes with
9
+ # semicolons — pick the headline. Quotes required: unquoted YAML treats `: `
10
+ # inside the value as a key separator and fails GitHub's strict parser.
11
+ summary: ""
12
+
13
+ # Set `true` when consumers must change code to upgrade: API removals,
14
+ # signature changes, config renames, behavior changes that break existing
15
+ # usage. Flagged as `Breaking` in the rollup.
16
+ breaking: false
17
+
18
+ # Set `true` if this release contains any security fix. Pairs with the
19
+ # `## Security` section below. Flagged as `Security` in the rollup so
20
+ # users can triage upgrade urgency at a glance.
21
+ security: false
22
+ ---
23
+
24
+ # <version> — YYYY-MM-DD
25
+
26
+ <!--
27
+ AUTHORING GUIDE — applies to the new per-version file you create from this
28
+ template.
29
+
30
+ Audience: someone scanning release notes to decide what affects them. Lead
31
+ each bullet with the symbol or concept name in **bold** so they can skip
32
+ what's irrelevant and zoom in on what's not.
33
+
34
+ Tone: terse, fact-dense, not verbose. Default to one sentence per bullet —
35
+ name the symbol, state what changed, stop. Use a second sentence only when
36
+ it carries weight. If a bullet feels long, it is.
37
+
38
+ Cut: mechanism walkthroughs (those belong in JSDoc, AGENTS.md, or the
39
+ relevant skill), ceremonial framings ("This release introduces…",
40
+ backwards-compat paragraphs), file-by-file test enumerations, internal
41
+ implementation notes. Prefer code/symbol names over English re-explanations.
42
+
43
+ Narrative intro: skip by default. Add one short sentence only when the
44
+ release theme genuinely needs framing the bullets can't carry.
45
+
46
+ Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
47
+ Fixed, Security. Include only sections with entries; delete the rest
48
+ (including the commented-out scaffolding below). Don't ship empty headers.
49
+
50
+ Include: every distinct fact a reader needs to adopt or audit the release —
51
+ new exports, signatures, lint rule IDs, env vars, breaking changes, version
52
+ bumps on shipped skills. Nothing more.
53
+
54
+ Links: link issues, PRs, docs, or skills where they help a reader jump to
55
+ context. Once per item per entry — don't re-link the same issue in summary,
56
+ narrative, and bullet. Skip links for inline symbol names; code spans speak
57
+ for themselves.
58
+
59
+ Issue/PR URLs: use full URLs. GitHub's bare `#NN` auto-link only resolves
60
+ inside its own UI, not in npm reads or local editors.
61
+
62
+ [#38](https://github.com/cyanheads/mcp-ts-core/issues/38) ← issue
63
+ [#42](https://github.com/cyanheads/mcp-ts-core/pull/42) ← PR
64
+
65
+ Verify numbers exist before linking (`gh issue view NN`, `gh pr view NN`).
66
+ Never speculate on a future number — `#42` for an upcoming PR silently
67
+ resolves to whatever real item already owns 42, and timeline previews pull
68
+ in that unrelated item's metadata.
69
+
70
+ TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
71
+ via `gh release create --notes-from-tag`. The tag is a derivative of this
72
+ changelog entry — a condensed, scannable version, not a copy. Format:
73
+
74
+ <theme — omit version number, GitHub prepends it>
75
+ ← blank line
76
+ <1-2 sentence context: what this release does>
77
+ ← blank line
78
+ Dependency bumps: ← section header
79
+ ← blank line
80
+ - `@cyanheads/mcp-ts-core` ^0.9.1 → ^0.9.6 ← bullet
81
+ ← blank line
82
+ Changed: ← only sections with entries
83
+ ← blank line
84
+ - `format()` output includes `query` in text mode
85
+ ← blank line
86
+ Added:
87
+ ← blank line
88
+ - `manifest.json` scaffolded for MCPB bundle support
89
+ - Install badges (Claude Desktop, Cursor, VS Code)
90
+ ← blank line
91
+ <N> tests pass; `bun run devcheck` clean. ← footer
92
+
93
+ Never a flat comma-separated string. Always structured markdown with
94
+ sections. The tag must scan well as a rendered GitHub Release page.
95
+ -->
96
+
97
+ ## Added
98
+
99
+ -
100
+
101
+ ## Changed
102
+
103
+ -
104
+
105
+ <!-- ## Deprecated
106
+
107
+ - -->
108
+
109
+ <!-- ## Removed
110
+
111
+ - -->
112
+
113
+ ## Fixed
114
+
115
+ -
116
+
117
+ <!-- ## Security
118
+
119
+ - -->