NexusMCP
by KRONVEX
README.md
<p align="center">
<img src="./assets/nexus-banner.svg" alt="NexusMCP v1.0 — Code-Mode Universal MCP Super-Gateway" width="100%" />
</p>
<p align="center">
<strong>Language:</strong>
<a href="README.md"><strong>English</strong></a> |
<a href="README.ar.md">العربية</a>
</p>
<p align="center">
<img src="https://img.shields.io/badge/Version-1.0.0-14b8a6?style=for-the-badge" alt="Version 1.0.0" />
<img src="https://img.shields.io/badge/Code%20Mode-2%20Tools%20(~650%20Tok)-10b981?style=for-the-badge" alt="2 Tools 650 Tokens" />
<img src="https://img.shields.io/badge/Dependencies-0%20(Pure%20Node.js%20%3E%3D18)-0284c7?style=for-the-badge" alt="Zero Dependencies" />
<img src="https://img.shields.io/badge/E2E%20Verified-18%2F18%20Pass-10b981?style=for-the-badge" alt="18/18 E2E Pass" />
<img src="https://img.shields.io/badge/License-MIT-6366f1?style=for-the-badge" alt="MIT License" />
</p>
<p align="center">
<img src="https://img.shields.io/badge/-MCP%202025%20%2B%202026--07--28-0d9488" alt="Dual Era MCP" />
<img src="https://img.shields.io/badge/-node%3Avm%20Code%20Mode-0284c7" alt="Code Mode Sandbox" />
<img src="https://img.shields.io/badge/-7--Suite%20Orchestrator-f59e0b" alt="7-Suite Orchestrator" />
<img src="https://img.shields.io/badge/-Upstream%20MCP%20Bridge-6366f1" alt="Upstream MCP Bridge" />
<img src="https://img.shields.io/badge/-FilteredStdio%20%2B%20HTTP%20%2Fmcp-10b981" alt="Dual Transport" />
<img src="https://img.shields.io/badge/-4--Layer%20Security-ef4444" alt="4-Layer Security" />
</p>
<p align="center">
<a href="#-why-nexusmcp-changes-mcp">Why NexusMCP</a> ·
<a href="#%EF%B8%8F-architecture--live-preview">Architecture</a> ·
<a href="#-quick-start--super-gateway">Quick Start</a> ·
<a href="#-7-suite--upstream-multiplexer">7-Suite & Bridge</a> ·
<a href="#-4-layer-production-security">4-Layer Security</a> ·
<a href="#-mcp-devtools--ci-gates">DevTools</a> ·
<a href="#-verified-1818-e2e-scorecard">18/18 E2E</a>
</p>
<div align="center">
<table aria-label="NexusMCP Core Pillars">
<tr>
<td width="33%" align="center">
<img src="./assets/icon-codemode.svg" width="46" height="46" alt="Code Mode Sandbox" /><br />
<strong>Cloudflare-Style Code Mode</strong><br />
<sub>Collapses 400+ tools into <strong>2 tools (~650 tokens)</strong> · <code>node:vm</code> isolate · 1 round-trip</sub>
</td>
<td width="33%" align="center">
<img src="./assets/icon-gateway.svg" width="46" height="46" alt="7-Suite and Upstream Gateway" /><br />
<strong>7-Suite + Upstream Multiplexer</strong><br />
<sub>Bridges all 7 local flagship engines (<code>nx.suite.*</code>) + any stdio/HTTP MCP (<code>nx.mcp.*</code>)</sub>
</td>
<td width="33%" align="center">
<img src="./assets/icon-shield.svg" width="46" height="46" alt="4-Layer Security and DevTools" /><br />
<strong>4-Layer Security & DevTools</strong><br />
<sub>UUID sandwich · <code>FilteredStdio</code> · Origin 403 · <code>audit-server</code> · <code>diff-interface</code></sub>
</td>
</tr>
</table>
</div>
> **One MCP server. Two tools (~650 tokens). Unlimited capabilities.**
> Orchestrate your workspace, all **7 local flagship engines**, and **any external MCP server** in a single sandboxed turn — with zero dependencies and `$0` LLM overhead.
---
## 🔥 Why NexusMCP Changes MCP
<p align="center">
<img src="./assets/nexus-token-collapse.svg" alt="Legacy Multi-MCP Schema Bloat vs NexusMCP Code Mode Token Collapse" width="100%" />
</p>
| Pillar | Engine Module | Problem Solved | Deterministic Guarantee |
|---|---|---|---|
| **P1 — Code Mode (`search` + `execute`)** | [`engine/sandbox.cjs`](engine/sandbox.cjs) + [`engine/discovery.cjs`](engine/discovery.cjs) | 60k–250k token schema bloat & 10-turn ping-pong loops | Fixed **2 tools (~650 tokens)** forever; fuzzy Levenshtein discovery; `node:vm` null-prototype sandbox with `codeGeneration: { strings: false, wasm: false }` blocking `Function`/`eval` escapes. |
| **P2 — Native 7-Suite Orchestrator** | [`engine/capabilities.cjs`](engine/capabilities.cjs) | Switching across 7 separate CLIs manually | Chains `IronWall`, `SynapseGraph`, `ZeroBurn`, `OptixZero`, `ForgeCore`, `TrueVoice`, and `RankPulse` inside `nx.suite.*` with `Promise.all()` in **1 turn**. |
| **P3 — Upstream MCP Multiplexer** | [`engine/upstream-bridge.cjs`](engine/upstream-bridge.cjs) | Connecting 10 MCP servers explodes context & auth surfaces | Lazily proxies **any external stdio or Streamable HTTP MCP server**, indexes all their tools into `nexus_search`, and calls them via `nx.mcp.call()` with UUID wrapping & read-only enforcement. |
| **P4 — Dual-Era Hardened Transports** | [`engine/mcp-server.cjs`](engine/mcp-server.cjs) | Stray `console.log()` crashes stdio; stateful HTTP leaks sessions | **`FilteredStdio`** protects `stdout` framing + buffers pre-handshake logs + suppresses Cline noise; **Stateless HTTP `/mcp`** speaks 2025 `initialize` & 2026-07-28 `server/discover`, enforces Origin `403` & `4 MiB` cap. |
| **P5 — 4-Layer MCP Security** | [`engine/security.cjs`](engine/security.cjs) | Prompt injection, path traversal, SSRF & leaky `hidden:true` | Per-call `randomUUID()` untrusted-data sandwich, 3-layer `--read-only`, monotonic `--lockdown`, Windows+POSIX path guard (no ADS `:`, no `CON`/`NUL`, `realpath`), SSRF & blocked-command guards. |
| **P6 — MCP DevTools & CI Gates** | [`engine/devtools.cjs`](engine/devtools.cjs) | Shipping broken MCP servers without schema/annotation checks | `audit-server` (catches `console.log`, missing `readOnlyHint`, schema bloat %), `diff-interface` CI regression gate, 1-second `scaffold` & universal `client-config`. |
---
## 🏗️ Architecture & Live Preview
<p align="center">
<img src="./assets/nexus-architecture.svg" alt="NexusMCP Super-Gateway Architecture" width="100%" />
</p>
<p align="center">
<img src="./assets/nexus-terminal.svg" alt="NexusMCP Live Code Mode and DevTools Preview" width="100%" />
</p>
---
## ⚡ Quick Start & Super-Gateway
> [!IMPORTANT]
> **Zero `npm install`. Zero SDK bloat. Pure Node.js 18+ stdlib.**
> Works simultaneously as a **Live MCP Server**, a **Global CLI (`nexus-mcp` / `nxm`)**, and an **AI Agent Skill across 16 platforms**.
```bash
# 1. Install skill across ALL 16 AI coding agent platforms:
node scripts/nexus-install.cjs --all
# 2. Verify runtime + auto-detected 7-Suite local engines:
node scripts/cli.cjs doctor
# 3. Run the live Code-Mode MCP Server (stdio or Stateless Streamable HTTP /mcp):
node scripts/cli.cjs serve --transport stdio --mode codemode --root .
node scripts/cli.cjs serve --transport http --port 3840 --read-only --root .
# 4. Run as a Universal Upstream MCP Multiplexer (collapses N external MCP servers into 2 tools!):
node scripts/cli.cjs serve --transport stdio --upstream ./upstreams.json --root .
# 5. Print drop-in MCP config for Antigravity, Claude Code, Cursor, Windsurf, Codex, Cline & VS Code:
node scripts/cli.cjs client-config --root .
```
---
## 🔗 7-Suite & Upstream Multiplexer
Inside a single `nexus_execute` call, agents can combine workspace files, git state, all **7 local flagship engines**, and **external upstream MCP servers** in parallel:
```js
// One single round-trip (~650 tokens schema overhead total!):
const [triage, guard, seo, prose] = await Promise.all([
nx.suite.forgecore('triage', ['--json']),
nx.suite.forgecore('guard', ['--json']),
nx.suite.rankpulse('audit', ['./dist', '--json']),
nx.suite.truevoice('score', ['./README.md', '--json']),
]);
const upstreamServers = nx.mcp.servers();
return {
tier: triage.json?.tierLabel,
guardOk: guard.ok,
seoScore: seo.json?.combinedScore,
humanityScore: prose.json?.humanityScore,
upstreamServers,
};
```
<details>
<summary><strong>🔌 Example <code>upstreams.json</code> (Multiplex GitHub, Context7, Supabase, etc. behind 2 tools)</strong></summary>
```json
{
"upstreams": {
"github": {
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"readOnly": true
},
"context7": {
"transport": "http",
"url": "https://mcp.context7.com/mcp",
"headers": { "Authorization": "Bearer ${CONTEXT7_API_KEY}" }
}
}
}
```
</details>
---
## 🛡️ 4-Layer Production Security
| Layer | Enforcement Mechanism | What It Blocks |
|---|---|---|
| **1. Sandbox Isolate** | `vm.createContext(Object.create(null), { codeGeneration: { strings: false, wasm: false } })` | Blocks `process`, `require`, `env`, `eval()`, and `this.constructor.constructor('return process')()` escapes. |
| **2. UUID Data Boundary** | `<untrusted-data-${crypto.randomUUID()}>` + Instruction Sandwich | Prevents prompt injection inside fetched web pages, files, logs, and upstream MCP responses from breaking out of static tags. |
| **3. 3-Layer Read-Only & Monotonic Lockdown** | Hidden in `tools/list` + blocked in `tools/call` + disabled in `nx.*` + `X-MCP-Lockdown` can only turn ON | Prevents hidden write tools from being invoked directly or weakened via request headers. |
| **4. Path, SSRF & HTTP Guards** | `realpathSync` parent walk + Windows ADS/device check + IP blocklist + Origin `403` + `4 MiB` cap | Blocks `../`, dangling symlinks, `file:ads`, `CON`/`NUL`, `169.254.169.254`, `127.0.0.1`, DNS rebinding & `rm -rf /`. |
---
## 🛠️ MCP DevTools & CI Gates
```bash
# Audit any MCP server source or tools.json for stdout corruption, missing readOnlyHint & schema bloat:
node scripts/cli.cjs audit-server ./my-mcp-server/
# CI interface regression gate (exits 1 on removed tools, new required params, or removed params):
node scripts/cli.cjs diff-interface ./v1-tools.json ./v2-tools.json
# Scaffold a brand-new 0-dependency, hardened MCP server (with runnable test.cjs) in 1 second:
node scripts/cli.cjs scaffold my-gateway --mode codemode --out ./my-gateway
```
---
## 📊 Verified 18/18 E2E Scorecard
All **18 E2E suites** run real stdio child processes, a real live Streamable HTTP `/mcp` server, a real live upstream stdio MCP server multiplexed through `UpstreamBridge`, real `node:vm` escape attacks, and real installed `nx.suite.*` engines via `node tests/e2e-test.cjs`:
| # | Verified E2E Suite | Proven Invariant | Status |
|---:|---|---|---|
| 1 | `SKILL.md` Budget & Playbooks | `<5,500` chars (`<650` tokens), trigger-only frontmatter, all 4 playbooks present | **PASS** |
| 2 | Code Mode Schema Budget | `tools/list` exposes ONLY 2 tools (`nexus_search`, `nexus_execute`) under `<700` tokens | **PASS** |
| 3 | Dual-Era MCP Handshake | Both 2025 `initialize` + `notifications/initialized` AND 2026-07-28 `server/discover` pass | **PASS** |
| 4 | Fuzzy Discovery + `aliasArgs` | Typo `"forgcor"` resolves `suite_forgecore`; aliases `q`/`userQuery`/`file_path` normalize silently | **PASS** |
| 5 | Multi-Step `nexus_execute` | Chains `nx.fs.list` + `nx.fs.read` + `nx.fs.grep` in 1 round-trip cleanly | **PASS** |
| 6 | Sandbox Escape Hardening | `process`, `require`, `eval()`, and `constructor.constructor('return process')()` ALL blocked | **PASS** |
| 7 | 3-Layer Read-Only & Lockdown | `--read-only` hides + blocks direct `fs_write` + blocks Code Mode `nx.fs.write`; `--lockdown` monotonic | **PASS** |
| 8 | Windows + POSIX Path Guard | Blocks `../`, `\0`, NTFS ADS `:`, `CON`/`NUL`/`COM1`, trailing dot & `/root-evil` prefix collision | **PASS** |
| 9 | Random UUID Untrusted Boundary | Two consecutive calls emit two distinct UUIDs inside `<untrusted-data-${uuid}>` | **PASS** |
| 10 | SSRF & Shell Command Guard | Blocks `127.0.0.1`, `169.254.169.254`, `192.168.1.1`, `rm -rf /`, `--no-verify`, nested `sh -c` | **PASS** |
| 11 | Surgical Edit & Output Compressor | Refuses ambiguous multi-match; compresses `>12 KB` payloads while preserving `ERROR:` lines | **PASS** |
| 12 | Live `stdio` + `FilteredStdio` | Spawns real `serve --transport stdio`, validates pure JSON-RPC framing & `-32700` parse recovery | **PASS** |
| 13 | Live Streamable HTTP `/mcp` | Proves `/health` 200, `/sse` 410, evil `Origin` 403, `server/discover` 200 & `X-MCP-Readonly` block | **PASS** |
| 14 | Live Upstream MCP Multiplexer | Spawns real mock upstream MCP over stdio, indexes into `nexus_search`, proxies `nx.mcp.call()` with UUID wrap & read-only block | **PASS** |
| 15 | Live 7-Suite Integration | Invokes real `nx.suite.truevoice` & `nx.suite.rankpulse` inside Code Mode in 1 turn | **PASS** |
| 16 | DevTools `audit-server` | Catches stray `console.log`, `eval`, static `<data>`, `0.0.0.0`, missing `readOnlyHint` & schema bloat % | **PASS** |
| 17 | DevTools `diff-interface` | Catches `TOOL_REMOVED`, `REQUIRED_PARAM_ADDED`, `PARAM_REMOVED` & `READONLY_WEAKENED` | **PASS** |
| 18 | DevTools `scaffold` + Smoke | Generates new 0-dep MCP server and passes its own generated `node test.cjs` + `client-config` + `doctor` | **PASS** |
---
## 🌐 Supported Platforms (16)
`node scripts/nexus-install.cjs --all` installs natively across **16 AI platforms**:
**Google Antigravity** · **Gemini CLI** · **Claude Code** · **OpenAI Codex** · **Cursor** · **Windsurf** · **Cline** · **Roo Code** · **GitHub Copilot** · **OpenCode** · **Kiro** · **Continue** · **Trae** · **Goose** · **Augment** · **Amp**
---
## 📜 License
Released under the [MIT License](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues