Skip to main content
Glama

run_ida_command

Execute IDA Pro scripts to automate reverse engineering and binary analysis tasks through the IDA Pro MCP Server.

Instructions

Execute an IDA Pro Script (IdaPython, Version IDA 8.3)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesscript

Implementation Reference

  • MCP tool handler for 'run_ida_command': validates arguments using isValidRunIdaArgs, executes the IDA script via IDARemoteClient.executeScript, and returns formatted text response with output or error.
    case 'run_ida_command': if (!isValidRunIdaArgs(request.params.arguments)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid run IDA command arguments' ); } try { const { script } = request.params.arguments; let result = await ida.executeScript(script); if (result.error) { return { content: [ { type: 'text', text: `Error executing IDA Pro script: ${result.error}`, }, ], isError: true, }; } return { content: [ { type: 'text', text: `IDA Pro Script Execution Results:\n\n${result.output}`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error executing IDA Pro command: ${error.message || error}`, }, ], isError: true, }; }
  • index.ts:204-217 (registration)
    Registration of the 'run_ida_command' tool in the ListTools response, defining its name, description, and input schema requiring a 'script' string.
    { name: 'run_ida_command', description: 'Execute an IDA Pro Script (IdaPython, Version IDA 8.3)', inputSchema: { type: 'object', properties: { script: { type: 'string', description: 'script', } }, required: ['script'], }, },
  • TypeScript interfaces defining arguments for IDA command tools; RunIdaDirectCommandArgs matches 'run_ida_command' input with 'script' field.
    interface RunIdaCommandArgs { scriptPath: string; outputPath?: string; } interface RunIdaDirectCommandArgs { script: string; }
  • Runtime validation function for 'run_ida_command' arguments, checking for object with non-null 'script' string property.
    const isValidRunIdaArgs = (args: any): args is RunIdaDirectCommandArgs => { return ( typeof args === 'object' && args !== null && (typeof args.script === 'string') ); };
  • Core helper function called by the tool handler; sends the script via POST to IDA remote API '/execute' endpoint and returns ExecuteResponse.
    async executeScript(script: string, logHTTP = false): Promise<ExecuteResponse> { return this.post<ExecuteResponse>('/execute', { script }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fdrechsler/mcp-server-idapro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server