Skip to main content
Glama
opensensor

Binary Ninja Cline MCP Server

by opensensor

get_binary_info

Extract binary metadata such as file structure, symbols, and sections from executable files using Binary Ninja's analysis capabilities through the Cline MCP Server.

Instructions

Get binary metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • Main handler for the 'get_binary_info' MCP tool. Extracts path parameter, fetches file information from BinaryNinjaHTTPClient, formats it into a structured response including filename, architecture, platform, entry point, size, etc., and returns it.
    elif method == "get_binary_info": path = params.get("path") if not path: return {"error": "Path parameter is required"} # We assume the binary is already loaded # Just log the path for debugging logger.info(f"Using binary: {path}") file_info = client.get_file_info(path) # Format the response to match the original API info = { "filename": file_info.get("filename", ""), "architecture": file_info.get("arch", {}).get("name", "unknown"), "platform": file_info.get("platform", {}).get("name", "unknown"), "entry_point": hex(file_info.get("entry_point", 0)), "file_size": file_info.get("file_size", 0), "is_executable": file_info.get("executable", False), "is_relocatable": file_info.get("relocatable", False), "address_size": file_info.get("address_size", 0) } return {"result": info}
  • Input schema definition for the 'get_binary_info' tool in the list_tools response. Defines 'path' as required string parameter.
    { "name": "get_binary_info", "description": "Get information about a binary file", "inputSchema": { "type": "object", "properties": { "path": { "type": "string", "description": "Path to the binary file" } }, "required": ["path"] }
  • HTTP MCP handler for 'get_binary_info'. Validates path parameter, calls client.get_file_info, wraps result as MCP content.
    elif method == "get_binary_info": path = params.get("path") if not path: logger.error("Missing 'path' parameter") return self._error_response(request_id, -32602, "Missing 'path' parameter") if not isinstance(path, str): logger.error(f"Invalid path type: {type(path)}") return self._error_response(request_id, -32602, "Parameter 'path' must be a string") logger.debug(f"Getting info for file: {path}") info = self.client.get_file_info(path) return self._wrap_result(request_id, json.dumps(info, indent=2))
  • Tool registration and schema in MCP_TOOLS list for 'get_binary_info', defining input as object with required 'path' string.
    "name": "get_binary_info", "description": "Get binary metadata", "streaming": False, "inputSchema": { "type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"] }
  • Simplified stdin MCP handler for 'get_binary_info', similar to binaryninja_server.py, formats and returns binary info.
    elif method == "get_binary_info": path = params.get("path") if not path: return {"error": "Path parameter is required"} file_info = client.get_file_info(path) # Format the response to match the original API info = { "filename": file_info.get("filename", ""), "architecture": file_info.get("arch", {}).get("name", "unknown"), "platform": file_info.get("platform", {}).get("name", "unknown"), "entry_point": hex(file_info.get("entry_point", 0)), "file_size": file_info.get("file_size", 0), "is_executable": file_info.get("executable", False), "is_relocatable": file_info.get("relocatable", False), "address_size": file_info.get("address_size", 0) } return {"result": info}

Other Tools

Related Tools

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/opensensor/bn_cline_mcp'

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