Files
sm-quizzes-plugin/mcp.go
Jakub Zych e615cc88db feat: list and show quizzes over MCP for their owner
- quizzes_list_quizzes and quizzes_show_quiz bound to GET /api/v1/quizzes
  and /api/v1/quizzes/{slug} behind user.api_token, the per-user
  golem15.quizzes.manage throttle, a scope and the access_quizzes permission
- the permission is grantable through pact.HasFrontendPermissions
- owner JSON shapes with solutions in manage_json.go, never used by a
  student route
2026-11-09 14:25:07 +01:00

15 lines
497 B
Go

package quizzes
import "git.golem15.com/golem15/summercms/modules/pact"
var _ pact.HasMCP = (*Plugin)(nil)
// MCP declares the owner's quiz tools (exposed as quizzes_*). Every tool
// lists the golem15.quizzes.access_quizzes permission, so a user whose
// groups lack it never lists them, and every route the tools bind checks
// it again (D-13). The plugin still requires only golem15.user and names
// no OAuth server.
func (p *Plugin) MCP() pact.MCP {
return pact.MCP{Tools: quizTools()}
}