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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。