OBJECTIVE: Most Americans with opioid use disorder (OUD) do not receive indicated medical care. A clinical decision support (CDS) tool for primary care providers (PCPs) could address this treatment gap. Our primary objective was to build OUD-CDS tool and demonstrate its functionality and accuracy. Secondary objectives were to achieve high use and approval rates and improve PCP confidence in diagnosing and treating OUD. METHODS: A convenience sample of 55 PCPs participated. Buprenorphine-waivered PCPs (n = 8) were assigned to the intervention. Non-waivered PCPs (n = 47) were randomized to intervention (n = 24) or control (n = 23). Intervention PCPs received access to the OUD-CDS, which alerted them to patients at potentially increased risk for OUD or overdose and guided diagnosis and treatment. Control PCPs provided care as usual. RESULTS: The OUD-CDS was functional and accurate following extensive multi-phased testing. PCPs used the OUD-CDS in 5% of encounters with at-risk patients, far less than the goal of 60%. OUD screening confidence increased for all intervention PCPs and OUD diagnosis increased for non-waivered intervention PCPs. Most PCPs (65%) would recommend the OUD-CDS and found it helpful with screening for OUD and discussing and prescribing OUD medications. DISCUSSION: PCPs generally liked the OUD-CDS, but use rates were low, suggesting the need to modify CDS design, implementation strategies and integration with existing primary care workflows. CONCLUSION: The OUD-CDS tool was functional and accurate, but PCP use rates were low. Despite low use, the OUD-CDS improved confidence in OUD screening, diagnosis and use of buprenorphine. NIH Trial registration NCT03559179.