@nekzus/neural-mesh provides a complete, strongly-typed toolkit for building NMP Clients (Agent Nodes) and NMP Servers (Data Nodes) in TypeScript and JavaScript.
If you are migrating from the Model Context Protocol (MCP), you will find the API surface remarkably familiar. NMP was designed to provide a Drop-in Replacement Developer Experience (DX), abstracting away the immense complexity of Protobuf, WebAssembly, and Kademlia DHT under simple TypeScript classes.
Package Architecture
The SDK is published to npm as a single unified package containing both Client and Server logic:We strongly recommend installing
zod alongside the SDK. Just like the official MCP specification, NMP relies on Zod parsing to guarantee that Execution Arguments passed by the AI Agent perfectly match the Server’s capability manifest.Under the Hood: The Javy Compiler
You might be wondering: If NMP relies on injecting compiled WebAssembly (.wasm) logic, how can I build Agents purely in TypeScript?
The @nekzus/neural-mesh includes a native compilation bridge (the Component Builder). When your TypeScript Agent invokes .execute(), the SDK transparently serializes the JavaScript payload, bundles it utilizing a Javy-like engine into a highly restrictive .wasm payload, strings it through the Protobuf LogicRequest, and injects it into the Mesh.
The developer never has to manually write or compile Rust/Wasm.
Vanguard Enterprise Features
The TypeScript SDK operates at strict architectural parity with the high-performance Rust core, ensuring true Zero-Trust enterprise constraints:- Post-Quantum Cryptography (ML-KEM-768): End-to-end asymmetric encapsulation (
crystals-kyber) and symmetric AES-256-GCM authentication. - Hybrid Mesh Transport: Unrestricted Node.js & browser peering through dual WebSockets (WS/Mplex) and TCP (Yamux) libp2p listeners.
- Guardian-TS (Zero-Time AST Inspection): Proactive sandbox-escape mitigation that blocks illegal host capabilities before
node:wasiexecution logic triggers. - ZK-Receipt Ready: Native architectural support for trustless Mathematical Execution Proofs against Zero-Knowledge Virtual Machines (zkVMs).
- Multi-Core Scaling (Worker Pool): Hardware-accelerated transactional performance using
piscina. Bypasses V8’s Single-Thread Event Loop bottleneck by offloading PQC decryption, AST inspection, and WASI Sandboxing to isolated OS-level threads.
Key Exports
The SDK exports three primary classes for orchestrating Mesh applications:NmpServer
The Data Node receiver. Exposes local secure capabilities, files, and handles incoming Logic-on-Origin intent safely.
NmpClient
The Intelligence Node. Searches the DHT Mesh for available capabilities and injects the dynamic WebAssembly payload to process data.
NmpMcpBridge
The Legacy Translator. Instantly bridges
tools and resources between legacy JSON-RPC MCP clients and your high-performance NMP network.Architectural Deep Dive: Multi-Core Transactional Pool
A severe limitation historically cited regarding Node.js was its single-threaded Event Loop bottleneck under grueling CPU workloads. The SDK shatters this limit by routing cryptographic ingestion to isolated OS Threads viapiscina.
Getting Started
Ready to write your first line of NMP code? Jump straight into building either side of the Mesh constraint:- Construct a Neural Server to protect your data.
- Design a Neural Client to search out intelligence.