feat: add wiki management tools (#95)

Fix #94

## Summary
This PR adds wiki management support to gitea-mcp adding new tools: creating, reading, updating, and deleting wiki pages.

## Changes
- Added `operation/wiki/wiki.go` with wiki tools
- Updated `operation/operation.go` to register it
- Updated `README.md`

## New Tools
- `list_wiki_pages` - List all wiki pages in a repository
- `get_wiki_page` - Get wiki page content and metadata
- `get_wiki_revisions` - Get revision history of a wiki page
- `create_wiki_page` - Create a new wiki page
- `update_wiki_page` - Update an existing wiki page
- `delete_wiki_page` - Delete a wiki page

## Implementation Details
- Uses direct HTTP calls to Gitea wiki API endpoints (v1.16.0+)
- Follows existing MCP patterns and error handling
- Includes fallback logic to prevent "unnamed" pages during updates
- Proper base64 content encoding as per Gitea API spec

## Testing
- All 6 tools tested and working correctly
- Error handling validated
- Integration with existing MCP server confirmed
- Made a test repo & simulated a drone construction using Claude Code (in french sorry) at https://git.kernelpanik.fr/Test-Organization/test_wiki_tools/wiki

Ready for review.
Closes #[94]

Co-authored-by: nox <nox@noxen.net>
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/95
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Bo-Yi Wu (吳柏毅) <appleboy.tw@gmail.com>
Co-authored-by: Thierry PROST <3kynox@noreply.gitea.com>
Co-committed-by: Thierry PROST <3kynox@noreply.gitea.com>
This commit is contained in:
Thierry PROST
2025-09-27 07:29:10 +00:00
committed by Bo-Yi Wu (吳柏毅)
parent de311344cd
commit 95ab3a4b73
3 changed files with 373 additions and 0 deletions

View File

@@ -218,6 +218,12 @@ The Gitea MCP Server supports the following tools:
| search_org_teams | Organization | Search for teams in an organization |
| search_repos | Repository | Search for repositories |
| get_gitea_mcp_server_version | Server | Get the version of the Gitea MCP Server |
| list_wiki_pages | Wiki | List all wiki pages in a repository |
| get_wiki_page | Wiki | Get a wiki page content and metadata |
| get_wiki_revisions | Wiki | Get revisions history of a wiki page |
| create_wiki_page | Wiki | Create a new wiki page |
| update_wiki_page | Wiki | Update an existing wiki page |
| delete_wiki_page | Wiki | Delete a wiki page |
## 🐛 Debugging