Skip to main content
Glama
pyrfor

fsnb-mcp

by pyrfor
README.md
# fsnb-mcp

[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)

**Offline MCP access to official Russian construction norms (ФСНБ-2022 / ГЭСН).**  
Agents look up rates, search text, and pull resource composition from a local SQLite DB — no network after ingest.

## Proof — five tools

| Tool | Job |
|------|-----|
| `fsnb_rate_get` | Rate by code (`gesn:01-01-001-01` or `01-01-001-01`) |
| `fsnb_search` | Full-text search (FTS5, Cyrillic) |
| `fsnb_rate_composition` | Labor / machines / materials consumption norms |
| `fsnb_validate_code` | Does this code exist? |
| `fsnb_meta` | Manifest + legal basis for the data set |

Sample DB ships with **10 real rates**. Full base is built locally from FGISC XML (not vendored in the npm package).

## First use

```bash
npm install && npm run build && npm run build:sample
```

Requires **Node.js ≥ 22** (`node:sqlite` + FTS5).

MCP client config:

```json
{
  "mcpServers": {
    "fsnb-mcp": {
      "command": "node",
      "args": ["/path/to/fsnb-mcp/dist/index.js"],
      "env": {
        "FSNB_DB": "/path/to/fsnb-mcp/samples/sample.sqlite"
      }
    }
  }
}
```

Env:

- `FSNB_DB` — path to sqlite (wins)
- `FSNB_DATA_DIR` — data dir (default `~/.fsnb-mcp/data`, file `fsnb.sqlite`)

Full DB after downloading FGISC open data: `node scripts/ingest/fgiscs-xml.mjs`.

## Data & attribution (required)

Normative data comes from the official FGISC open-data set **«ФСНБ-2022»** (Minstroy):  
https://fgiscs.minstroyrf.ru/opendata/7707082071-fsnb

**Use (including commercial) is allowed only with attribution** to that portal.

Software legal basis: Minstroy letter №4350-ИТ/09 (2021-02-08) — no ban on software that automates estimate docs from FRSN/FGISC norms.

The server is **read-only** and does not call the network at runtime.

## Develop

```bash
npm install
npm run build
npm test
npm run build:sample
```

## License

MIT (code). FSNB data is licensed separately — see **Data & attribution**.

---

## Русский (кратко)

MCP-сервер для **офлайн** доступа к нормам ФСНБ-2022 (ГЭСН) через SQLite + FTS5. Данные — из открытого набора ФГИС ЦС; **ссылка на первоисточник обязательна**. Пять инструментов в таблице выше. Код — MIT; данные — по условиям портала Минстроя.

TDQS

A3.6/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: retrieve a specific norm by code, perform full-text search, and validate code existence. No overlap or ambiguity.

Naming Consistency4/5

All tools use the 'fsnb_' prefix and underscore style, but the order of verb and object varies: 'rate_get' (object+verb), 'search' (verb-only), 'validate_code' (verb+object). Mostly consistent but not perfectly uniform.

Tool Count4/5

3 tools is minimal but well-scoped for a norm lookup service: search, get by code, and validate. Not too many or too few for the intended functionality.

Completeness4/5

Covers essential read operations: retrieval, search, and existence check. Minor gaps like pagination or listing all codes are absent but not critical for the domain.

Maintenance

ActivitySlowing
ResponsivenessNo issues