Seven read-only MCP abilities, category lh-mcp-buddypress-queries. Abilities that never return an email address are gated to BuddyPress’s bp_moderate capability; abilities that return member email addresses (get-group-members, search-members) are gated to edit_users instead, matching the precedent set by lh-membership/list-members. Deliberately not exposed: private messages (messages_get_threads) and friend connections (friends_get_friend_user_ids) — a different risk category to group/activity/directory metadata, out of scope for this plugin.
Group membership
Ability
Capability
Notes
get-group-members
edit_users
Members of a group: display name, email, roles (admin/mod/member/banned), join date. Optional role filter and search. Wraps groups_get_group_members().
get-group-membership-status
bp_moderate
Whether a user is member/admin/mod/banned in a group, plus pending-invite status. No email returned.
Group listing
Ability
Capability
Notes
list-groups
bp_moderate
Search/filter groups by name, status, user, include/exclude IDs — independent of any taxonomy. For taxonomy-based queries, use lh-buddypress-group-taxonomies/get-groups-by-taxonomy instead. Wraps groups_get_groups(); status filtering is applied client-side after fetching with show_hidden: true, the same pattern as the taxonomy plugin.
get-group
bp_moderate
Single group by ID or slug, including admin user IDs only (no email — use get-group-members filtered to role: admin for that).
Activity
Ability
Capability
Notes
get-group-activity
bp_moderate
Recent activity stream for a group. Content stripped of markup and truncated to 300 chars. Wraps bp_activity_get() with object: groups.
get-user-activity
bp_moderate
Recent activity stream authored by a single user, across all components.
Member directory
Ability
Capability
Notes
search-members
edit_users
BuddyPress member directory search (active/newest/alphabetical/online/random), distinct from lh-membership/list-members which is taxonomy-based rather than directory-based. Wraps bp_core_get_users(). Returns email.
Worked example: admin contact lookup
Finding a group’s admin name and email is a two-call round trip, usable from any subsite connector:
// 1. Resolve the group and get admin user ID(s)
{ "tool": "lh-mcp-buddypress-queries/get-group", "params": { "slug": "sugar-gliders" } }
// -> admin_ids: [7407]
// 2. Get that admin's name and email
{ "tool": "lh-mcp-buddypress-queries/get-group-members", "params": { "group_id": 21, "role": "admin" } }
// -> name and email of the group admin
Architectural notes
Bootstraps entirely on plugins_loaded (no bp_loaded dependency, unlike lh-buddypress-group-taxonomies) since it has no BuddyPress-specific class loading order requirements — every execute callback guards with function_exists()/class_exists() checks instead, since BuddyPress itself may not be fully loaded at plugins_loaded time on every request path.
Requires WordPress 6.9+ since wp_register_ability()/wp_register_ability_category() require that version.
list-groups and get-groups-by-taxonomy (in the taxonomy plugin) share the same status-filter-after-fetch pattern, since BuddyPress core doesn’t yet support filtering groups_get_groups() by a list of statuses directly.
Plugin folder, main file, class name, and ability namespace were all renamed from lh-buddypress-queries to lh-mcp-buddypress-queries in v2.0.0 — a breaking change for anything calling the old ability names directly.
Related plugins
lh-buddypress-group-taxonomies — taxonomy-scoped group queries (get-groups-by-taxonomy, list-terms, list-group-taxonomies)
lh-membership — taxonomy-based (not directory-based) member listing, same edit_users capability precedent for email-bearing abilities