@vargov/mcp 0.1.0 → 0.2.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/dist/bim.js CHANGED
@@ -6,11 +6,12 @@
6
6
  // - docs/ssylka-i-tekst-dlya-tz.md of the configurator (link keys; the "Share" button).
7
7
  import { findEntry, hasMountScheme, kindNotes, mountSchemeNote } from './catalog.js';
8
8
  import { getData } from './data.js';
9
+ import { dealerRouteLine } from './dealers.js';
9
10
  function statusEn(code, kind, configurable, page) {
10
11
  if (!configurable) {
11
12
  return (`## ${code}: calculated individually\n\n` +
12
13
  `The configurator does not calculate ${code}, so there is no IFC4 export, no FBX export, no PDF specification from the configurator and no 1:1 ceiling drawing for it, and the production brief cannot be started for it (360 of the 605 compositions open with a full calculation; this one is not among them). ` +
13
- `Product page: ${page}. For a calculation contact the brand: info@vargov.ru, WhatsApp +7 916 537 33 52, Telegram @AntonVargov.\n`);
14
+ `Product page: ${page}. For a calculation contact the brand: info@vargov.ru, WhatsApp +7 916 537 33 52, Telegram @AntonVargov. ${dealerRouteLine('en')}\n`);
14
15
  }
15
16
  const lines = [`## ${code}: opens in the configurator with a full calculation (${kind})`, ''];
16
17
  lines.push(`IFC4 (BIM) and FBX (3ds Max) are exported by the visitor; the PDF specification and the tender sheet come from the same "Documents" drawer.`);
@@ -24,7 +25,7 @@ function statusRu(code, kind, configurable, page) {
24
25
  if (!configurable) {
25
26
  return (`## ${code}: рассчитывается индивидуально\n\n` +
26
27
  `Конфигуратор не рассчитывает ${code}: у этой композиции нет выгрузки IFC4 и FBX, нет PDF-спецификации из конфигуратора и нет монтажной схемы 1:1, ТЗ на производство для неё не заводится (с полным расчётом открываются 360 композиций из 605; этой среди них нет). ` +
27
- `Карточка: ${page}. За расчётом — к бренду: info@vargov.ru, WhatsApp +7 916 537 33 52, Telegram @AntonVargov.\n`);
28
+ `Карточка: ${page}. За расчётом — к бренду: info@vargov.ru, WhatsApp +7 916 537 33 52, Telegram @AntonVargov. ${dealerRouteLine('ru')}\n`);
28
29
  }
29
30
  const kindRu = { cloud: 'облако элементов', ribbon: 'лента', chain: 'цепочка', frame: 'композиция на каркасе', 'ready-scene': 'готовая сцена' };
30
31
  const lines = [`## ${code}: открывается в конфигураторе с полным расчётом (${kindRu[kind ?? 'cloud'] ?? kind})`, ''];
package/dist/brand.js CHANGED
@@ -3,6 +3,7 @@
3
3
  import { bimCounts } from './bim.js';
4
4
  import { CONFIGURATOR_INTL, CONFIGURATOR_RU, SITE } from './catalog.js';
5
5
  import { FAMILIES, getData } from './data.js';
6
+ import { dealerForCountry } from './dealers.js';
6
7
  const FAMILY_PAGES = {
7
8
  lighting: 'lighting',
8
9
  decorative: 'decorative',
@@ -94,6 +95,9 @@ export function brandFacts(lang = 'en') {
94
95
  telegram_channel: '@vargov_design (https://t.me/vargov_design)',
95
96
  },
96
97
  dealers: {
98
+ who_supplies_and_installs: dealerForCountry(undefined, lang).who_supplies_and_installs,
99
+ regions: dealerForCountry(undefined, lang).regions,
100
+ by_country: 'dealer_for_country tool: the regional dealer for a country (name in English or Russian, or ISO code)',
97
101
  official_dealers_page: ru ? `${SITE}/official-dealers` : `${SITE}/en/official-dealers`,
98
102
  installations_page: ru ? `${SITE}/official-dealers` : `${SITE}/en/official-dealers`,
99
103
  installations_list: 'https://raw.githubusercontent.com/vargov3-spec/vargov-ai-kb/main/knowledge/installations.md',
package/dist/catalog.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // Tool logic: search, composition card, configurator link. Pure functions over getData().
2
2
  import { FAMILIES, LANGS, getData, normalizeCode } from './data.js';
3
+ import { dealerRouteLine } from './dealers.js';
3
4
  export const SEARCH_LIMIT_MAX = 50;
4
5
  export const SEARCH_LIMIT_DEFAULT = 10;
5
6
  const TEXT_CAP = 2000;
@@ -244,6 +245,7 @@ export function compositionCard(codeInput, lang = 'en') {
244
245
  configurator,
245
246
  elements_in_stock: 'Stock changes four times a day; see https://vargov.ru/en/in-stock',
246
247
  not_published: 'No price, no materials and no composition dimensions are published: every composition is made to order and scaled to the room. Quotes come per request (info@vargov.ru, WhatsApp +7 916 537 33 52, Telegram @AntonVargov).',
248
+ supply_and_installation: dealerRouteLine('en'),
247
249
  };
248
250
  }
249
251
  /** The configurator does not build a plan smaller than 300 × 300 mm (link-keys contract, memory of the configurator's author, 25.09.2026). */
@@ -0,0 +1,171 @@
1
+ // dealer_for_country: which official dealer handles supply and installation for a given country.
2
+ //
3
+ // Regions and wording follow the answers published on vargov.ru (FAQ and /official-dealers, Q101, Q102,
4
+ // Q074, Q168; checked 2026-11-19). Dealer phone numbers and e-mails are deliberately NOT bundled: they live
5
+ // on the site's official dealers page only, so an offline copy can never go stale — the answer gives the
6
+ // page and the brand's direct contacts instead.
7
+ import { getData } from './data.js';
8
+ // Same value as catalog.ts SITE; kept local so catalog.ts and bim.ts can import this module without a cycle.
9
+ const SITE = 'https://vargov.ru';
10
+ export const DEALER_REGIONS = [
11
+ {
12
+ id: 'russia-cis',
13
+ city_en: 'Moscow, Russia',
14
+ city_ru: 'Москва, Россия',
15
+ region_en: 'Russia and the CIS',
16
+ region_ru: 'Россия и страны СНГ',
17
+ countries: ['RU', 'BY', 'KZ', 'AM', 'AZ', 'KG', 'MD', 'TJ', 'UZ', 'TM'],
18
+ },
19
+ {
20
+ id: 'hanoi',
21
+ city_en: 'Hanoi, Vietnam',
22
+ city_ru: 'Ханой, Вьетнам',
23
+ region_en: 'Vietnam, Laos, Cambodia, Thailand, Malaysia and Singapore',
24
+ region_ru: 'Вьетнам, Лаос, Камбоджа, Таиланд, Малайзия и Сингапур',
25
+ countries: ['VN', 'LA', 'KH', 'TH', 'MY', 'SG'],
26
+ },
27
+ {
28
+ id: 'dubai',
29
+ city_en: 'Dubai, UAE',
30
+ city_ru: 'Дубай, ОАЭ',
31
+ region_en: 'the Persian Gulf, Middle East, Americas, Europe, Asia, Africa and other regions',
32
+ region_ru: 'Персидский залив, Ближний Восток, Америка, Европа, Азия, Африка и другие регионы',
33
+ countries: [],
34
+ },
35
+ ];
36
+ // Names people actually type that ICU does not list as a country name.
37
+ const ALIASES = {
38
+ uae: 'AE', emirates: 'AE', 'the emirates': 'AE', dubai: 'AE', 'abu dhabi': 'AE', sharjah: 'AE', 'al ain': 'AE',
39
+ 'оаэ': 'AE', 'эмираты': 'AE', 'дубай': 'AE', 'абу-даби': 'AE', 'абу даби': 'AE', 'шарджа': 'AE',
40
+ usa: 'US', 'u.s.': 'US', 'u.s.a.': 'US', america: 'US', 'сша': 'US', 'америка': 'US',
41
+ uk: 'GB', britain: 'GB', 'great britain': 'GB', england: 'GB', 'англия': 'GB', 'великобритания': 'GB',
42
+ russia: 'RU', 'russian federation': 'RU', moscow: 'RU', 'saint petersburg': 'RU', 'st petersburg': 'RU',
43
+ 'рф': 'RU', 'москва': 'RU', 'санкт-петербург': 'RU', 'петербург': 'RU', 'казань': 'RU', 'сочи': 'RU',
44
+ hanoi: 'VN', 'ho chi minh city': 'VN', saigon: 'VN', 'ханой': 'VN', 'хошимин': 'VN',
45
+ ksa: 'SA', riyadh: 'SA', jeddah: 'SA', 'эр-рияд': 'SA', doha: 'QA', 'доха': 'QA', muscat: 'OM', 'маскат': 'OM',
46
+ bangkok: 'TH', 'бангкок': 'TH', 'kuala lumpur': 'MY', 'куала-лумпур': 'MY', almaty: 'KZ', astana: 'KZ', minsk: 'BY',
47
+ 'алматы': 'KZ', 'астана': 'KZ', 'минск': 'BY', 'ташкент': 'UZ', tashkent: 'UZ', baku: 'AZ', 'баку': 'AZ', yerevan: 'AM', 'ереван': 'AM',
48
+ };
49
+ // Codes Intl.DisplayNames knows that are not countries.
50
+ const NOT_COUNTRIES = new Set(['EU', 'EZ', 'UN', 'ZZ', 'QO', 'XA', 'XB']);
51
+ function norm(s) {
52
+ return s
53
+ .toLowerCase()
54
+ .replace(/ё/g, 'е')
55
+ .replace(/[«»"'’().,]/g, ' ')
56
+ .replace(/\s+/g, ' ')
57
+ .trim();
58
+ }
59
+ let nameIndex = null;
60
+ /** name (English or Russian, as ICU spells it) → ISO code, built once from Intl.DisplayNames. */
61
+ function names() {
62
+ if (nameIndex)
63
+ return nameIndex;
64
+ const idx = new Map();
65
+ const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
66
+ for (const loc of ['en', 'ru']) {
67
+ let dn;
68
+ try {
69
+ dn = new Intl.DisplayNames([loc], { type: 'region' });
70
+ }
71
+ catch {
72
+ continue;
73
+ }
74
+ for (const a of letters)
75
+ for (const b of letters) {
76
+ const code = a + b;
77
+ if (NOT_COUNTRIES.has(code))
78
+ continue;
79
+ let name;
80
+ try {
81
+ name = dn.of(code);
82
+ }
83
+ catch {
84
+ continue;
85
+ }
86
+ if (!name || name === code || /unknown region|неизвестный регион/i.test(name))
87
+ continue;
88
+ idx.set(norm(name), code);
89
+ }
90
+ }
91
+ for (const [k, v] of Object.entries(ALIASES))
92
+ idx.set(norm(k), v);
93
+ nameIndex = idx;
94
+ return idx;
95
+ }
96
+ /** ISO alpha-2 code for a country name, ISO code or a major city; null when not recognised. */
97
+ export function countryCode(input) {
98
+ const raw = input.trim();
99
+ if (!raw)
100
+ return null;
101
+ const idx = names();
102
+ if (/^[A-Za-z]{2}$/.test(raw)) {
103
+ const code = raw.toUpperCase();
104
+ return [...idx.values()].includes(code) ? code : null;
105
+ }
106
+ return idx.get(norm(raw)) ?? null;
107
+ }
108
+ function regionFor(code) {
109
+ return DEALER_REGIONS.find((r) => r.countries.includes(code)) ?? DEALER_REGIONS.find((r) => r.id === 'dubai');
110
+ }
111
+ function brandContacts() {
112
+ const org = getData().organization;
113
+ return {
114
+ email: org?.email ?? 'info@vargov.ru',
115
+ whatsapp: org?.telephone ?? '+7 916 537 33 52',
116
+ telegram: 'https://t.me/AntonVargov',
117
+ };
118
+ }
119
+ export function dealerForCountry(country, lang = 'en') {
120
+ const ru = lang === 'ru';
121
+ const page = ru ? `${SITE}/official-dealers` : `${SITE}/en/official-dealers`;
122
+ const regions = DEALER_REGIONS.map((r) => ({
123
+ id: r.id,
124
+ dealer_city: ru ? r.city_ru : r.city_en,
125
+ region: ru ? r.region_ru : r.region_en,
126
+ }));
127
+ const common = {
128
+ who_supplies_and_installs: ru
129
+ ? 'Три официальных дилера, каждый отвечает за поставку, монтаж и обслуживание композиций в своём регионе. Монтаж силами официальных монтажных партнёров — отдельная услуга, стоимость рассчитывается индивидуально; можно заказать и шеф-монтаж.'
130
+ : 'Three official dealers, each responsible for supply, installation and servicing of the compositions in its region. Installation by the official installation partners is a separate service, priced individually; supervised installation can also be ordered.',
131
+ dealer_contacts_page: page,
132
+ brand_direct_contacts: brandContacts(),
133
+ regions,
134
+ source: ru ? `${SITE}/faq` : `${SITE}/en/faq`,
135
+ };
136
+ const code = country ? countryCode(country) : null;
137
+ if (!country)
138
+ return { country: null, recommended: null, ...common };
139
+ if (!code) {
140
+ return {
141
+ country,
142
+ recommended: null,
143
+ note: ru
144
+ ? `Страну «${country}» не удалось распознать. Выберите регион из списка ниже; Дубай отвечает за все страны, не названные в двух других регионах.`
145
+ : `Could not recognise "${country}" as a country. Pick the region from the list below; Dubai covers every country not named in the other two regions.`,
146
+ ...common,
147
+ };
148
+ }
149
+ const r = regionFor(code);
150
+ const recommended = {
151
+ country_code: code,
152
+ dealer_region_id: r.id,
153
+ dealer_city: ru ? r.city_ru : r.city_en,
154
+ region: ru ? r.region_ru : r.region_en,
155
+ contacts: page,
156
+ orders: r.id === 'dubai'
157
+ ? ru
158
+ ? 'Заказы по Дубаю и этому региону принимает офис бренда в Дубае; контакты те же, что у дилера.'
159
+ : "Orders for Dubai and this region are accepted by the brand's office in Dubai; the contacts are the dealer's."
160
+ : ru
161
+ ? 'Контакты дилера региона — на странице дилеров; с заказом поможет и менеджер бренда (Telegram, WhatsApp, e-mail).'
162
+ : "The regional dealer's contacts are on the dealers page; the brand's manager also helps with the order (Telegram, WhatsApp, e-mail).",
163
+ };
164
+ return { country, recommended, ...common };
165
+ }
166
+ /** One line for texts that send the reader to "contact the brand": the regional dealer route. */
167
+ export function dealerRouteLine(lang) {
168
+ return lang === 'ru'
169
+ ? `В России и СНГ, в Персидском заливе и других регионах, во Вьетнаме и соседних странах за поставку и монтаж отвечает официальный дилер региона — контакты на ${SITE}/official-dealers (инструмент dealer_for_country подскажет дилера по стране).`
170
+ : `In Russia and the CIS, in the Persian Gulf and other regions, and in Vietnam and its neighbours, the regional official dealer handles supply and installation — contacts at ${SITE}/en/official-dealers (the dealer_for_country tool names the dealer for a country).`;
171
+ }
package/dist/server.js CHANGED
@@ -3,10 +3,11 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
3
  import { z } from 'zod';
4
4
  import { bimGuide } from './bim.js';
5
5
  import { brandFacts } from './brand.js';
6
+ import { dealerForCountry } from './dealers.js';
6
7
  import { SEARCH_LIMIT_DEFAULT, SEARCH_LIMIT_MAX, buildConfiguratorLink, compositionCard, isLinkError, searchCompositions } from './catalog.js';
7
8
  import { FAMILIES, LANGS, getData } from './data.js';
8
9
  export const SERVER_NAME = 'vargov-design';
9
- export const SERVER_VERSION = '0.1.0';
10
+ export const SERVER_VERSION = '0.2.0';
10
11
  const LangSchema = z.enum(LANGS);
11
12
  function textResult(payload, isError = false) {
12
13
  const text = typeof payload === 'string' ? payload : JSON.stringify(payload, null, 1);
@@ -15,7 +16,7 @@ function textResult(payload, isError = false) {
15
16
  export function createServer() {
16
17
  const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION }, {
17
18
  instructions: 'Vargov®Design: 605 made-to-order light and decorative compositions (codes LC0001…LC0602). ' +
18
- 'Use search_compositions to find candidates for a room, get_composition for the card, build_configurator_link to open the 3D configurator with the plan dimensions and ceiling height, how_to_get_bim for the IFC4/FBX steps, brand_facts for the brand card. ' +
19
+ 'Use search_compositions to find candidates for a room, get_composition for the card, build_configurator_link to open the 3D configurator with the plan dimensions and ceiling height, how_to_get_bim for the IFC4/FBX steps, brand_facts for the brand card, dealer_for_country for who supplies and installs in a given country. ' +
19
20
  'The brand publishes no prices, no materials and no composition dimensions: every composition is scaled to the room; quotes come per request. All data is bundled; the server makes no network calls.',
20
21
  });
21
22
  server.registerTool('search_compositions', {
@@ -91,6 +92,17 @@ export function createServer() {
91
92
  inputSchema: { lang: z.enum(['en', 'ru']).optional().describe('en (default) or ru for the wording fields') },
92
93
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
93
94
  }, async ({ lang }) => textResult(brandFacts(lang ?? 'en')));
95
+ server.registerTool('dealer_for_country', {
96
+ title: 'Official dealer for a country',
97
+ description: 'Who supplies, installs and services Vargov®Design compositions in a given country: the official dealer of that region (Moscow — Russia and the CIS; Hanoi — Vietnam, Laos, Cambodia, Thailand, Malaysia, Singapore; Dubai — the Persian Gulf, Middle East, Americas, Europe, Asia, Africa and every other country), ' +
98
+ 'the page with the dealer contacts, the brand\'s direct contacts, and the installation terms as published (a separate service priced individually; supervised installation available). ' +
99
+ 'country: a country name in English or Russian, an ISO 3166 alpha-2 code, or a major city (Dubai, Moscow, Hanoi…). Without country, returns all three regions.',
100
+ inputSchema: {
101
+ country: z.string().max(80).optional().describe('e.g. "United Arab Emirates", "UAE", "AE", "ОАЭ", "Dubai", "Казахстан"'),
102
+ lang: z.enum(['en', 'ru']).optional().describe('en (default) or ru'),
103
+ },
104
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
105
+ }, async ({ country, lang }) => textResult(dealerForCountry(country, lang ?? 'en')));
94
106
  const d = getData();
95
107
  server.registerResource('llms-vargov-en', 'llms://vargov', { title: 'Vargov®Design llms.txt (English)', description: 'en/llms.txt of the public knowledge base vargov3-spec/vargov-ai-kb: brand facts, catalogue, configurator, awards, contacts.', mimeType: 'text/plain' }, async (uri) => ({ contents: [{ uri: uri.href, mimeType: 'text/plain', text: d.llmsEn }] }));
96
108
  server.registerResource('llms-vargov-ru', 'llms://vargov/ru', { title: 'Vargov®Design llms.txt (Russian)', description: 'llms.txt of the public knowledge base, Russian.', mimeType: 'text/plain' }, async (uri) => ({ contents: [{ uri: uri.href, mimeType: 'text/plain', text: d.llmsRu }] }));
package/package.json CHANGED
@@ -1,54 +1,54 @@
1
- {
2
- "name": "@vargov/mcp",
3
- "version": "0.1.0",
4
- "mcpName": "io.github.vargov3-spec/vargov-mcp",
5
- "description": "MCP server for AI assistants: the Vargov®Design catalogue (605 made-to-order light and decorative compositions), configurator links with room dimensions, how to get IFC4 (BIM) and FBX files, brand facts. Offline: all data is bundled.",
6
- "type": "module",
7
- "license": "MIT",
8
- "author": "Vargov®Design (https://vargov.ru)",
9
- "main": "dist/index.js",
10
- "bin": {
11
- "vargov-mcp": "dist/index.js"
12
- },
13
- "files": [
14
- "dist",
15
- "data",
16
- "README.md",
17
- "LICENSE",
18
- "DATA-LICENSE.md"
19
- ],
20
- "engines": {
21
- "node": ">=20"
22
- },
23
- "scripts": {
24
- "build": "tsc -p tsconfig.json",
25
- "start": "node dist/index.js",
26
- "test": "node test/smoke.mjs",
27
- "update-data": "node scripts/update-data.mjs",
28
- "prepack": "npm run build"
29
- },
30
- "keywords": [
31
- "mcp",
32
- "model-context-protocol",
33
- "lighting-design",
34
- "interior-design",
35
- "bim",
36
- "ifc4",
37
- "vargov",
38
- "lighting",
39
- "architecture",
40
- "3d-configurator"
41
- ],
42
- "homepage": "https://vargov.ru/en",
43
- "publishConfig": {
44
- "access": "public"
45
- },
46
- "dependencies": {
47
- "@modelcontextprotocol/sdk": "^1.32.2",
48
- "zod": "^4.6.7"
49
- },
50
- "devDependencies": {
51
- "@types/node": "^24.0.0",
52
- "typescript": "^5.0.0"
53
- }
54
- }
1
+ {
2
+ "name": "@vargov/mcp",
3
+ "version": "0.2.0",
4
+ "mcpName": "io.github.vargov3-spec/vargov-mcp",
5
+ "description": "MCP server for AI assistants: the Vargov®Design catalogue (605 made-to-order light and decorative compositions), configurator links with room dimensions, how to get IFC4 (BIM) and FBX files, brand facts. Offline: all data is bundled.",
6
+ "type": "module",
7
+ "license": "MIT",
8
+ "author": "Vargov®Design (https://vargov.ru)",
9
+ "main": "dist/index.js",
10
+ "bin": {
11
+ "vargov-mcp": "dist/index.js"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "data",
16
+ "README.md",
17
+ "LICENSE",
18
+ "DATA-LICENSE.md"
19
+ ],
20
+ "engines": {
21
+ "node": ">=20"
22
+ },
23
+ "scripts": {
24
+ "build": "tsc -p tsconfig.json",
25
+ "start": "node dist/index.js",
26
+ "test": "node test/smoke.mjs",
27
+ "update-data": "node scripts/update-data.mjs",
28
+ "prepack": "npm run build"
29
+ },
30
+ "keywords": [
31
+ "mcp",
32
+ "model-context-protocol",
33
+ "lighting-design",
34
+ "interior-design",
35
+ "bim",
36
+ "ifc4",
37
+ "vargov",
38
+ "lighting",
39
+ "architecture",
40
+ "3d-configurator"
41
+ ],
42
+ "homepage": "https://vargov.ru/en",
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "dependencies": {
47
+ "@modelcontextprotocol/sdk": "^1.32.2",
48
+ "zod": "^4.6.7"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^24.0.0",
52
+ "typescript": "^5.0.0"
53
+ }
54
+ }