Skip to main content
Glama
opensensor

Binary Ninja Cline MCP Server

by opensensor

get_binary_info

Extract metadata from binary files to analyze structure and properties for security research or reverse engineering purposes.

Instructions

Get binary metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • Primary handler for the get_binary_info MCP tool. Retrieves binary file information using BinaryNinjaHTTPClient.get_file_info and formats the response with key metadata like architecture, entry point, size, etc.
    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.
    {
        "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"]
        }
  • Registration of get_binary_info tool in the call_tool handler, delegating to the method handler.
    if tool_name == "get_binary_info":
        return handle_request({
            "method": "get_binary_info",
            "params": tool_args
        }, client)
  • HTTP MCP server handler for get_binary_info, calls client.get_file_info(path) and wraps result.
    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))
  • Input schema for get_binary_info in MCP_TOOLS array for HTTP server.
    "name": "get_binary_info",
    "description": "Get binary metadata",
    "streaming": False,
    "inputSchema": {
        "type": "object",
        "properties": {"path": {"type": "string"}},
        "required": ["path"]
    }

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other 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