# ida_mcp_bridge

Minimal CLI companion for using `ida-pro-mcp` from shell scripts, lightweight agents, and general AI workflows.

This project is not a replacement for `ida-pro-mcp`. It is a thin bridge for cases where you want a simple CLI instead of a full MCP client.

## When It Helps

- call IDA MCP tools from a terminal
- script repeatable reverse-engineering actions
- connect a general AI workflow to IDA over stdin/stdout, files, and shell commands

Typical setup:

- IDA Pro + `ida-pro-mcp` run in the same environment
- `ida_mcp_bridge` runs wherever your shell or AI tooling runs
- the bridge connects to the SSE endpoint exposed by `ida-pro-mcp`

## Quick Start

```powershell
python bridge.py --url http://127.0.0.1:8744/sse check
python bridge.py --url http://127.0.0.1:8744/sse tools
python bridge.py --url http://127.0.0.1:8744/sse call get_metadata --extract structured
```

For Windows PowerShell, prefer `--arguments-file` over inline JSON.

```powershell
python bridge.py --url http://127.0.0.1:8744/sse call decompile_function --arguments-file examples/decompile_function.json
```

## Main Commands

- `check`: validate connectivity and fetch current metadata
- `tools`: list tools exposed by the MCP server
- `call`: invoke any tool by name
- `clean`: remove `.cache/` and other temporary local artifacts

## Cache

- cache is opt-in via `--cache`
- default cache directory: `.cache/`
- cache files are ignored by git

Examples:

```powershell
python bridge.py --url http://127.0.0.1:8744/sse check --cache
python bridge.py --url http://127.0.0.1:8744/sse call get_metadata --cache
```

## VM Notes

If IDA runs inside a VM, `127.0.0.1` only works from inside that same VM.

- `ida-pro-mcp --transport` uses a transport address such as `http://0.0.0.0:8744`
- `bridge.py --url` uses the reachable SSE address, usually `http://<vm-ip>:8744/sse`

Do not use these from the host:

- `http://0.0.0.0:8744/sse`
- `http://127.0.0.1:8744/sse` unless the bridge runs inside that same VM

## Files

- [README.zh-CN.md](E:\新建文件夹\ida_mcp_bridge\README.zh-CN.md): Chinese README
- [SECURITY.md](E:\新建文件夹\ida_mcp_bridge\SECURITY.md): security notes

## Notes

- PowerShell JSON escaping can be awkward; `--arguments-file` and `--arguments-stdin` are usually more reliable
- `--extract content-text` only works when the response actually contains text content entries
- this repository intentionally ignores temporary analysis artifacts and cache files
