I had been following the methodolgy laid out in https://www.merrell.dev/ios-share-extension-with-swiftui-and-swiftdata/ but hadn't followed it exactly. It turns out if I pass the newly constructed container from the ViewController to the SwiftUI view like this:
let contentView = UIHostingController(rootView: ShareView(context: context).modelContainer(modelContainer))
then in the SwiftUI view @Environment(.modelContext) private var modelContext
yields a good ModelContext. I'm scratching my head a little, but it works.