  We present AMICO (Adaptive Matched Identifier of Clustered Objects), a new
algorithm for the detection of galaxy clusters in photometric surveys. AMICO is
based on the Optimal Filtering technique, which allows to maximise the
signal-to-noise ratio of the clusters. In this work we focus on the new
iterative approach to the extraction of cluster candidates from the map
produced by the filter. In particular, we provide a definition of membership
probability for the galaxies close to any cluster candidate, which allows us to
remove its imprint from the map, allowing the detection of smaller structures.
As demonstrated in our tests, this method allows the deblending of close-by and
aligned structures in more than $50\%$ of the cases for objects at radial
distance equal to $0.5 \times R_{200}$ or redshift distance equal to $2 \times
\sigma_z$, being $\sigma_z$ the typical uncertainty of photometric redshifts.
Running AMICO on mocks derived from N-body simulations and semi-analytical
modelling of the galaxy evolution, we obtain a consistent mass-amplitude
relation through the redshift range $0.3 < z < 1$, with a logarithmic slope
$\sim 0.55$ and a logarithmic scatter $\sim 0.14$. The fraction of false
detections is steeply decreasing with S/N, and negligible at S/N > 5.
