Gitea MCP服务器
用于与Gitea交互的模型上下文协议(MCP)服务器。 此软件包旨在用作独立服务器或由网关导入。
🛠 能力
- 问题: 列出、搜索、创建、更新、评论。
- 存储库: 列出仓库、分支、标签。
- 文件夹: 读取文件内容。
- 拉取请求: 创建PR。
- 分析: 使用AI提示分析问题。
- 外壳: 在WSL中执行安全的git命令(
run_safe_shell).
🔒 安全
- 允许的路径: 限制通过
MCP_ALLOWED_PATHS环境变量。 - Git安全: 只允许使用列入白名单的git子命令。全球旗帜被封锁。
📦 安装
npm install @boringstudio_org/gitea-mcp🚀 用法
通过NPX(推荐)
# Configure environment variables
export GITEA_TOKEN=your_token
# Optional: Defaults to https://git.your-instance.com/api/v1
export GITEA_API_URL=https://git.your-instance.com/api/v1
# Cloudflare Access (Optional)
# If your Gitea instance is behind Cloudflare Zero Trust
export CF_ID=your_cf_client_id
export CF_SECRET=your_cf_client_secret
# Run
npx @boringstudio_org/gitea-mcp独立(来源)
# Install dependencies
npm install
# Configure .env
echo "GITEA_TOKEN=..." > .env
echo "GITEA_API_URL=..." >> .env
# Optional: Cloudflare Access
echo "CF_ID=..." >> .env
echo "CF_SECRET=..." >> .env
# Run
node index.js作为图书馆
import { runGiteaServer } from "@boringstudio_org/gitea-mcp";
// Ensure environment variables are set
runGiteaServer().catch(console.error);📝 许可证
麻省理工学院
