Find all prime numbers $p$ such that $ p = m^2 + n^2$ and $p\mid m^3+n^3-4$.
1. **Given Conditions:**
   - \( p = m^2 + n^2 \)
   - \( p \mid m^3 + n^3 - 4 \)

2. **Express \( m^3 + n^3 \) in terms of \( m \) and \( n \):**
   \[
   m^3 + n^3 = (m+n)(m^2 - mn + n^2)
   \]
   Since \( p = m^2 + n^2 \), we can rewrite:
   \[
   m^3 + n^3 = (m+n)(p - mn)
   \]

3. **Given \( p \mid m^3 + n^3 - 4 \), substitute the expression:**
   \[
   p \mid (m+n)(p - mn) - 4
   \]
   Since \( p \mid p \), we have:
   \[
   p \mid (m+n)(-mn) - 4
   \]
   Simplifying, we get:
   \[
   p \mid -mn(m+n) - 4
   \]
   \[
   p \mid mn(m+n) + 4
   \]

4. **Using the identity \( 2mn \equiv (m+n)^2 \pmod{p} \):**
   \[
   p \mid (m+n)^3 + 8
   \]
   This can be factored as:
   \[
   p \mid (m+n+2)((m+n)^2 - 2(m+n) + 4)
   \]

5. **Considering the factors:**
   - \( p \mid m+n+2 \)
   - \( p \mid (m+n)^2 - 2(m+n) + 4 \)

6. **Case 1: \( p \mid m+n+2 \):**
   - Using the Cauchy-Schwarz inequality:
     \[
     (m+n)^2 \leq 2(m^2 + n^2) = 2p
     \]
     Therefore:
     \[
     |m+n| \leq \sqrt{2p}
     \]
     Given \( p \mid m+n+2 \), we have:
     \[
     |m+n+2| \leq \sqrt{2p} + 2
     \]
     This implies:
     \[
     p \leq \sqrt{2p} + 2
     \]
     Squaring both sides:
     \[
     p^2 \leq 2p + 4
     \]
     \[
     p^2 - 2p - 4 \leq 0
     \]
     Solving this quadratic inequality:
     \[
     p = \frac{2 \pm \sqrt{4 + 16}}{2} = 1 \pm \sqrt{5}
     \]
     Since \( p \) is a prime number, we check small primes:
     - For \( p = 2 \):
       \[
       2 = m^2 + n^2 \implies (m, n) = (1, 1)
       \]
       Check \( p \mid m^3 + n^3 - 4 \):
       \[
       2 \mid 1 + 1 - 4 \implies 2 \mid -2 \text{ (True)}
       \]
       So, \( p = 2 \) is a solution.

7. **Case 2: \( p \mid 2mn - 2(m+n) + 4 \):**
   - Using AM-GM inequality:
     \[
     mn \leq \frac{m^2 + n^2}{2} = \frac{p}{2}
     \]
     Therefore:
     \[
     p \mid mn - m - n + 2
     \]
     Since \( mn \leq \frac{p}{2} \), we check small primes:
     - For \( p = 2 \):
       \[
       2 = m^2 + n^2 \implies (m, n) = (1, 1)
       \]
       Check \( p \mid mn - m - n + 2 \):
       \[
       2 \mid 1 - 1 - 1 + 2 \implies 2 \mid 1 \text{ (False)}
       \]
       So, no new solutions from this case.

Conclusion:
The only prime number \( p \) that satisfies both conditions is \( p = 2 \).

The final answer is \( \boxed{2} \)