nx_mcp.nx
buildroot/runtime/nx_mcp.nx
about
nx_mcp.nx -- THE SOVEREIGN MCP CLIENT. Retires nishi-ops/nxmcp.py (Python) and nxfsedit.ps1
(PowerShell) from the operating path: composing a tools/call envelope is FORMATTING, and formatting
is an organ's job, not a script's (rule 29 -- NishiLang for everything, shell is break-glass only).
nx_mcp <tool> <capfile> [argv...]
any argv element of the form @@FILE:<path> is replaced by that FILE'S CONTENT (positional, because
organs differ on where a payload goes -- nx_fs_write is `write <path> <content> [expect=]`, so a
"content is always last" helper silently passes the expect flag AS the content).
WHY THIS EXISTS, MEASURED 2026-08-10: the Python client returned `{}` on a 36,616 B source push and
left the NAS file at 33,955 B -- a state matching NEITHER the new bytes NOR the previous ones, which
then COMPILED CLEAN and produced a plausible binary. A transport that can silently corrupt the thing
it is shipping is not a transport. ★★★★★★ A FOREIGN-RUNTIME DEPENDENCY IN THE SHIP PATH IS A DEFECT
YOU CANNOT DEBUG WITH YOUR OWN INSTRUMENTS -- I could not determine the cause because the failure was
inside somebody else's json encoder, and "undetermined" is the honest verdict a sovereign stack should
never have to write about its own ship lane.
COMPOSITION, NOT REIMPLEMENTATION: the TLS-1.3 wire is nx_mgmt_client (proven, sovereign, already the
lane for /api/build|promote|deploy). This organ owns exactly ONE thing -- a correct RFC 8259 envelope.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_json_lib.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 24 | const MC_MAGIC_8388608: i64 = 8388608 |
| 25 | const MC_MAGIC_2048: i64 = 2048 |
| 26 | const MC_MAGIC_512: i64 = 512 |
| 28 | const MC_BODY_CAP: i64 = 8388608 // request envelope |
| 29 | const MC_RESP_CAP: i64 = 8388608 // response |
| 30 | const MC_FILE_CAP: i64 = 4194304 // one @@FILE payload |
| 31 | const MC_URL: *u8 = "https://nishifamily.com" |
| 32 | const MC_PATH: *u8 = "/mcp" |
| 33 | const MC_CLIENT: *u8 = "./_offc/nx_mgmt_client.elf" |
functions
| 35 | func mc_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 36 | func mc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 37 | func mc_cat(dst: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[o + i] = s[i]; i = i + 1 } return o + i } |
| 38 | func mc_num(dst: *u8, o: i64, v: i64) -> i64 |
| 49 | func mc_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] == (0 as u8) { return 1 } return 0 } |
| 56 | func mc_esc(dst: *u8, o0: i64, src: *u8, n: i64) -> i64 |
| 88 | func mc_read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 104 | func mc_resolve(arg: *u8, out: *u8, cap: i64) -> i64 |
| 118 | func main(argc: i64, argv: *i64) -> i64 |