Serendipitous peer discovery is important for emerging Internet applications, particularly in dynamic environments (e.g. the IoT, ubiquitous and fog domains) where a large number of resources operate different services in any one locality and resource availability varies unpredictably over time. The current approach is to select services at design time based on offered providers and their reputation. This obviously has its limitations, particularly in terms of scalability and adaptivity, let alone the challenges of crossing vendor and operator divides. This work demonstrates how an application is better able to dynamically adapt to unforeseen environmental changes through in-network mediation of service requests. In our model, application developers express their service needs using intents. These are mapped to appropriate service providers with explicit consideration of the intermediate network. We design a general architecture and associated algorithms to realise intent formulation and processing for mapping application intents to service providers. Our results demonstrate the feasibility of adopting in-network mediation to enable adaptive application deployment using declarative intents.