gitea-mcp

io.github.werebear73由 GitHub 帳號 werebear73 發布v0.5.1更新於 Oct 25, 2026

Model Context Protocol server for Gitea (and Forgejo, Codeberg).

已驗證STDIO僅桌面效率與工作流開發者工具

概覽

AI 產生的概覽

本機 MCP 伺服器,讓 AI 助理在 Gitea、Forgejo 或 Codeberg 實例上讀取、建立與管理議題、拉取請求、檔案與發行版本。

可以做什麼
建立、列出、讀取、更新議題並新增留言,列出標籤、里程碑與分支,用於分類整理與記錄。列出並檢視拉取請求,新增留言、建立與合併拉取請求。讀取儲存庫檔案、提交變更並建立分支。列出與建立發行版本。查詢伺服器資訊與版本。
適用情境
當團隊或專案在自架的 Gitea、Forgejo 或 Codeberg 上追蹤工作時適用,可讓助理不必離開對話就開立議題、分類整理、跨儲存庫留言或發行版本。
執行需求
以 Python 套件(pip 或 uvx)透過 stdio 在本機執行,也可自架為 streamable HTTP 服務。需要以環境變數提供 GITEA_URL(實例基礎網址)與 GITEA_TOKEN(個人存取權杖),並能連線至該實例。選用的 GITEA_TIMEOUT、GITEA_MAX_RETRIES 與 GITEA_RETRY_BASE_DELAY 可調整 HTTP 行為。
安裝前請注意
GITEA_TOKEN 是個人存取權杖,具備你授予的權限範圍(read:repository、write:issue、read:user,建立發行版本還需 write:repository),請勿放入共用設定。助理可執行寫入操作:建立與更新議題、留言、分支、提交、拉取請求、合併及發行版本。HTTP 模式下伺服器使用自身的 GITEA_TOKEN,任何能連上該網址的用戶端都以同一個使用者身分操作,需限制存取。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 gitea-mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

gitea-mcp

A Model Context Protocol server for Gitea — lets AI assistants (Claude, ChatGPT, Copilot, and anything else that speaks MCP) read, create, and manage issues, repositories, and releases on any Gitea instance you can reach.

Also works against Forgejo and Codeberg (API-compatible).

Why

Self-hosted Gitea is a popular GitHub alternative for solo developers, small teams, and privacy-conscious organizations. With this MCP server installed, your AI assistant can:

  • File audit findings or refactor notes as Gitea issues without you leaving the chat
  • Triage a repo's open issues in natural language
  • Cut a release at the end of a coding session
  • Comment on issues across multiple repos in one pass

Features

ResourceTools
Issuescreate_issue, list_issues, get_issue, update_issue, add_comment
Reposlist_repos, list_labels, list_milestones, list_branches
Pullslist_pull_requests, get_pull_request, add_comment_on_pr, create_pr, merge_pr
Filesread_file, commit_changes, create_branch
Releaseslist_releases, create_release
Metaget_server_info, get_server_version
  • Bearer authentication via Personal Access Token (PAT)
  • Async HTTP via httpx and FastMCP
  • Works with self-hosted Gitea, Forgejo, and Codeberg

Quick Start

1. Install

bash
pip install gitea-mcp

Or with uv:

bash
uv pip install gitea-mcp

2. Generate a Personal Access Token

In your Gitea instance, go to Settings → Applications → Generate New Token and grant at least:

  • read:repository
  • write:issue
  • read:user

Add write:repository if you also want to create releases.

3. Configure your MCP client

Claude Desktop (interactive): run

bash
gitea-mcp init

It prompts for the Gitea URL and Personal Access Token, verifies the connection, and writes (or merges into) the right claude_desktop_config.json for your OS. Restart Claude Desktop and you're done.

To check that the server can reach your Gitea instance at any time:

bash
gitea-mcp doctor

doctor reads GITEA_URL and GITEA_TOKEN from the environment, runs a GET /api/v1/user, and reports the authenticated username plus the state of the MCP tool surface. Exit 0 = ready; exit 1 = connection/load failure; exit 2 = missing config.

Any MCP client (manual): add gitea-mcp to the client's MCP config. The recommended form uses uvx so the client launches the latest published wheel in an isolated env without needing gitea-mcp on its own PATH (this is what gitea-mcp init writes):

json
{  "mcpServers": {    "gitea": {      "command": "uvx",      "args": ["gitea-mcp"],      "env": {        "GITEA_URL": "https://your-gitea-instance.example.com",        "GITEA_TOKEN": "your-personal-access-token"      }    }  }}

If you'd rather use a globally pip-installed gitea-mcp binary, drop args and set command to "gitea-mcp" directly — works as long as the binary is on the MCP client's PATH at launch time.

See mcp.json for a complete example. The same shape works for Claude Desktop, VS Code, Cowork, Claude Code, and any other MCP-compatible client.

Configuration

Configuration is read from environment variables.

VariableRequiredDefaultDescription
GITEA_URLYes—Base URL of your Gitea instance (e.g., https://gitea.example.com)
GITEA_TOKENYes—Personal Access Token from your Gitea user settings
GITEA_TIMEOUTNo30HTTP request timeout in seconds
GITEA_MAX_RETRIESNo3Max retries for transient failures on idempotent methods (GET/PUT/DELETE). Set to 0 to disable retries. POST and PATCH are never auto-retried — they could create duplicate issues, comments, or releases. 429 Too Many Requests is retried for any method, honoring Retry-After when present.
GITEA_RETRY_BASE_DELAYNo0.5Base delay (seconds) for exponential backoff between retries. Effective delay grows as base * 2^attempt with jitter, capped at 4 seconds.

Self-hosting / HTTP transport

By default gitea-mcp runs in stdio mode — each MCP client (Claude Desktop, Cowork, etc.) launches its own subprocess on demand. For self-hosting one instance that multiple clients connect to over the network, use the streamable-HTTP transport:

bash
gitea-mcp serve --transport http --host 0.0.0.0 --port 8000 --path /mcp

All four flags can also be provided via environment variables (handy for Docker / systemd units):

VariableDefaultFlag
GITEA_MCP_TRANSPORTstdio--transport
GITEA_MCP_HOST127.0.0.1--host
GITEA_MCP_PORT8000--port
GITEA_MCP_PATH/mcp--path

MCP clients connect to the resulting URL (e.g. https://gitea-mcp.example.com/mcp) just like they would to a local stdio server, except they share the one running instance.

Auth model (this release). The server reads GITEA_TOKEN from its own environment, so any client that reaches the URL acts as that one Gitea user. Run it for yourself behind your own access controls (firewall, reverse-proxy auth, VPN, Tailscale). Multi-tenant bring-your-own-token is on the roadmap.

The no-args invocation (gitea-mcp with no subcommand) still runs in stdio mode, so existing Claude Desktop / Cowork / Claude Code integrations are unaffected by this addition.

Compatibility

ServerStatus
Gitea (self-hosted)✅ Primary target
Forgejo✅ Expected to work (API-compatible)
Codeberg✅ Expected to work (Codeberg runs Forgejo)

Development

bash
git clone https://github.com/werebear73/gitea-mcp.gitcd gitea-mcppip install -e ".[dev]"pre-commit install                       # commit-stage hooks (ruff + mypy)pre-commit install --hook-type pre-push  # push-stage hooks (pytest + build check)pytest

The two-stage pre-commit policy keeps the commit loop snappy (lint + type only) while making git push block on the slow stuff that's actually caught CI/release bugs in the past — the full test suite and python -m build && twine check dist/*, which surfaces setuptools_scm version surprises before they reach a tag push.

Roadmap

See docs/ROADMAP.md for what's shipped, what's next, and what's out of scope.

Publishing

Versioning

Semantic versioning, derived from git tags via setuptools_scm. See VERSIONING.md for the release process.

Contributing

Issues and pull requests welcome. For substantial changes, please open an issue first to discuss the approach.

License

MIT — use it however you like, including commercial products.


Built by Waretech Services.

來源:README.md,提交 5adde5e

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分