@statsmcp/ibge 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/ibge
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 [SIDRA](https://sidra.ibge.gov.br/), the aggregate tables of IBGE, the national statistics office of Brazil. It gives AI assistants access to more than 9,000 tables in Portuguese.
4
+
5
+ > This project is not affiliated with or endorsed by IBGE.
6
+
7
+ ## Use the server
8
+
9
+ ### Hosted
10
+
11
+ Add `https://statsmcp.dev/br/mcp` as a remote MCP server. It uses Streamable HTTP and needs no authentication. For the steps for each client, refer to [statsmcp.dev/brazil](https://statsmcp.dev/brazil/).
12
+
13
+ ### Local
14
+
15
+ You need Node.js 20 or later.
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "ibge": { "command": "npx", "args": ["-y", "@statsmcp/ibge"] }
21
+ }
22
+ }
23
+ ```
24
+
25
+ For Claude Code:
26
+
27
+ ```sh
28
+ claude mcp add ibge -- npx -y @statsmcp/ibge
29
+ ```
30
+
31
+ The server reads the table list from the IBGE API and searches it locally.
32
+
33
+ ## Tools
34
+
35
+ | Tool | What it does |
36
+ | -------------------- | ----------------------------------------------------------------------------------------------------------- |
37
+ | `search_tables` | Finds tables by keywords in Portuguese. |
38
+ | `get_table_metadata` | Lists the variables, classifications, localities and periods of a table. 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/ibge
47
+ ```
48
+
49
+ ```ts
50
+ import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
51
+ import { createIbgeServer } from '@statsmcp/ibge';
52
+
53
+ const server = createIbgeServer({ userAgent: 'my-app/1.0' });
54
+ await server.connect(new StdioServerTransport());
55
+ ```
56
+
57
+ `createIbgeServer` returns an `McpServer`. It also accepts a `cache`.
58
+
59
+ ## Data licence and attribution
60
+
61
+ IBGE data is federal open data of Brazil. The open data policy ([Decreto 8.777/2016](https://www.planalto.gov.br/ccivil_03/_ato2015-2018/2016/decreto/d8777.htm)) makes it free to use, limited to crediting the source: `Fonte: IBGE`.
62
+
63
+ Each result contains the source line and a link to the SIDRA table.
64
+
65
+ ## Licence
66
+
67
+ The code is under the MIT licence. The data belongs to IBGE.
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 createIbgeServer } from "./src-DZRWXtsG.mjs";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
4
+ // src/bin.ts
5
+ await createIbgeServer().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 ibgePreset: PxwebPreset;
4
+ export type IbgeServerOptions = Pick<PresetServerOptions, 'cache' | 'userAgent'>;
5
+ export declare function createIbgeServer(options?: IbgeServerOptions): McpServer;
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export { t as createIbgeServer, n as ibgePreset } from "./src-DZRWXtsG.mjs";
@@ -0,0 +1,53 @@
1
+ import { createPresetServer } from "@statsmcp/core";
2
+ // src/preset.ts
3
+ const ATTRIBUTION = {
4
+ pt: "Fonte: IBGE",
5
+ en: "Source: IBGE, Brazilian Institute of Geography and Statistics"
6
+ };
7
+ const ibgePreset = {
8
+ name: "ibge",
9
+ title: "SIDRA, the aggregate tables of IBGE (official statistics of Brazil)",
10
+ version: "0.6.0",
11
+ apiBaseUrl: "https://servicodados.ibge.gov.br/api/v3/agregados",
12
+ api: "ibge",
13
+ languages: ["pt"],
14
+ attribution: (lang) => lang === "pt" ? ATTRIBUTION.pt : ATTRIBUTION.en,
15
+ tableUrl: (_lang, tableId) => `https://sidra.ibge.gov.br/tabela/${encodeURIComponent(tableId)}`,
16
+ instructions: `Official statistics for Brazil from SIDRA, the aggregate tables of IBGE. This server is not affiliated with or endorsed by IBGE.
17
+
18
+ To answer a question with data:
19
+ 1. Call \`search_tables\` with short topic keywords in Portuguese ("pt"), for example "IPCA", "taxas de desocupação e de subutilização" or "população residente estimada". Table ids are SIDRA table numbers, for example 1737 for the IPCA. Results marked "archived" are discontinued series.
20
+ 2. Call \`get_table_metadata\` on the best table. The variable "variavel" lists the measures; variables named "Coeficiente de variação" are sampling errors, not data. Localities have codes such as N1:1 (Brasil), N3:35 (a state) and N6:3550308 (a municipality); use \`valueFilter\` to find a municipality by name.
21
+ 3. Call \`query_table\` with only the values you need. Use \`latest\` on "periodo" for recent periods. A left-out locality gives Brasil; a left-out optional classification gives its total.
22
+
23
+ Always cite the source line that each result ends with.`,
24
+ maxCells: 5e3,
25
+ searchLimit: 10,
26
+ searchAliases: { pt: [
27
+ {
28
+ terms: [
29
+ "inflação",
30
+ "inflacao",
31
+ "preços ao consumidor"
32
+ ],
33
+ query: "IPCA"
34
+ },
35
+ {
36
+ terms: ["desemprego"],
37
+ query: "taxas de desocupação e de subutilização"
38
+ },
39
+ {
40
+ terms: [
41
+ "população",
42
+ "populacao",
43
+ "habitantes"
44
+ ],
45
+ query: "população residente estimada"
46
+ }
47
+ ] }
48
+ };
49
+ // src/index.ts
50
+ function createIbgeServer(options = {}) {
51
+ return createPresetServer(ibgePreset, options);
52
+ }
53
+ export { ibgePreset as n, createIbgeServer as t };
package/package.json CHANGED
@@ -1,6 +1,57 @@
1
1
  {
2
2
  "name": "@statsmcp/ibge",
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 SIDRA, the aggregate tables of IBGE (Brazil)",
5
+ "license": "MIT",
6
+ "author": "Tadej Polajnar",
7
+ "homepage": "https://statsmcp.dev/brazil/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Stats-MCP/statsmcp.git",
11
+ "directory": "packages/ibge"
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
+ "ibge",
23
+ "sidra",
24
+ "brazil",
25
+ "statistics"
26
+ ],
27
+ "bin": {
28
+ "ibge-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
  }