Commit f9a6bc2
fix(binary-ninja-client): use GET + JSON for /decompile
The binja_mcp plugin's HTTP server only routes /decompile in do_GET
(http_server.py line 825). do_POST has no /decompile branch, so the
previous client code — which sent a form-urlencoded POST and then
treated the response body as the raw decompiled text — failed for
every function: the server fell through to a 4xx and the client
reported "Function not found" even though the function existed in
list_functions / search_functions.
Switch to GET ?name=<func> with reqwest's query() (consistent with
list_functions and search_functions in this same file), parse the
JSON {"decompiled": "..."} envelope, and surface the JSON "error"
field as either FunctionNotFound or RequestFailed. Keep a plain-text
fallback for older / future plugin variants that might return text.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 72771f4 commit f9a6bc2
1 file changed
Lines changed: 29 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
226 | 232 | | |
227 | 233 | | |
228 | 234 | | |
229 | 235 | | |
230 | 236 | | |
231 | 237 | | |
232 | | - | |
233 | | - | |
| 238 | + | |
| 239 | + | |
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
239 | 245 | | |
240 | 246 | | |
241 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
242 | 264 | | |
243 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
244 | 268 | | |
245 | 269 | | |
246 | 270 | | |
247 | | - | |
| 271 | + | |
248 | 272 | | |
249 | 273 | | |
250 | 274 | | |
| |||
0 commit comments