Add support for Gogs User Email addresses management to the MCP server.
Why This Feature?
Managing email addresses is important for user profile management, notifications, and multi-email support. Users often need to add alternate emails or change their primary email.
Requirements
Implement list_user_emails tool - List authenticated user's email addresses
Implement add_user_emails tool - Add new email address(es) to the user account
Implement delete_user_emails tool - Remove email address(es) from the user account
See Gogs API documentation for user emails endpoints.
## Description
Add support for Gogs User Email addresses management to the MCP server.
## Why This Feature?
Managing email addresses is important for user profile management, notifications, and multi-email support. Users often need to add alternate emails or change their primary email.
## Requirements
- Implement `list_user_emails` tool - List authenticated user's email addresses
- Implement `add_user_emails` tool - Add new email address(es) to the user account
- Implement `delete_user_emails` tool - Remove email address(es) from the user account
- Add proper TypeScript types for Email objects
- Support email verification status
- Support primary email identification
- Update documentation with usage examples
## API Endpoints to Implement
- `GET /user/emails` - List email addresses
- `POST /user/emails` - Add email addresses
- `DELETE /user/emails` - Delete email addresses
## Related
Requested by @fszontagh in #4
## API Reference
See Gogs API documentation for user emails endpoints.
@fszontagh I am starting work on this issue now! I will implement the three user email management tools (list_user_emails, add_user_emails, delete_user_emails) along with the necessary TypeScript types and update the documentation accordingly.
@fszontagh I am starting work on this issue now! I will implement the three user email management tools (list_user_emails, add_user_emails, delete_user_emails) along with the necessary TypeScript types and update the documentation accordingly.
All requirements from the issue description have been fulfilled. The implementation follows the existing code patterns and is ready for use.
## Implementation Complete ✅
I have successfully implemented user email management support for the Gogs MCP server. Here is what was done:
### Changes Made
**1. TypeScript Types (src/types.ts)**
- Added `GogsEmail` interface with fields: `email`, `verified`, and `primary`
**2. Gogs Client Methods (src/gogs-client.ts)**
- `listUserEmails()`: GET /user/emails - Returns array of GogsEmail objects
- `addUserEmails(emails: string[])`: POST /user/emails - Adds new emails and returns updated list
- `deleteUserEmails(emails: string[])`: DELETE /user/emails - Removes specified emails
**3. MCP Tools (src/server.ts)**
- `list_user_emails`: List all email addresses for authenticated user
- `add_user_emails`: Add email address(es) with validation
- `delete_user_emails`: Delete email address(es) with confirmation
**4. Documentation**
- Updated README.md with tool descriptions and parameters
- Updated CLAUDE.md MCP Tool Categories section
- All tools documented with usage examples
### API Endpoints Implemented
- `GET /user/emails` - List email addresses
- `POST /user/emails` - Add email addresses
- `DELETE /user/emails` - Delete email addresses
### Testing
- Code builds successfully with TypeScript compiler
- All files generated in dist/ directory
- No compilation errors
### Commit
- Changes committed and pushed to main branch
- Commit SHA: 63dcd53
- Commit message references issue #13
All requirements from the issue description have been fulfilled. The implementation follows the existing code patterns and is ready for use.
Description
Add support for Gogs User Email addresses management to the MCP server.
Why This Feature?
Managing email addresses is important for user profile management, notifications, and multi-email support. Users often need to add alternate emails or change their primary email.
Requirements
list_user_emailstool - List authenticated user's email addressesadd_user_emailstool - Add new email address(es) to the user accountdelete_user_emailstool - Remove email address(es) from the user accountAPI Endpoints to Implement
GET /user/emails- List email addressesPOST /user/emails- Add email addressesDELETE /user/emails- Delete email addressesRelated
Requested by @fszontagh in #4
API Reference
See Gogs API documentation for user emails endpoints.
@fszontagh I am starting work on this issue now! I will implement the three user email management tools (list_user_emails, add_user_emails, delete_user_emails) along with the necessary TypeScript types and update the documentation accordingly.
Implementation Complete ✅
I have successfully implemented user email management support for the Gogs MCP server. Here is what was done:
Changes Made
1. TypeScript Types (src/types.ts)
GogsEmailinterface with fields:email,verified, andprimary2. Gogs Client Methods (src/gogs-client.ts)
listUserEmails(): GET /user/emails - Returns array of GogsEmail objectsaddUserEmails(emails: string[]): POST /user/emails - Adds new emails and returns updated listdeleteUserEmails(emails: string[]): DELETE /user/emails - Removes specified emails3. MCP Tools (src/server.ts)
list_user_emails: List all email addresses for authenticated useradd_user_emails: Add email address(es) with validationdelete_user_emails: Delete email address(es) with confirmation4. Documentation
API Endpoints Implemented
GET /user/emails- List email addressesPOST /user/emails- Add email addressesDELETE /user/emails- Delete email addressesTesting
Commit
63dcd53All requirements from the issue description have been fulfilled. The implementation follows the existing code patterns and is ready for use.