Skip to content

Skills, a tool installer and MCP in both directions - #16

Merged
foursecondfivefour merged 2 commits into
mainfrom
arena/36a4d756-nerveforge
Dec 2, 2026
Merged

foursecondfivefour merged 2 commits into
mainfrom
arena/36a4d756-nerveforge

Conversation

@foursecondfivefour

@foursecondfivefour foursecondfivefour commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

What this adds

Three things that make the agent aware of the machine it runs on, kept separate on purpose:

  • Skills — a Markdown body plus the tools it declares. GET /api/skills reports ready / partial / blocked from what is actually installed, and read_skill only hands the body over together with that verdict. Twelve ship: binary triage, function recovery, native debugging, malware static, YARA authoring, dependency audit, protocol reversing, Android APK, firmware/IoT, disk forensics, memory forensics, dynamic tracing.
  • Tool catalogue and installer — 24 entries across RE, debugging, mobile, forensics and networking. The install button and python -m nerveforge.toolkit --install radare2 follow the cloudflared pattern: GitHub release, SHA-256 from the same API response, into the data dir with mode 0700, no PATH, no root. Tools that publish no standalone Linux binary (Ghidra, IDA, Binary Ninja, Sleuth Kit) say "use a package manager" instead of offering a button that would fail.
  • MCP in both directions — twelve presets as a client (ida-pro-mcp, ghidra-mcp, ghidra-headless-mcp, radare2-mcp, binaryninja-mcp, x64dbg-mcp, jadx-mcp, frida-mcp, volatility-mcp, tsk-mcp, yara-mcp, nmap-mcp) that name exactly what blocks each one. HTTP presets talk to a server the user already runs; stdio presets spawn only on request, and nothing is launched at startup. Every call is audited with secret-looking arguments redacted; a mutation-shaped tool name is refused with 409 until allow_mutating, which the panel only sends after a confirmation. As a server, python -m nerveforge.toolkit --serve speaks MCP 2025-06-18 over stdio with eight tools, and --allow-write is a separate flag.

The panel gets two tabs: Skills and MCP.

Bugs found by the tests

Six of the new tests found defects rather than covering them:

  1. send() let a ValueError from a closed pipe escape as a 500.
  2. arguments: [] was accepted, because or {} turns an empty list into a dict.
  3. jadx-1.0.tar.gz was saved as asset.gz and installed as if the tarball were the binary — no tar branch ever ran.
  4. mcp.connect could lose a live session because a server's serverInfo was not JSON-serialisable.
  5. A mutation refusal mapped to 400 where the panel needs 409; an unknown server now maps to 404.
  6. A reader thread that saw EOF left waiting requests to time out instead of waking them.

Two preset bugs surfaced as well: ghidra-mcp required a java_token tool that never existed (there is now a real java entry), and ToolSpec could not resolve a per-host asset name, so the Android and Windows variants were unreachable.

Checks

  • 1664 tests pass (skipped=1), ruff clean, CI green on Linux 3.10/3.12 and Windows.
  • New package at 99% branch coverage; mcpserver, registry, skillcatalog at 100%.
  • Live HTTP check against a real server: 17 toolkit routes answer 200/201/400/401/404/409 as documented, docs/API.md regenerated.
  • python -m nerveforge.toolkit --serve answered a real MCP client (2025-06-18, 8 tools) and refused workspace_write without --allow-write.
  • Installer exercised offline against local archives (zip with a directory, tarball, bad digest, missing member) because the sandbox network blocks release-asset downloads.

VERSION stays 8.1.0; this rides in Unreleased.

Arena Agent and others added 2 commits December 2, 2026 12:19
The agent could drive the bridge but had no idea what the machine could do.
Three things close that gap and they stay separate on purpose.

Skills are Markdown bodies plus the tools they declare. /api/skills reports
ready/partial/blocked from what is actually installed, and read_skill only
hands the body over together with that verdict. Twelve ship (triage,
function recovery, debugging, malware static, YARA, dependency audit,
protocol reversing, APK, firmware, disk and memory forensics, tracing).

The catalogue covers RE, debugging, mobile, forensics and networking with
the release asset each entry would use, so the install button and
`--install` follow the cloudflared pattern: GitHub release, SHA-256 from
the same API response, into the data dir with mode 0700, no PATH, no root.
Tools without a standalone Linux binary say so instead of failing later.

MCP works both ways. As a client, twelve presets report exactly what
blocks each one; HTTP presets talk to a server the user already runs and
stdio presets spawn only on request. Every call is audited with secrets
redacted, and a mutation-looking tool needs allow_mutating, which the
panel asks for first. As a server, `--serve` speaks 2025-06-18 over stdio
with eight tools; --allow-write is a separate flag.

Six tests found defects rather than covering them: a closed pipe escaped
send() as a 500, `arguments: []` was accepted because `or {}` turns an
empty list into a dict, a .tar.gz was saved as asset.gz and installed as
if the tarball were the binary, mcp.connect could lose a live session on
a non-JSON serverInfo, a mutation refusal was a 400 where the panel needs
409, and a reader thread seeing EOF left waiters to time out. Two preset
bugs surfaced too: ghidra-mcp required a java_token tool that never
existed, and ToolSpec could not resolve a per-host asset name.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Three tests assumed Linux: one asserted YARA's asset for the host instead of
for the platform it was naming, one expected a tool to be undownloadable
everywhere when it is only undownloadable here, and one compared a resolved
binary name to the Unix spelling. CI runs Windows, so they now name the
platform they mean or derive the expected suffix from sys.platform.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@foursecondfivefour
foursecondfivefour merged commit 0a276c7 into main Dec 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant