Metamask docs have an answer for you:
The token search box and the auto-detect functions are a part of a centralized solution. We encourage developers to use the EIP-747 method, which you can find in the technical documentation below:
In the above link, you can find instructions on how to integrate the wallet_watchAsset API as defined in EIP-747 without having to create code, and also a more advanced code example that includes the option to set a logo or icon for your token. This will let your users add your token to their MetaMask wallet, and see it, easily.