77import { Server } from '@modelcontextprotocol/sdk/server/index.js'
88import { NostrServerTransport , PrivateKeySigner , EncryptionMode , withServerPayments , LnBolt11NwcPaymentProcessor } from '@contextvm/sdk'
99import { loadPricedCapabilities } from './payments/cvm-pricing.js'
10+ import { resolveCvmPaymentInteractionPolicy } from './payments/cvm-payment-policy.js'
1011import { ResilientRelayPool } from './resilient-relay-pool.js'
1112import type { Config } from './config.js'
1213import { getLogger } from './utils/logger.js'
@@ -207,7 +208,7 @@ export class CVMServer {
207208 name : 'RelayVM' ,
208209 about : 'ContextVM server that aggregates NIP-66 relay intelligence and exposes it via MCP over Nostr. Service provided by nostr.watch' ,
209210 } ,
210- isPublicServer : cvmConfig . allowedPubkeys . length === 0 ,
211+ isAnnouncedServer : cvmConfig . allowedPubkeys . length === 0 ,
211212 allowedPublicKeys : cvmConfig . allowedPubkeys . length > 0 ? cvmConfig . allowedPubkeys : undefined ,
212213 } )
213214
@@ -224,13 +225,18 @@ export class CVMServer {
224225 } )
225226
226227 const pricedCapabilities = loadPricedCapabilities ( )
228+ const paymentInteraction = resolveCvmPaymentInteractionPolicy ( )
227229
228230 this . transport = withServerPayments ( this . transport , {
229231 processors : [ nwcProcessor ] ,
230232 pricedCapabilities,
233+ paymentInteraction,
231234 } )
232235
233- logger . info ( { pricedTools : pricedCapabilities . length } , 'CVM payment gating enabled (CEP-8)' )
236+ logger . info ( {
237+ pricedTools : pricedCapabilities . length ,
238+ paymentInteraction,
239+ } , 'CVM payment gating enabled (CEP-8)' )
234240 }
235241
236242 // DISABLED: Subscription system
0 commit comments