Implements 15 new MCP tools in the `org` domain covering organization CRUD, membership queries, and team management. All tools follow existing patterns and are available via both MCP and CLI modes.
3.1 KiB
3.1 KiB
1. Scaffold and Registration
- 1.1 Create
operation/org/package withorg.go,membership.go,teams.gofiles and aRegisterTool(s *server.MCPServer)function - 1.2 Add
RegisterOrgToolwrapper inoperation/operation.goand call it fromRegisterTool() - 1.3 Add
{"org", operation.RegisterOrgTool}entry incmd/cli.goregisterToolsWithDomains()domain list
2. Organization CRUD (operation/org/org.go)
- 2.1 Implement
create_orgtool — accepts name (required), full_name, description, website, location, visibility; callsforgejo.Client().CreateOrg() - 2.2 Implement
get_orgtool — accepts org (required); callsforgejo.Client().GetOrg() - 2.3 Implement
list_my_orgstool — accepts page, limit; callsforgejo.Client().ListMyOrgs() - 2.4 Implement
list_user_orgstool — accepts user (required), page, limit; callsforgejo.Client().ListUserOrgs() - 2.5 Implement
edit_orgtool — accepts org (required), full_name, description, website, location, visibility; callsforgejo.Client().EditOrg() - 2.6 Implement
delete_orgtool — accepts org (required); callsforgejo.Client().DeleteOrg(); description includes destructive warning
3. Membership (operation/org/membership.go)
- 3.1 Implement
list_org_memberstool — accepts org (required), page, limit; callsforgejo.Client().ListOrgMembership() - 3.2 Implement
check_org_membershiptool — accepts org (required), user (required); callsforgejo.Client().CheckOrgMembership() - 3.3 Implement
remove_org_membertool — accepts org (required), user (required); callsforgejo.Client().DeleteOrgMembership()
4. Teams (operation/org/teams.go)
- 4.1 Implement
list_org_teamstool — accepts org (required), page, limit; callsforgejo.Client().ListOrgTeams() - 4.2 Implement
create_org_teamtool — accepts org (required), name (required), description, permission, can_create_org_repo, includes_all_repositories; callsforgejo.Client().CreateTeam() - 4.3 Implement
add_team_membertool — accepts team_id (required), user (required); callsforgejo.Client().AddTeamMember() - 4.4 Implement
remove_team_membertool — accepts team_id (required), user (required); callsforgejo.Client().RemoveTeamMember() - 4.5 Implement
add_team_repotool — accepts team_id (required), org (required), repo (required); callsforgejo.Client().AddTeamRepository() - 4.6 Implement
remove_team_repotool — accepts team_id (required), org (required), repo (required); callsforgejo.Client().RemoveTeamRepository()
5. Testing
- 5.1 Add unit tests for org CRUD tools in
operation/org/org_test.go - 5.2 Add unit tests for membership tools in
operation/org/membership_test.go - 5.3 Add unit tests for team tools in
operation/org/teams_test.go
6. Verify
- 6.1 Run
make build— confirm binary compiles - 6.2 Run
forgejo-mcp --cli list— confirm all 15 org tools appear under theorgdomain - 6.3 Run
forgejo-mcp --cli create_org --help— confirm parameter schema is correct