1
0
Fork
You've already forked forgejo-mcp
0
forked from goern/forgejo-mcp
This Model Context Protocol (MCP) server provides tools and resources for interacting with the Forgejo (specifically Codeberg.org) REST API.
  • Go 95.3%
  • Shell 3.6%
  • Makefile 0.7%
  • Dockerfile 0.4%
2026年02月11日 22:49:18 +00:00
.beads chore: 🚀 add OpenSpec workflow, beads issue tracker, and merge PR proposal 2026年01月30日 08:25:11 +01:00
.claude chore: 🚀 add OpenSpec workflow, beads issue tracker, and merge PR proposal 2026年01月30日 08:25:11 +01:00
.devcontainer add devcontainer 2025年03月18日 07:03:59 +00:00
.forgejo/workflows fix: 🐛 release workflow checkout URL and skip-ci suppression 2026年02月06日 09:46:58 +01:00
.husky/_ chore: 🚀 add OpenSpec workflow, beads issue tracker, and merge PR proposal 2026年01月30日 08:25:11 +01:00
.social-media feat: add a project logo 2025年04月24日 08:18:33 +02:00
cmd feat: add --cli mode for direct tool invocation 2026年02月06日 10:24:55 +01:00
docs/plans fix: add build tag to wiki package for Nix build compatibility 2025年12月30日 12:04:37 +01:00
openspec chore: 📦 archive add-global-cli-mode change, sync cli-mode spec 2026年02月06日 10:48:09 +01:00
operation fix: 🐛 base64-encode content in create_file and update_file ( #72 ) 2026年02月11日 23:45:14 +01:00
pkg fix: 🐛 base64-encode content in create_file and update_file ( #72 ) 2026年02月11日 23:45:14 +01:00
.containerignore feat: add smithery.ai integration 2025年04月24日 08:19:37 +02:00
.env.sample feat: add stdio and sse MCP server 2025年04月24日 08:12:16 +02:00
.gitattributes chore: 🚀 add OpenSpec workflow, beads issue tracker, and merge PR proposal 2026年01月30日 08:25:11 +01:00
.gitignore chore: 🚀 more claude config 2026年01月30日 08:17:36 +01:00
.goreleaser.yml feat: add macOS (darwin) release assets 2026年02月10日 21:18:54 +01:00
.mcp.json chore: 🚀 more claude config 2026年01月30日 08:17:36 +01:00
.releaserc fix: 🐛 release workflow checkout URL and skip-ci suppression 2026年02月06日 09:46:58 +01:00
.renovaterc build: update renovate and semantic-release config 2025年04月24日 08:50:58 +02:00
AGENTS.md chore: 🚀 add OpenSpec workflow, beads issue tracker, and merge PR proposal 2026年01月30日 08:25:11 +01:00
CHANGELOG.md chore(release): 2.10.1 2026年02月11日 22:49:18 +00:00
CLAUDE.md docs: add projects support plan and AI agent configuration 2025年12月14日 16:01:26 +01:00
codemcp.toml first commit 2025年04月02日 00:27:24 -04:00
config.json feat: implement comprehensive MCP server logging improvements 2025年09月18日 15:25:50 +00:00
Containerfile chore(deps): update golang docker tag to v1.26 2026年02月11日 00:10:05 +00:00
DEVELOPER.md docs: restructure documentation for users and developers 2025年12月29日 15:58:15 +01:00
go.mod fix: 🔧 remove no-op replace directive from go.mod 2026年02月06日 19:19:15 +01:00
go.sum fix: 🔧 remove no-op replace directive from go.mod 2026年02月06日 19:19:15 +01:00
LICENSE feat: add stdio and sse MCP server 2025年04月24日 08:12:16 +02:00
main.go fix: 🐛 show module version when installed via go install 2026年01月30日 09:42:33 +01:00
Makefile 🔧 chore: add container build target to Makefile 2026年02月06日 09:10:34 +01:00
mcp-settings-sample.json feat: add stdio and sse MCP server 2025年04月24日 08:12:16 +02:00
README.md docs: add Arch Linux AUR installation options 2026年02月06日 23:51:23 +01:00
smithery.yaml feat: add smithery.ai integration 2025年04月24日 08:19:37 +02:00

Forgejo MCP Server

Connect your AI assistant to Forgejo repositories. Manage issues, pull requests, files, and more through natural language.

What It Does

Forgejo MCP Server is an integration plugin that connects Forgejo with Model Context Protocol (MCP) systems. Once configured, you can interact with your Forgejo repositories through any MCP-compatible AI assistant like Claude, Cursor, or VS Code extensions.

Example commands you can use:

  • "List all my repositories"
  • "Create an issue titled 'Bug in login page'"
  • "Show me open pull requests in my-org/my-repo"
  • "Get the contents of README.md from the main branch"

Quick Start

1. Install

Option A: Using Go (Recommended)

go install codeberg.org/goern/forgejo-mcp/v2@latest

Ensure $GOPATH/bin (typically ~/go/bin) is in your PATH.

Option B: Download Binary

Download the latest release from the releases page.

For Arch Linux, use your favorite AUR helper:

yay -S forgejo-mcp # builds from source
yay -S forgejo-mcp-bin # uses pre-built binary

2. Get Your Access Token

  1. Log into your Forgejo instance
  2. Go to SettingsApplicationsAccess Tokens
  3. Create a new token with the permissions you need (repo, issue, etc.)

3. Configure Your AI Assistant

Add this to your MCP configuration file:

For stdio mode (most common):

{
 "mcpServers": {
 "forgejo": {
 "command": "forgejo-mcp",
 "args": [
 "--transport", "stdio",
 "--url", "https://your-forgejo-instance.org"
 ],
 "env": {
 "FORGEJO_ACCESS_TOKEN": "<your personal access token>"
 }
 }
 }
}

For SSE mode (HTTP-based):

{
 "mcpServers": {
 "forgejo": {
 "url": "http://localhost:8080/sse"
 }
 }
}

When using SSE mode, start the server first:

forgejo-mcp --transport sse --url https://your-forgejo-instance.org --token <your-token>

4. Start Using It

Open your MCP-compatible AI assistant and try:

List all my repositories

Available Tools

Tool Description
User
get_my_user_info Get information about the authenticated user
search_users Search for users
Repositories
list_my_repos List all repositories you own
create_repo Create a new repository
fork_repo Fork a repository
search_repos Search for repositories
Branches
list_branches List all branches in a repository
create_branch Create a new branch
delete_branch Delete a branch
Files
get_file_content Get the content of a file
create_file Create a new file
update_file Update an existing file
delete_file Delete a file
Commits
list_repo_commits List commits in a repository
Issues
list_repo_issues List issues in a repository
get_issue_by_index Get a specific issue
create_issue Create a new issue
add_issue_labels Add labels to an issue
update_issue Update an existing issue
issue_state_change Open or close an issue
Comments
list_issue_comments List comments on an issue or PR
get_issue_comment Get a specific comment
create_issue_comment Add a comment to an issue or PR
edit_issue_comment Edit a comment
delete_issue_comment Delete a comment
Pull Requests
list_repo_pull_requests List pull requests in a repository
get_pull_request_by_index Get a specific pull request
create_pull_request Create a new pull request
update_pull_request Update an existing pull request
list_pull_reviews List reviews for a pull request
get_pull_review Get a specific pull request review
list_pull_review_comments List comments on a pull request review
Organizations
search_org_teams Search for teams in an organization
Server
get_forgejo_mcp_server_version Get the MCP server version

CLI Mode

You can invoke any tool directly from the command line without running an MCP server. This is useful for shell scripts, CI/CD pipelines, and Claude Code skills.

# List all available tools (grouped by domain)
forgejo-mcp --cli list
# Invoke a tool with JSON arguments
forgejo-mcp --cli get_issue_by_index --args '{"owner":"goern","repo":"forgejo-mcp","index":1}'
# Pipe JSON arguments via stdin
echo '{"owner":"goern","repo":"forgejo-mcp"}' | forgejo-mcp --cli list_repo_issues
# Show a tool's parameters
forgejo-mcp --cli create_issue --help
# Control output format (json or text)
forgejo-mcp --cli list --output=json
forgejo-mcp --cli get_my_user_info --args '{}' --output=text

CLI mode requires the same FORGEJO_URL and FORGEJO_ACCESS_TOKEN configuration as MCP server mode. Tool results are written as JSON to stdout by default; errors go to stderr with a non-zero exit code.

Configuration Options

You can configure the server using command-line arguments or environment variables:

CLI Argument Environment Variable Description
--url FORGEJO_URL Your Forgejo instance URL
--token FORGEJO_ACCESS_TOKEN Your personal access token
--debug FORGEJO_DEBUG Enable debug mode
--transport - Transport mode: stdio or sse
--sse-port - Port for SSE mode (default: 8080)
--cli - Enter CLI mode for direct tool invocation

Command-line arguments take priority over environment variables.

Troubleshooting

Enable debug mode to see detailed logs:

forgejo-mcp --transport sse --url <url> --token <token> --debug

Or set the environment variable:

export FORGEJO_DEBUG=true

Getting Help

For Developers

See DEVELOPER.md for build instructions, architecture overview, and contribution guidelines.

License

This project is open source. See the repository for license details.