frida-mcp
# frida-mcp
A simple MCP server exposing persistent, scriptable [Frida](https://frida.re)
dynamic instrumentation to an AI agent. Built for Windows reversing,
malware/security analysis, and general dynamic debugging.
## Install
pip install -e .
Requires Python 3.11+. Frida is the only runtime dependency.
## Run
FRIDA_MCP_PROJECT=./mytarget.fmcp python -m frida_mcp
Register it with your MCP client (stdio transport). All state lands in the
`.fmcp` project directory: `db.sqlite` (metadata) + `traces/*.jsonl` (events).
## Capabilities
- Process control: spawn (gated), attach, resume, detach, kill, list modules.
- Memory: read, write, AOB/pattern scan, ranges.
- Hooks: `add_hook`, `trace_api` (e.g. `kernel32!CreateFile*`) with backtraces — all calls stream to disk.
- `eval_js`: run JS in a persistent in-process context; results come back as
structured typed values you can feed straight into `read_memory`/`disassemble`.
- `disassemble`: read N instructions from live memory (Capstone).
- Persistence: `list_sessions` / `resume_session` re-attach and reinstall hooks
if the target is alive, or tell you to re-spawn if it died. Events, REPL
history, and notes survive restarts.
Deep static analysis (xrefs, function boundaries, decompilation) is out of
scope — use an IDA or x64dbg MCP for that.
## Tests
pytest # unit tests (no target needed)
pytest -m live # integration tests (attach to a real process)
TDQS
Scored across 19 tools
Each tool targets a distinct Frida operation: lifecycle (attach, detach, spawn, resume, kill), memory (read, write, scan, disassemble), hooking (add_hook, trace_api, eval_js), listing (modules, processes, sessions, notes), and utilities (resume_session, read_events). Even similar tools like add_hook and trace_api are differentiated by specificity: add_hook for exact addresses or exports, trace_api for glob patterns. No two tools share an overlapping purpose.
Tools use snake_case consistently, but verb patterns vary: some are bare verbs (attach, detach, kill, resume, spawn), while others are verb_noun compounds (add_hook, read_memory, list_modules). This mix of single-word and compound names creates mild inconsistency, though each name is readable and descriptive. A more uniform verb_noun pattern would improve predictability.
19 tools cover a broad Frida feature set (process control, memory, hooks, scripting, event logging, and notes) without feeling overwhelming. While slightly above the typical 3–15 range, each tool addresses a core capability, and no tool seems redundant. The count is justified by the domain's complexity.
The tool surface covers essential operations but has notable gaps: no way to list installed hooks, remove hooks, or enumerate memory regions for scanning (though scan_memory accepts ranges). Unhooking and hook introspection are missing, and while eval_js provides scripting, a dedicated 'list scripts' tool is absent. These omissions may force agents to use workarounds.