Adding to Sean,
You can also use sys.endpoints DMV to get that
Below query will help you,
select
name , endpoint_id , type_desc from sys.database_mirroring_endpoints where type_desc='DATABASE_MIRRORING'
select
name from sys.endpoints where type_desc = 'DATABASE_MIRRORING'
Thanks,
Leks