mcp-xray-pilot 0.10.0 → 0.11.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/README.md CHANGED
@@ -1,12 +1,18 @@
1
1
  # mcp-xray-pilot
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/mcp-xray-pilot.svg)](https://www.npmjs.com/package/mcp-xray-pilot)
4
+ [![npm downloads](https://img.shields.io/npm/dm/mcp-xray-pilot.svg)](https://www.npmjs.com/package/mcp-xray-pilot)
5
+ [![node](https://img.shields.io/node/v/mcp-xray-pilot.svg)](https://nodejs.org)
6
+ [![license](https://img.shields.io/npm/l/mcp-xray-pilot.svg)](./LICENSE)
7
+
3
8
  [Русская версия ниже / Russian version below](#mcp-xray-pilot-ru)
4
9
 
5
10
  A Model Context Protocol (MCP) server that gives an LLM offline access to the
6
11
  official **xray-core** documentation, plus deep structural validation,
7
12
  best-practice lint, a protocol/transport/security compatibility matrix, a
8
- geosite/geoip catalogue, an alternative-stack suggester and a multi-config
9
- merge helper.
13
+ **full v2fly geosite catalogue (~1500 categories)**, an alternative-stack
14
+ suggester, REALITY keypair / shortId generators, a live SNI target validator,
15
+ a curated SNI suggester per exit-country and a multi-config merge helper.
10
16
 
11
17
  ## What it does
12
18
 
@@ -29,7 +35,12 @@ merge helper.
29
35
  fingerprint enum, ALPN collisions, geosite/geoip typo catcher, protocol
30
36
  × transport × security incompatibilities, `xhttp.path` leading slash,
31
37
  `geoip:private` block rule, sniffing on 80/443 etc.
32
- - **Geo catalogue**: search ~500 known geoip/geosite tags by substring.
38
+ - **Geo catalogue**: search ~1500 known geoip/geosite tags by substring (full
39
+ v2fly/domain-list-community catalogue, hydrated from `data/geocatalogue.json`).
40
+ - **REALITY toolbelt**: `xray_generate_reality_keypair` (drop-in replacement
41
+ for `xray x25519`), `xray_generate_short_ids` (cryptographically random,
42
+ legacy-empty prefix), `xray_validate_sni_target` (live TLS 1.3 + h2 probe),
43
+ `xray_suggest_sni_for_country` (curated REALITY fronts per exit-country).
33
44
  - **Compares protocols**: side-by-side table of vless/vmess/trojan/ss/
34
45
  hysteria2/wireguard on transports, security, anti-DPI, mobile, battery.
35
46
  - **Recommends a stack** for a stated goal (anti-DPI in RU/IR/CN, low
@@ -46,13 +57,44 @@ merge helper.
46
57
  | `xray_search` | Full-text search over all cached docs. Returns ranked hits + snippets. |
47
58
  | `xray_validate_config` | Structural+schema validation of an xray JSON config (Zod under the hood). |
48
59
  | `xray_lint` | ~20 best-practice lint rules. Returns issues with severity, rule id, JSON-pointer. |
49
- | `xray_geo_search` | Substring search over the embedded geosite/geoip catalogue. |
60
+ | `xray_geo_search` | Substring search over the embedded geosite/geoip catalogue (~1500 tags). |
50
61
  | `xray_diff_protocols` | Side-by-side feature table for two protocols. |
51
62
  | `xray_suggest_alternative` | Recommend protocol+transport+security for a goal (anti-DPI / battery / latency / …). |
63
+ | `xray_generate_short_ids` | Cryptographically random REALITY shortIds (default `[4,8,16]` bytes, legacy empty prefix). |
64
+ | `xray_generate_reality_keypair` | Fresh REALITY X25519 keypair, base64url 43 chars — drop-in for `xray x25519`. |
65
+ | `xray_validate_sni_target` | Live TLS 1.3 + ALPN h2 + HTTP probe of a candidate REALITY target host. |
66
+ | `xray_suggest_sni_for_country` | Curated REALITY SNI/target hosts per exit-country (DE/PL/NL/FR/LV/SE/FI/US/UK/JP/SG/AU/CA). |
52
67
  | `xray_merge_configs` | Merge N xray configs with tag-collision resolution and conflict warnings. |
53
68
  | `xray_github_search` | Search issues/PRs/discussions across XTLS GitHub repos (Xray-core/REALITY/docs). |
54
69
  | `xray_github_fetch_issue` | Fetch one issue/PR/discussion with full body + top comments. |
55
- | `xray_refresh_cache` | Bulk re-fetch cached docs (`scope: all/stale/category`). Optional `discover` for new upstream slugs. |
70
+ | `xray_refresh_cache` | Bulk re-fetch cached docs (`scope: all/stale/category`). Optional `discover` for new upstream slugs. Optional `refresh_geocatalogue: true` to also re-pull the v2fly category list. |
71
+
72
+ Total: **16 tools**.
73
+
74
+ ### Quick toolbelt
75
+
76
+ Generate a REALITY keypair (server-side priv + client-side pub):
77
+
78
+ ```jsonc
79
+ // xray_generate_reality_keypair {}
80
+ {
81
+ "privateKey": "MNCibkT-h5bCF6iknJG0rJdHdfUjT7VugHgSX9BRWUY",
82
+ "publicKey": "ffvf0eNwnLhgK-axt3rajJIAoHKv0rX4xkw5KyImn38",
83
+ "note": "Server: paste privateKey into inbound realitySettings.privateKey. Clients: paste publicKey into outbound realitySettings.publicKey. Format matches `xray x25519` output exactly."
84
+ }
85
+ ```
86
+
87
+ Live-check a candidate REALITY SNI:
88
+
89
+ ```jsonc
90
+ // xray_validate_sni_target { "host": "www.onet.pl" }
91
+ {
92
+ "host": "www.onet.pl", "port": 443, "ok": true,
93
+ "tls_version": "TLSv1.3", "alpn": "h2", "http_status": 200,
94
+ "cert_subject": "www.onet.pl", "cert_san_count": 4,
95
+ "latency_ms": 312, "issues": []
96
+ }
97
+ ```
56
98
 
57
99
  It also exposes a single MCP **resource**: `xray://docs/index` — the raw
58
100
  `_index.json` of cached topics.
@@ -253,7 +295,7 @@ warning in the response.
253
295
 
254
296
  ## Roadmap
255
297
 
256
- See [ROADMAP.md](./ROADMAP.md). All v0.1–v0.10 milestones are checked off.
298
+ See [ROADMAP.md](./ROADMAP.md). All v0.1–v0.11 milestones are checked off.
257
299
 
258
300
  ## License
259
301
 
@@ -290,7 +332,12 @@ MCP-сервер, дающий LLM офлайн-доступ к официаль
290
332
  ALPN collisions, geo typo catcher, protocol × transport × security
291
333
  несовместимости, `xhttp.path` слеш, `geoip:private` block, sniffing на
292
334
  80/443 и т.д.
293
- - **Geo catalogue**: поиск по ~500 известным geoip/geosite тегам.
335
+ - **Geo catalogue**: поиск по ~1500 известным geoip/geosite тегам (полный
336
+ v2fly/domain-list-community каталог, гидратируется из `data/geocatalogue.json`).
337
+ - **REALITY toolbelt**: `xray_generate_reality_keypair` (drop-in замена
338
+ `xray x25519`), `xray_generate_short_ids` (криптослучайные, с empty-prefix
339
+ для легаси), `xray_validate_sni_target` (live TLS 1.3 + h2 проба),
340
+ `xray_suggest_sni_for_country` (курируемые REALITY-фронты по стране exit'а).
294
341
  - **Сравнение протоколов**: таблица vless/vmess/trojan/ss/hysteria2/
295
342
  wireguard по transports, security, anti-DPI, mobile, battery.
296
343
  - **Рекомендует стек** под цель (anti-DPI в РФ/Иране/КНР, low-latency,
@@ -307,13 +354,46 @@ MCP-сервер, дающий LLM офлайн-доступ к официаль
307
354
  | `xray_search` | Полнотекстовый поиск по докам. Хиты + сниппеты. |
308
355
  | `xray_validate_config` | Структурная валидация + Zod-схемы по протоколу/transport/security. |
309
356
  | `xray_lint` | ~20 правил best-practice. Issues с severity, rule id, JSON-pointer. |
310
- | `xray_geo_search` | Поиск по embedded каталогу geosite/geoip по подстроке. |
357
+ | `xray_geo_search` | Поиск по embedded каталогу geosite/geoip по подстроке (~1500 тегов). |
311
358
  | `xray_diff_protocols` | Side-by-side таблица фич двух протоколов. |
312
359
  | `xray_suggest_alternative` | Рекомендация protocol+transport+security под цель. |
360
+ | `xray_generate_short_ids` | Криптослучайные REALITY shortIds (default `[4,8,16]` байт, с empty-prefix для легаси). |
361
+ | `xray_generate_reality_keypair` | Свежая X25519 пара REALITY, base64url 43 chars — drop-in для `xray x25519`. |
362
+ | `xray_validate_sni_target` | Live проба TLS 1.3 + ALPN h2 + HTTP кандидата на REALITY target. |
363
+ | `xray_suggest_sni_for_country` | Курируемые REALITY-фронты по стране exit'а (DE/PL/NL/FR/LV/SE/FI/US/UK/JP/SG/AU/CA). |
313
364
  | `xray_merge_configs` | Слить N конфигов с разрешением коллизий тегов. |
314
365
  | `xray_github_search` | Поиск issues/PR/discussions по XTLS GitHub репозиториям. |
315
366
  | `xray_github_fetch_issue` | Получить одну issue/PR/discussion с полным body + топ комментариев. |
316
- | `xray_refresh_cache` | Bulk перезатяжка кеша доков (`scope: all/stale/category`). Опц. `discover` для новых slug'ов. |
367
+ | `xray_refresh_cache` | Bulk перезатяжка кеша доков (`scope: all/stale/category`). Опц. `discover` + `refresh_geocatalogue: true` (заодно перетянет v2fly категории). |
368
+
369
+ Всего: **16 тулов**.
370
+
371
+ ### Quick toolbelt
372
+
373
+ Сгенерить REALITY keypair (priv для сервера, pub для клиентов):
374
+
375
+ ```jsonc
376
+ // xray_generate_reality_keypair {}
377
+ {
378
+ "privateKey": "MNCibkT-h5bCF6iknJG0rJdHdfUjT7VugHgSX9BRWUY",
379
+ "publicKey": "ffvf0eNwnLhgK-axt3rajJIAoHKv0rX4xkw5KyImn38",
380
+ "note": "Format matches `xray x25519` output exactly."
381
+ }
382
+ ```
383
+
384
+ Live-проверить кандидата на REALITY SNI:
385
+
386
+ ```jsonc
387
+ // xray_validate_sni_target { "host": "www.onet.pl" }
388
+ {
389
+ "host": "www.onet.pl", "port": 443, "ok": true,
390
+ "tls_version": "TLSv1.3", "alpn": "h2", "http_status": 200,
391
+ "cert_subject": "www.onet.pl", "cert_san_count": 4,
392
+ "latency_ms": 312, "issues": []
393
+ }
394
+ ```
395
+
396
+ > ⚠️ Проба идёт с локальной машины, где запущен `mcp-xray-pilot`. Для решения «работает ли SNI из РФ» — гоняй с РФ-IP отдельно.
317
397
 
318
398
  Также один MCP **ресурс**: `xray://docs/index`.
319
399
 
@@ -495,7 +575,7 @@ $env:GITHUB_TOKEN = "ghp_xxx" # PowerShell
495
575
 
496
576
  ## Roadmap
497
577
 
498
- См. [ROADMAP.md](./ROADMAP.md) — все вехи v0.1–v0.10 закрыты.
578
+ См. [ROADMAP.md](./ROADMAP.md) — все вехи v0.1–v0.11 закрыты.
499
579
 
500
580
  ## Лицензия
501
581