Skip to main content
Glama

Swallow-Anything v3.0.0 — Apex Overdrive / 新神·吞噬万物

Zero-LLM-Inside Universal Swallower · Watch-Me-Once Causal Compiler · Deep Protocols & Reality IoT · 0-Token 24/7 Reactive Reflex Engine · <2.5 KB Code-Mode MCP Bus

零内置大模型 · 看一次即永久结晶因果编译器 · 深水协议与现实物联网 · 0-Token 24/7 响应式反射引擎 · <2.5 KB Code-Mode MCP 总线

License: MIT Version 3.0.0 Python 3.11+ Zero Dependencies MCP 2025-06-18

English | 简体中文


English

Why Swallow-Anything v3.0.0 (Apex Overdrive)?

Most agent tool frameworks fall into two traps:

  1. Tool-schema bloat: Mounting dozens of flat MCP servers dumps 300–700+ tool schemas (33K–109K+ tokens) into every turn before the model even reads your prompt.

  2. LLM-inside-the-box caging: Bundling a mini-LLM inside a scraper/browser framework slows down smart external Agents (Claude, Codex, Gemini, Cursor, Antigravity) and burns reasoning tokens on every repeated click or polling loop.

Swallow-Anything v3.0.0 (Apex Overdrive) keeps our Zero-LLM-Inside & Zero-Dependency (100% Python 3.11+ stdlib, dependencies = []) foundation while expanding along 4 V3 Overdrive Axes:

  1. Axis 1 — Universal Swallowing Expansion (Watch-Me-Once + Deep Protocols)

    • swallow record (runtime/shadow_recorder.py) & swallow extract-app (runtime/app_api_extractor.py): Zero-CA in-page spy hook (IN_PAGE_SPY_JS), HAR/mitmdump session importer, and macOS AX/JXA recorder that automatically infer multi-step causal dataflow bindings (e.g., CSRF/session token -> chained POST write) and compile directly into a live 0-token causal-cap/1.0 package (RECORD_COMPILED_LIVE). Static APK/DEX & Electron ASAR API extractor compiles embedded app endpoints into live drivers.

    • Deep Protocols Organ (organs/organ_deep_protocols.py): <0.1 ms scheme routing for grpc://, grpcs://, docker://, postgres://, postgresql://, mysql://, redis:// (pure-stdlib RESP TCP client), ssh://, unix:// (pure-stdlib HTTP-over-AF_UNIX), and localproc:// (localhost port & Unix socket discovery) — with zero password leaks into manifests and real commit_tool writes.

  2. Axis 2 — Reality IoT & Mass Ingestion

    • Reality IoT Organ (organs/organ_reality_iot.py): Zero-config LAN & hardware discovery (iot://discover — pure-stdlib SSDP/UPnP multicast + mDNS/Bonjour + USB/Serial + optional BLE), Home Assistant REST bridge (hass://), pure-stdlib MQTT 3.1.1 binary codec (mqtt:// CONNECT/PUBLISH/SUBSCRIBE), onvif://, ble://, and serial://.

    • Concurrent Mass Devourer (swallow devour / runtime/mass_devourer.py) & Zero-Copy Arsenal Bridge (runtime/arsenal_bridge.py): Bounded multi-threaded batch swallowing for mac-apps, phone-apps, docs, github-org, arsenal, and custom target lists with per-target fault isolation.

  3. Axis 3 — 24/7 0-Token Reactive Reflex Engine (swallow watch)

    • runtime/reactive_watcher.py: Continuous background sensors (poll_diff, fs_watch, webhook, stream) paired with a zero-eval() deterministic JSON predicate evaluator (288,323.0 predicates/sec, 0 LLM tokens), anti-storm cooldown_sec/dedupe_sec guards, live capability/code/webhook actions, and macOS launchd plist generation.

  4. Axis 4 — Flagship UX, Ecosystem Interop & Reproducible Benchmarks

    • Zero-CDN Web Console (swallow ui / runtime/web_console.py): Single-file, zero-external-CDN localhost dashboard (/, /health, /api/overview, /api/search, /api/watch, /api/bench, /v1/tools).

    • One-Click AI Client Setup (swallow setup / runtime/client_setup.py): Safe MCP config injector for Claude Desktop, Claude Code, Cursor, Windsurf, Antigravity, and Codex (6 clients) — defaults to non-destructive --dry-run diff preview, creates timestamped .bak backups on --apply, and preserves all existing servers.

    • Code-Mode MCP V3 (runtime/code_mode_mcp.py): Constant 4 meta-tools = 2,473 B compact / 2,634 B full (54.72x compression / 98.17% token reduction vs 81 flat packages / 366 tools), plus Async Tasks (tasks/create -> tasks/get) and OpenAI Tools JSON (GET /v1/tools).

    • Reproducible Offline Benchmark Suite (swallow bench / runtime/benchmark_suite.py): Independently measures all 5 pillars locally in ~636 ms with zero external network calls.

V3 Overdrive Architecture

flowchart LR
    Agent["External Smart Agent (Claude / Codex / Gemini / Cursor / Antigravity)"] -->|"MCP 2025-06-18 (4 tools, 2,473B) / Async Tasks / OpenAI /v1/tools / CLI"| Bus["Code-Mode MCP Bus + swallow/umcp CLI + Zero-CDN Web UI"]

    Bus --> Axis1["Axis 1: ShadowRecorder (swallow record) + AppApiExtractor + SwallowWorkbench + DeepProtocols (gRPC/Docker/DB/Redis/SSH/Unix/localproc)"]
    Bus --> Axis2["Axis 2: RealityIoT (SSDP/mDNS/MQTT 3.1.1/HASS/ONVIF/BLE/Serial) + MassDevourer (swallow devour) + ArsenalBridge"]
    Bus --> Axis3["Axis 3: ReactiveWatcher (swallow watch: poll_diff / fs_watch / webhook / stream -> 0-Token Predicates -> Reflex Actions)"]
    Bus --> Axis4["Axis 4: ClientSetup (swallow setup) + WebConsole (swallow ui) + BenchmarkSuite (swallow bench)"]

    Axis1 -->|"0.0015ms Triage / 1-Call Causal Compile"| IR["Canonical IR cap.manifest.json (causal-cap/1.0)"]
    Axis2 -->|"Concurrent Batch / IoT Compile"| IR

    IR --> Shell["QuintetRuntimeShell (C1 Coerce · C2 Two-Zone Firewall · C3 Direct-Write / HMAC Financial Gate · C4 Precision Human-Gate · C5 L1 Drift Self-Heal)"]
    Shell --> Judge["8-Gate Adversarial Judge (Gate 8 Live Mutation Integrity: 100% fake staged_preview catch rate)"]

    Judge -->|"QuadEmitter (4-Way Output)"| Out1["1. JSON CLI (swallow / umcp)"]
    Judge -->|"QuadEmitter (4-Way Output)"| Out2["2. MCP 2025-06-18 + /v1/tools"]
    Judge -->|"QuadEmitter (4-Way Output)"| Out3["3. Capability Card Projection"]
    Judge -->|"QuadEmitter (4-Way Output)"| Out4["4. <2 KB SKILL.md"]

Verified swallow bench Telemetry (benchmarks/apex_v3_bench.json)

Every number below is an exact measurement from swallow bench (suite_version: 3.0.0, macOS arm64 / Python 3.12.12, total wall clock 635.6 ms) and live V3 E2E verification (benchmarks/apex_v3_e2e_verification.json):

Benchmark Pillar

Verified Result

Notes / Proof

Direct Triage Latency

0.0015 ms median (0.0035 ms avg)

60 samples across 12 schemes (HTTP, GraphQL, Web, gRPC, Docker, Redis, localproc, IoT, MQTT, HASS, opencli, desktop)

Cold Compile / Crystallize

HTTP OpenAPI 27.8 ms · SQLite 4.74 ms · HAR 4.06 ms

Ephemeral local loopback fixtures, full manifest + driver + QuadEmitter

Code-Mode Context Compression

4 tools = 2,473 B (~618 tok) vs 135,319 B (~33,830 tok)

54.72x compression / 98.17% token reduction vs 81 flat packages (366 flat MCP tools)

Concurrent Batch Devour

6/6 in 24.7 ms (14,572.0 targets/min)

Live E2E: 140/140 arsenal zero-copy index in 29.2 ms (287,672.05/min); 3/3 macOS apps in 289.85 ms (621.01/min)

Gate 8 Live Mutation Integrity

100% (1.0) fake catch · 100% (1.0) real pass

2/2 fake staged_preview drivers caught, 2/2 real writers passed in 31.86 ms

0-Token Watch Reflex Engine

288,323.0 predicates/sec (1,000 evals in 3.47 ms)

0 LLM tokens; zero eval()/exec() AST-verified; live fs_watch reflex verified end-to-end

Automated Test & Judge Suite

74/74 automated checks + 9/9 live V3 E2E checks

21/21 Core + 25/25 V2 Apex + 22/22 V3 Apex Overdrive (68/68 unit) + 6/6 8-Gate Judge self-test

Evidence-Backed Comparison Matrix

All numbers below come directly from verified test runs, benchmarks/apex_v3_bench.json, benchmarks/apex_v3_e2e_verification.json, and isolated benchmark receipts (no speculative estimates):

Dimension

Swallow-Anything v3.0.0

REA (morluto/rea)

OpenCLI (jackwener/OpenCLI)

Playwright-MCP (microsoft/playwright-mcp)

CLI-Anything (HKUDS/CLI-Anything)

Runtime Dependencies

0 (100% Python 3.11+ stdlib; portable kit 157.65 KB, 12 files)

Node/TS heavy runtime (1,047,462 B static scan output)

Node/JS + Chrome MV3 extension (171 sites / 1,225 commands verified locally)

Node + headless browser stack

Python CLI generation harness (HARNESS.md 7-step SOP)

LLM Inside Runtime

0 (Zero-LLM-Inside) — never cages external Agents

External MCP caller

0 (hand-authored JS adapters)

External MCP caller (multi-turn per click)

Compile-time LLM generation, 0-token runtime

MCP Context Budget

4 tools = 2,473 B compact / 2,634 B full (98.17% token reduction, 54.72x vs 366 flat tools) + Async Tasks + /v1/tools

255 tools exposed

CLI-first (no native Code-Mode MCP bus)

Per-step AX browser tools (official README recommends CLI + SKILL.md to save tokens)

CLI-only (no MCP server or Code-Mode sandbox)

Target Surfaces

All 10 species (S1–S10) + Deep Protocols + Reality IoT: CLI, OpenAPI/GraphQL, HAR, SPA/MAIN-world RPC, Watch-Me-Once Causal Chains, APK/ASAR, Wire/Protobuf/Parquet/SQLite, macOS .app/JXA/AX, Android ADB, gRPC/Docker/DB/Redis/SSH/Unix/localproc, SSDP/mDNS/MQTT 3.1.1/HASS/ONVIF/BLE/Serial

Binary & Web static reverse engineering

Web sites (PUBLIC -> COOKIE -> INTERCEPT -> UI)

Web browser AX DOM

Local desktop software CLIs

Compile, Devour & Reflex Speed

0.0015 ms median triage; HTTP 27.8 ms / SQLite 4.74 ms / HAR 4.06 ms; batch devour 14,572/min; 0-token watch 288,323 predicates/sec; 75/75 wild gauntlet 100% PASS

8,350.73 ms on Test 1 static scan (355x slower than Rust craft-anything's 23.51 ms)

Instant pre-built adapter lookup; manual authoring for new sites

Multi-second browser navigation every turn

Offline multi-step generation per app

24/7 Reactive & UX

0-Token swallow watch (fs_watch/poll_diff/webhook/stream), Zero-CDN swallow ui, 1-Click swallow setup (6 AI clients, dry-run + .bak), swallow bench

CLI / MCP only

CLI + Chrome extension

MCP server

CLI generator

Write Integrity & Firewall

Two-Zone Firewall (Zone A / Zone B) + Gate 8 Live Mutation Integrity (100% catch rate) + L1 Drift Self-Healing + hard redlines blocking personal/deep/IoT public promotion

Read-only epistemic ledger

POSIX exit codes + site adapters

Unbounded browser clicks

Real backend CLI invocations

60-Second Quickstart

1. Install (Zero Dependencies)

pip install git+https://github.com/pjrpjr/swallow-anything.git

# Or from a local clone:
git clone https://github.com/pjrpjr/swallow-anything.git
cd swallow-anything
pip install --no-deps -e .

2. Launch the Zero-CDN Web Console & Connect Your AI Clients

# Launch the local real-time dashboard (zero external CDN, loopback-only by default)
swallow ui --port 8765

# Preview safe MCP config diffs across Claude Desktop / Claude Code / Cursor / Windsurf / Antigravity / Codex
swallow setup
# Apply with automatic timestamped .bak backups (preserves existing servers):
swallow setup --apply

3. Record, Devour, Watch & Benchmark (0 LLM Tokens)

# Watch-Me-Once: inspect or compile observed HTTP/HAR traffic into a chained 0-token capability
swallow record web --har ./capture.har --cap-id my_recorded_api

# Concurrent batch devour: index local apps, docs, GitHub orgs, or target lists
swallow devour targets "https://petstore.swagger.io/v2/swagger.json" "iot://discover" "localproc://scan"

# 24/7 0-token reactive reflex watcher (poll_diff / fs_watch / webhook / stream)
swallow watch add --json '{"rule_id":"demo_watch","sensor":{"type":"fs_watch","path":"./inbox"},"predicate":{"path":"sha256","changed":true},"action":{"type":"notify_log","message":"file changed"},"cooldown_sec":5}'
swallow watch list

# Run the full offline 5-pillar benchmark suite (~636 ms)
swallow bench

4. Connect the <2.5 KB Code-Mode MCP Bus (stdio, Streamable HTTP & OpenAI /v1/tools)

swallow serve-codemode --stdio
# or Streamable HTTP (exposes MCP JSON-RPC + Async Tasks + OpenAI GET /v1/tools):
swallow serve-codemode --http 8765

Manual MCP snippet for any client (or run swallow setup --apply):

{
  "mcpServers": {
    "swallow-anything": {
      "command": "swallow",
      "args": ["serve-codemode", "--stdio"],
      "env": {
        "PYTHONDONTWRITEBYTECODE": "1"
      }
    }
  }
}

5. Run the Full Verification Suite (74/74 Checks) & Security Scanner

python3 -B -m swallow_anything.security_scan .
python3 -B -m unittest tests/test_cap_ir_and_projector.py -v
python3 -B -m unittest tests/test_apex_v2.py -v
python3 -B -m unittest tests/test_apex_v3.py -v
python3 -B tests/judge_audit_harness.py self-test

Two-Zone Security Architecture & Responsible Use

Swallow-Anything enforces a strict architectural firewall between personal owner automation and public/shared capability publishing:

Zone

Intended Use

PII Policy

Secrets / PAN / CVV

Write Policy

SSRF / LFI / Redlines

Zone A (Owner-Private)

Your own local machine, accounts, browser tabs, macOS apps, databases, Docker/SSH/gRPC, and local LAN/IoT devices

Owner PII (email, phone, user_id) preserved for your own workflows

Always scrubbed (Bearer, JWT, cookies, DB/Redis passwords, API keys, Luhn-valid card PANs, CVV)

1-step DIRECT_WRITTEN for non-monetary writes; HMAC stage -> commit + budget caps + HUMAN_GATE_REQUIRED for financial spend

Personal devices, deep_protocol, and reality_iot allowed strictly for owner

Zone B (Public-Safe)

Shared / published read-only capabilities

All PII scrubbed

Always scrubbed

Live mutations hard-blocked (allow_live_mutations=False, $0 enforced)

Strict DNS/IP anti-SSRF/LFI (127.0.0.0/8, RFC1918, 169.254.169.254, CGNAT, .local/.internal/.nip.io/.sslip.io); hard Charter Redline blocks promoting deep_protocol, reality_iot, main_world_rpc, semantic_macro_local, mac_jxa, phone_control, OTP relays, or personal browser sessions (REDLINE_REJECTED)

Responsible Use Charter:

  • Zero Root CA MITM: Never installs system root certificates to intercept TLS.

  • Zero Live Process Injection: Never attaches Frida/LLDB to live applications.

  • Zero Credential Harvesting: Never reads OS Keychains or browser Login Data password databases; DB/Redis/HASS credentials are read exclusively from runtime env/session and never written into manifests.

  • Zero Anti-Bot / CAPTCHA Bypass: Genuine Cloudflare/Turnstile/reCAPTCHA/2FA challenges escalate cleanly to HUMAN_GATE_REQUIRED for human takeover.

  • Gate 8 Live Mutation Integrity: Both static AST analysis and dynamic isolated execution reject deceptive drivers that return fake staged_preview responses when real commits are requested (100% verified catch rate).


Related MCP server: foral

简体中文

为什么需要「新神·吞噬万物 v3.0.0(Swallow-Anything Apex Overdrive)」?

现有 Agent 工具生态普遍陷入两大陷阱:

  1. 工具 Schema 爆炸:每挂载一批扁平 MCP 服务就往上下文塞入 300–700+ 个工具定义(每轮白烧 33K–109K+ tokens),还没开始干活上下文先被挤爆。

  2. 盒内小模型套娃:在爬虫、录制器或监控框架内部再绑死一个小模型和 API Key,不仅拖慢外部强模型(Claude、Codex、Gemini、Cursor、Antigravity),还导致每次重复操作和轮询都在白烧推理 Token。

Swallow-Anything v3.0.0(Apex Overdrive / 新神·吞噬万物 3.0) 坚守 Zero-LLM-Inside(零内置大模型) 与 100% 纯 Python 3.11+ 标准库零依赖(dependencies = []),沿 四大终极进化轴 全面跃迁:

  1. 轴 1 — 万物吞噬扩疆(看一次即编译 + 深水协议器官):

    • swallow record(runtime/shadow_recorder.py)与 swallow extract-app(runtime/app_api_extractor.py):零 Root CA 页内间谍钩子(IN_PAGE_SPY_JS)、HAR/mitmdump 导入与 macOS AX/JXA 录制器,自动推断多步因果依赖链(如 CSRF/会话令牌 -> 串联 POST 写请求),一键编译为 0-Token 永久 causal-cap/1.0 能力包(RECORD_COMPILED_LIVE);同步支持静态 APK/DEX 与 Electron ASAR 接口提取结晶。

    • 深水协议器官(organs/organ_deep_protocols.py):<0.1 ms 直通路由 grpc://、grpcs://、docker://、postgres://、postgresql://、mysql://、redis://(纯标准库 RESP 客户端)、ssh://、unix://(纯标准库 AF_UNIX HTTP)与 localproc://(本机监听端口与 Unix Socket 发现),凭据零落盘且全员支持真实 commit_tool 写入。

  2. 轴 2 — 现实物联网与并发大吞噬:

    • 现实物联网器官(organs/organ_reality_iot.py):零配置局域网与硬件扫描(iot://discover:纯标准库 SSDP/UPnP 组播 + mDNS/Bonjour + USB/串口 + 可选 BLE)、Home Assistant REST 桥接(hass://)、纯标准库 MQTT 3.1.1 二进制编解码器(mqtt:// CONNECT/PUBLISH/SUBSCRIBE)、onvif://、ble://、serial://。

    • 并发大吞噬器(swallow devour / runtime/mass_devourer.py)与零拷贝武器库桥接(runtime/arsenal_bridge.py):有界多线程批量吞噬 mac-apps、phone-apps、docs、github-org、arsenal 及自定义目标清单,单靶故障隔离。

  3. 轴 3 — 24/7 0-Token 响应式反射引擎(swallow watch):

    • runtime/reactive_watcher.py:内置 poll_diff、fs_watch、webhook、stream 四类传感器,搭配零 eval()/exec() 确定性 JSON 谓词引擎(实测 288,323.0 次/秒、0 LLM Token)、防风暴 cooldown_sec/dedupe_sec 抑制、实弹能力/代码/Webhook 动作及 macOS launchd 守护配置导出。

  4. 轴 4 — 旗舰体验、全生态互通与可复现硬核基准:

    • 零 CDN 本地实时控制台(swallow ui / runtime/web_console.py):单文件零外链本地 Web 面板(/、/health、/api/overview、/api/search、/api/watch、/api/bench、/v1/tools)。

    • 一键 AI 客户端注入器(swallow setup / runtime/client_setup.py):覆盖 Claude Desktop、Claude Code、Cursor、Windsurf、Antigravity、Codex 6 大客户端;默认只读 --dry-run 展示 diff,--apply 自动生成带时间戳 .bak 备份且保留既有配置。

    • Code-Mode MCP V3 总线(runtime/code_mode_mcp.py):恒定仅暴露 4 个元工具(2,473 B 紧凑 / 2,634 B 完整),对比 81 个扁平能力包(366 工具 / 135,319 B)实现 54.72x 压缩 / 98.17% Token 削减;原生支持 Async Tasks(tasks/create -> tasks/get) 与 OpenAI Tools JSON(GET /v1/tools)。

    • 离线可复现 5 维基准(swallow bench / runtime/benchmark_suite.py):全本地回环实测,635.6 ms 输出完整五维实证指标。

60 秒上手

# 1. 零依赖安装
pip install git+https://github.com/pjrpjr/swallow-anything.git

# 2. 启动零 CDN 本地控制台 & 预览/一键注入 6 大 AI 客户端 MCP 配置
swallow ui --port 8765
swallow setup           # 安全只读预览 diff
swallow setup --apply   # 带 .bak 备份一键注入

# 3. 看一次即编译、并发大吞噬、0-Token 反射监控与一键硬核基准
swallow record web --har ./capture.har --cap-id my_recorded_api
swallow devour targets "https://petstore.swagger.io/v2/swagger.json" "iot://discover" "localproc://scan"
swallow watch list
swallow bench

# 4. 启动 <2.5 KB Code-Mode MCP 服务(支持 stdio / Streamable HTTP / OpenAI /v1/tools)
swallow serve-codemode --stdio

双区安全防火墙与合规宪章

  • Zone A(本人私域):保留本人账号业务字段,同时全量脱敏一切凭据、Bearer、JWT、Cookie、数据库/Redis 密码、Luhn 银行卡号与 CVV;非金钱写 1 步 DIRECT_WRITTEN,金钱动作强制 HMAC 双阶确认与预算门禁。

  • Zone B(公开发布区):强制全量 PII + 密钥脱敏、严格 DNS/IP 反 SSRF/LFI、强制 allow_live_mutations=False;宪章红线硬拦截所有 deep_protocol、reality_iot、个人桌面宏、手机控制、主世界浏览器 RPC、接码/OTP 与个人登录态向外公开发布(REDLINE_REJECTED)。

  • Gate 8 真实写完整性裁判:静态 AST + 动态隔离双校验,100% 捕获只返回 staged_preview 的假写驱动。

  • 工程红线:零系统 Root CA MITM、零 Frida/LLDB 活体注入、零 Keychain / Chrome Login Data 凭据窃取、零绕过 CAPTCHA/2FA(真实风控挑战精准上抛 HUMAN_GATE_REQUIRED 交由人工接管)。


License

Released under the MIT License.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to access internal systems without public APIs as typed, governed MCP tools, with human-approved writes and fail-closed contract updates.
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to create isolated Docker runtimes, execute commands, manage workspace files, drive a headed browser, and retrieve artifacts through eight semantic MCP tools, with progressive capability discovery and explicit sandbox lifecycle.
      Apache 2.0
    • F
      license
      Not graded
      quality
      B
      maintenance
      Gives AI agents a single MCP interface to discover, inspect, scope, and execute external capabilities—downstream MCP servers, HTTP APIs, and local tools—resolved on demand from a local index instead of preloaded catalogs. Enforces agent scopes, allow/ask/deny policies, health gates, and schema snapshots at execution time, with local execution traces.
      -