@statsmcp/osp 0.0.0-stage → 0.5.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/osp
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 [Official Statistics Portal](https://osp.stat.gov.lt/) of Lithuania, run by the State Data Agency (Statistics Lithuania). It gives AI assistants access to its tables in Lithuanian and English.
4
+
5
+ > This project is not affiliated with or endorsed by the State Data Agency.
6
+
7
+ ## Use the server
8
+
9
+ ### Hosted
10
+
11
+ Add `https://statsmcp.dev/lt/mcp` as a remote MCP server. It uses Streamable HTTP and needs no authentication. For the steps for each client, refer to [statsmcp.dev/lithuania](https://statsmcp.dev/lithuania/).
12
+
13
+ ### Local
14
+
15
+ You need Node.js 20 or later.
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "osp": { "command": "npx", "args": ["-y", "@statsmcp/osp"] }
21
+ }
22
+ }
23
+ ```
24
+
25
+ For Claude Code:
26
+
27
+ ```sh
28
+ claude mcp add osp -- npx -y @statsmcp/osp
29
+ ```
30
+
31
+ The server reads the table list from the SDMX API of the portal and searches it locally.
32
+
33
+ ## Tools
34
+
35
+ | Tool | What it does |
36
+ | -------------------- | ----------------------------------------------------------------------------------------- |
37
+ | `search_tables` | Finds tables by keywords in Lithuanian or English. |
38
+ | `get_table_metadata` | Lists the dimensions 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/osp
47
+ ```
48
+
49
+ ```ts
50
+ import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
51
+ import { createOspServer } from '@statsmcp/osp';
52
+
53
+ const server = createOspServer({ userAgent: 'my-app/1.0' });
54
+ await server.connect(new StdioServerTransport());
55
+ ```
56
+
57
+ `createOspServer` returns an `McpServer`. It also accepts a `cache`.
58
+
59
+ ## Data licence and attribution
60
+
61
+ The Law on the Right of Access to Information and the Re-use of Data ([VIII-1524](https://e-seimas.lrs.lt/rs/legalact/TAD/be093fa03dca11efb121d2fe3a0eff27/)) allows re-use of the data for commercial or non-commercial purposes without consent. You must name the source and the date of retrieval, must not distort the data, and must not suggest that the institution sponsors your service.
62
+
63
+ Each result contains the source line and a link to the indicator; each table title shows the retrieval date.
64
+
65
+ ## Licence
66
+
67
+ The code is under the MIT licence. The data belongs to the State Data Agency.
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 createOspServer } from "./src-CaJeL6Fm.mjs";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
4
+ // src/bin.ts
5
+ await createOspServer().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 ospPreset: PxwebPreset;
4
+ export type OspServerOptions = Pick<PresetServerOptions, 'cache' | 'userAgent'>;
5
+ export declare function createOspServer(options?: OspServerOptions): McpServer;
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export { t as createOspServer, n as ospPreset } from "./src-CaJeL6Fm.mjs";
@@ -0,0 +1,48 @@
1
+ import { createPresetServer } from "@statsmcp/core";
2
+ // src/preset.ts
3
+ const ATTRIBUTION = {
4
+ lt: "Šaltinis: Valstybės duomenų agentūra, Oficialiosios statistikos portalas (https://osp.stat.gov.lt)",
5
+ en: "Source: State Data Agency (Statistics Lithuania), Official Statistics Portal (https://osp.stat.gov.lt)"
6
+ };
7
+ const ospPreset = {
8
+ name: "osp",
9
+ title: "Official Statistics Portal of Lithuania (State Data Agency official statistics)",
10
+ version: "0.5.0",
11
+ apiBaseUrl: "https://osp-rs.stat.gov.lt/ords/ipospp/ospp/rest_xml",
12
+ api: "osp",
13
+ languages: ["lt", "en"],
14
+ attribution: (lang) => lang === "lt" ? ATTRIBUTION.lt : ATTRIBUTION.en,
15
+ tableUrl: (lang, tableId) => {
16
+ const indicator = encodeURIComponent(tableId.split("_")[0] ?? tableId);
17
+ return `https://osp.stat.gov.lt${lang === "lt" ? "" : "/en"}/statistiniu-rodikliu-analize?indicator=${indicator}`;
18
+ },
19
+ instructions: `Official statistics for Lithuania from the Official Statistics Portal of the State Data Agency (Statistics Lithuania). This server is not affiliated with or endorsed by the State Data Agency.
20
+
21
+ To answer a question with data:
22
+ 1. Call \`search_tables\` with short topic keywords in Lithuanian ("lt") or English ("en"). One indicator has several tables, one per breakdown, so choose by the dimensions in the title. Lithuanian labels are more complete than English ones.
23
+ 2. Call \`get_table_metadata\` on the best table. Periods are written 2026M10, 2026K3, 2026P1 and 2025-2026.
24
+ 3. Call \`query_table\` with only the values you need. Use \`latest\` on the time variable for recent periods. Large tables allow only a few periods in one query. A status column shows official symbols, for example "confidential".
25
+
26
+ Always cite the source line that each result ends with, with the retrieval date from the title. Do not change the meaning of the data.`,
27
+ maxCells: 5e3,
28
+ searchLimit: 10,
29
+ searchAliases: {
30
+ en: [{
31
+ terms: [
32
+ "consumer price index",
33
+ "cpi",
34
+ "inflation"
35
+ ],
36
+ query: "consumer price changes"
37
+ }],
38
+ lt: [{
39
+ terms: ["infliacija"],
40
+ query: "vartotojų kainų"
41
+ }]
42
+ }
43
+ };
44
+ // src/index.ts
45
+ function createOspServer(options = {}) {
46
+ return createPresetServer(ospPreset, options);
47
+ }
48
+ export { ospPreset as n, createOspServer as t };
package/package.json CHANGED
@@ -1,6 +1,57 @@
1
1
  {
2
2
  "name": "@statsmcp/osp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.5.0",
4
+ "description": "MCP server for the Official Statistics Portal of Lithuania",
5
+ "license": "MIT",
6
+ "author": "Tadej Polajnar",
7
+ "homepage": "https://statsmcp.dev/lithuania/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Stats-MCP/statsmcp.git",
11
+ "directory": "packages/osp"
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
+ "osp",
23
+ "statistics-lithuania",
24
+ "lithuania",
25
+ "statistics"
26
+ ],
27
+ "bin": {
28
+ "osp-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.5.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
  }