MCP server for Forgejo API operations over stdio
- Go 100%
|
All checks were successful
ci/woodpecker/push/lint-test-release Pipeline was successful
- forgejo.go: custom HTTP client with 30s timeout (was DefaultClient) - forgejo.go: ctx propagation via NewRequestWithContext - forgejo.go: retry up to 3x with exponential backoff on 5xx/transport err - forgejo.go: parseRepoList helper normalizes array + search response formats - forgejo.go: log body close errors via slog instead of silent discard - forgejo.go: requireString helper for safe type assertions - tools.go: all handlers use requireString for required args (no more panic) - tools.go: CreateRepo tries org POST first, fallback to user repos (saves 1 API call) - tools.go: GetRepoAll uses parseRepoList for unified response parsing |
||
|---|---|---|
| .woodpecker | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| .markdownlint-cli2.jsonc | ||
| forgejo.go | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| readme.md | ||
| renovate.json | ||
| tools.go | ||
mcp-forgejo
MCP server for Forgejo API operations over stdio.
Environment Variables
| Variable | Description |
|---|---|
FORGEJO_URL |
Forgejo instance URL (default: https://git.simoncor.net) |
FORGEJO_TOKEN |
Forgejo API token (required) |
Tools
| Tool | Description |
|---|---|
create_repo |
Create a new repo with sensible defaults (squash-only, issues+PRs+releases) |
get_repo_all |
List all accessible repositories, optionally filtered by owner |
get_repo_settings |
Get full repo configuration |
set_repo_settings |
Update repo settings via JSON |
delete_repo |
Delete a repository (irreversible) |
set_repo_avatar |
Set repo avatar from a local image file |
delete_repo_avatar |
Delete a repo avatar |
Build
go build -o mcp-forgejo .
Usage
Add to your MCP client config:
{
"mcpServers": {
"mcp-forgejo": {
"command": "/path/to/mcp-forgejo",
"env": {
"FORGEJO_URL": "https://git.simoncor.net",
"FORGEJO_TOKEN": "your-token-here"
}
}
}
}
The server communicates over stdio using the MCP protocol.