frida_mcp
MCP server for Frida dynamic instrumentation, enabling AI agents to enumerate devices/processes, attach, inject JavaScript, hook functions, read memory, and collect results via MCP tools.
README
frida_mcp
A Model Context Protocol server for Frida, built on the official MCP Python SDK (FastMCP).
It exposes Frida's dynamic-instrumentation capabilities as MCP tools so an AI agent (or any MCP client) can enumerate devices/processes, attach, inject JavaScript, hook functions, read memory, and collect results.
Features
- Full device & process management (list / spawn / attach / resume / kill)
- Persistent sessions and per-script lifecycle (load / unload individual scripts)
- Arbitrary JavaScript execution:
load_script— persistent (hooks / interceptors), messages capturedexec_script— one-shot, returns the evaluated value + console.log synchronously
rpc_call— invokerpc.exportson a persistent script- Per-(session, script) message queues with binary
datasupport - Convenience tools:
read_memory,list_modules,list_exports,find_export,scan_memory - Robust error handling (tools return
{status: "error"}instead of throwing) - Binary-data cap to keep large dumps from flooding the channel
Tools
Device / process
list_devices()— local, USB, remotelist_processes(device_id?)/find_process(name, device_id?)spawn_process(program, device_id?, paused=true)— suspended by default so you can hook before resumeresume_process(pid, device_id?)/kill_process(pid, device_id?)
Session
attach_to_process(pid, device_id?, name?)→session_idlist_sessions()— pids, scripts, pending message counts, detached statedetach_session(session_id)— unload all scripts + detach
Script
load_script(session_id, source, name?, runtime?)→script_id— persistent; messages capturedunload_script(session_id, script_id)exec_script(session_id, source, timeout?)— one-shot, returns value + logsrpc_call(session_id, script_id, method, args?, timeout?)— callrpc.exports
Messages
get_messages(session_id, script_id?, clear?, limit?, include_data?)— retrievesend()output; binarydatabase64-inlined up to a cap
Convenience
read_memory(session_id, address, size)→ hex + base64list_modules(session_id)list_exports(session_id, module, kind?)find_export(session_id, module, export_name)scan_memory(session_id, pattern, module?, max_hits?)
Resources
frida://version— Frida binding versionfrida://sessions— JSON snapshot of active sessions
Install
pip install -e E:/Tools/Frida/frida_mcp
# also need the frida runtime on the host
pip install frida
Requires Python 3.8+, Frida 16+, and a reachable frida-server (or gadget) on the target.
Configure (.mcp.json)
{
"mcpServers": {
"frida_mcp": {
"command": "frida_mcp"
}
}
}
Typical workflow: hook before the target loads
spawn_process("com.example.app") # -> pid (suspended)
attach_to_process(pid) # -> session_id
load_script(session_id, "<hook JS>") # -> script_id (keep-alive)
resume_process(pid) # app runs; hook fires
get_messages(session_id) # collect send() output
unload_script(session_id, script_id) # or detach_session(session_id)
Example: dump every Lua chunk that the Lua VM compiles
Bypasses any AssetBundle encryption entirely — by the time the Lua VM sees the source, it's already decrypted. The script writes each chunk to the device filesystem and only reports small metadata back (so the MCP channel never sees the full payload):
// load_script(source=...)
var DUMP = "/sdcard/lua_dump/";
var counter = 0;
Interceptor.attach(Module.findExportByName("libxlua.so", "luaL_loadbuffer"), {
onEnter: function (args) {
try {
var buf = args[1];
var len = args[2].toInt32();
var bytes = Memory.readByteArray(buf, len);
var path = DUMP + Date.now() + "_" + (counter++) + ".lua";
var f = new File(path, "wb");
f.write(bytes);
f.flush(); f.close();
send({ type: "lua_chunk", path: path, size: len, head: hexdump(bytes, { length: 32 }) });
} catch (e) { send({ type: "err", err: e.toString() }); }
}
});
The exact chunk-name argument to
luaL_loadbufferdepends on the build; tune per target. Thenadb pull /sdcard/lua_dumpand you have the plaintext Lua.
Notes & limits
- Tools return
{status: "error", error: "..."}(orstatus: "timeout") instead of throwing. - Binary
datalarger than 64 KiB is reported by size only — write to a device file andadb pull. - Anti-Frida defences in the target are the environment's concern — confirm you can attach first.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.