gitea-mcp

gitea-mcp

MCP server for managing Gitea repositories via the Gitea API, enabling operations on issues, comments, labels, milestones, and repository info.

Category
访问服务器

README

gitea-mcp

MCP server for managing Gitea repositories — issues, comments, labels, milestones, and more via the Gitea API.

Installation

make install
# or: npm ci

Build & Run

Purpose Command Equivalent
Full check + build make all npm run lint && npm run build
Type check only make lint npm run lint (tsc --noEmit)
Build to dist/ make build npm run build
Run directly (tsx) make dev npm run dev
Run compiled output npm run start
Clean dist/ make clean rm -rf dist

Order: make all (or make lint then make build).

Environment Variables

Runtime (required by server)

Variable Required Description
GITEA_BASE_URL Yes Gitea instance URL (e.g. https://gitea.example.com)
GITEA_TOKEN Yes Gitea API access token
GITEA_DEFAULT_OWNER No Default repository owner (avoid passing owner on every call)
GITEA_DEFAULT_REPO No Default repository name (avoid passing repo on every call)

Publishing (required by make publish)

Variable Required Description
GITHUB_PUBLISH_TOKEN GitHub PAT with write:packages scope
GITEA_PUBLISH_TOKEN Gitea Token with write:package scope
GITEA_PUBLISH_URL Gitea Full registry URL (e.g. https://gitea.example.com/api/packages/OWNER/npm/)
OWNER No Package scope namespace (auto-detected from git remote if not set)

MCP Tools

All tools accept owner and repo parameters optionally when GITEA_DEFAULT_OWNER / GITEA_DEFAULT_REPO are set.

Issues

Tool Description
list_issues List issues (filter by state, labels, pagination)
get_issue Get a single issue by index (issue number)
create_issue Create issue with title, body, assignee, labels, milestone
update_issue Update issue fields or state
delete_issue Delete an issue by index
search_issues Search across repos by query, type, state, labels

Comments

Tool Description
list_comments List comments on an issue
create_comment Add a comment to an issue
update_comment Update a comment by id
delete_comment Delete a comment by id

Labels

Tool Description
list_labels List repo labels
create_label Create a label (name, color, description)
update_label Update a label by id
delete_label Delete a label by id
add_issue_labels Add labels to an issue by name
remove_issue_label Remove a label from an issue by label id
replace_issue_labels Replace all labels on an issue
clear_issue_labels Remove all labels from an issue

Milestones

Tool Description
list_milestones List milestones (filter by state)
get_milestone Get a milestone by id
create_milestone Create milestone with title, description, due_on
update_milestone Update milestone fields or state
delete_milestone Delete a milestone by id

Repository

Tool Description
list_my_repos List repos the authenticated user can access
resolve_repo Auto-detect owner and repo from git remote URL in the current or specified directory

Usage with MCP Clients

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "gitea-mcp": {
      "command": "node",
      "args": ["/path/to/gitea-mcp/dist/cli.js"],
      "env": {
        "GITEA_BASE_URL": "https://gitea.example.com",
        "GITEA_TOKEN": "your-token-here",
        "GITEA_DEFAULT_OWNER": "myorg",
        "GITEA_DEFAULT_REPO": "myrepo"
      }
    }
  }
}

opencode

{
  "mcpServers": {
    "gitea-mcp": {
      "command": "node",
      "args": ["/path/to/gitea-mcp/dist/cli.js"],
      "env": {
        "GITEA_BASE_URL": "https://gitea.example.com",
        "GITEA_TOKEN": "your-token-here"
      }
    }
  }
}

Testing

Command Description
make test Unit tests
make test-watch Watch mode
make test-integration Integration tests (requires GITEA_BASE_URL and GITEA_TOKEN)

Packaging & Publishing

Run make package first to build and package, then make publish to publish.

Step 1: Build and package

make package
# Creates .dist/{platform}/sources/gitea-mcp-src-{version}.tgz
# Creates .dist/{platform}/releases/gitea-mcp-{version}.tgz

Platform is auto-detected from git remote URL. Override with OWNER env var.

Step 2: Publish

# GitHub Packages (default)
export GITHUB_PUBLISH_TOKEN=ghp_your_token
make publish

# Gitea Package Registry
export GITEA_PUBLISH_TOKEN=your_token
export GITEA_PUBLISH_URL=https://gitea.example.com/api/packages/OWNER/npm/
make publish

Install (consumers)

# GitHub Packages
npm set @OWNER:registry https://npm.pkg.github.com
npm install @OWNER/gitea-mcp

# Gitea Package Registry
npm set @OWNER:registry https://gitea.example.com/api/packages/OWNER/npm/
npm install @OWNER/gitea-mcp

Project Structure

src/
  cli.ts           # Entry point, reads env vars
  server.ts        # McpServer setup, tool registration
  tools.ts         # Zod input schemas for all tools
  gitea-client.ts  # REST client wrapping Gitea /api/v1 endpoints

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选