An MCP (Model Context Protocol) server that provides tools for interacting with Codeberg/Forgejo via the Codeberg CLI.
Andreas T Jonsson efe517765e docs: Improve README with development, troubleshooting sections
- Add Development section with test instructions
- Add Troubleshooting section for common issues
- Add License section linking to zlib license
- Add default config path for OpenCode
- Fix license in pyproject.toml from MIT to zlib
- Update prerequisite link to Codeberg CLI repo
2025-12-29 14:39:19 +01:00
codeberg_mcp fix: Use head to bound input lines in interactive mode 2025-12-29 13:57:54 +01:00
tests fix: Use head to bound input lines in interactive mode 2025-12-29 13:57:54 +01:00
.gitignore Initial commit 2025-12-29 12:26:29 +01:00
LICENSE Initial commit 2025-12-29 12:26:29 +01:00
pyproject.toml docs: Improve README with development, troubleshooting sections 2025-12-29 14:39:19 +01:00
README.md docs: Improve README with development, troubleshooting sections 2025-12-29 14:39:19 +01:00

Codeberg MCP Server

An MCP (Model Context Protocol) server that provides tools for interacting with Codeberg/Forgejo via the Codeberg CLI.

Prerequisites

  • Python 3.10+
  • Codeberg CLI installed and authenticated
  • MCP-compatible client (e.g., Claude Desktop, OpenCode)

Installation

pip install -e .

Or install dependencies directly:

pip install mcp

Usage

Running the server

# As a module
python -m codeberg_mcp.server

# Or using the entry point (after pip install -e .)
codeberg-mcp

Configuring with Claude Desktop

Add to your Claude Desktop config (~/.config/claude/claude_desktop_config.json):

{
  "mcpServers": {
    "codeberg": {
      "command": "python",
      "args": ["-m", "codeberg_mcp.server"],
      "cwd": "/path/to/codeberg-mcp"
    }
  }
}

Configuring with OpenCode

Add to your OpenCode config (~/.config/opencode/config.json):

{
  "mcp": {
    "codeberg": {
      "command": "python",
      "args": ["-m", "codeberg_mcp.server"],
      "cwd": "/path/to/codeberg-mcp"
    }
  }
}

Available Tools

User

  • user_info - Get authenticated user information

Repository

  • repo_list - List user's repositories
  • repo_info - Get repository information
  • repo_clone - Clone a repository
  • repo_fork - Fork a repository

Issues

  • issue_list - List issues in current repository
  • issue_view - View issue details (interactive)
  • issue_create - Create a new issue
  • issue_comment - Add comment to an issue

Pull Requests

  • pull_list - List pull requests
  • pull_view - View pull request details (interactive)
  • pull_create - Create a pull request

Labels

  • label_list - List repository labels
  • label_create - Create a new label

Releases

  • release_list - List releases
  • release_create - Create a release

Milestones

  • milestone_list - List milestones

Notifications

  • notification_list - List notifications

Development

# Install with test dependencies
pip install -e ".[test]"

# Run tests
pytest

Troubleshooting

"berg CLI not found"

Install Codeberg CLI and ensure it's in your PATH.

Interactive commands return unexpected results

Commands like issue_view and pull_view use interactive selection. When run through MCP, they automatically select the first available item. To view a specific issue or PR, use issue_list or pull_list first to find the ID, then use other tools as needed.

Notes

  • Most commands operate on the current repository (determined by git remote in the working directory)
  • The repo_info tool can optionally take an owner/repo argument to query any repository

License

zlib