A boy charged over an alleged stabbing at a high school in Queanbeyan has appeared in court and been referred for a mental health assessment.

The youth, who cannot be identified, appeared before the Children's Court in Queanbeyan this morning.

Media were not permitted into the hearing.

Bail registrar Michael Wolters referred the boy for a mental health assessment.

The boy will be held for treatment if he is found to be mentally ill, or returned to court if he is not.

All parties in the case agreed to the referral.