MG

mushroomfleet/gitea-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

17 stars 9 forks 质量 72 趋势 21Apache-2.0

Gitea 的 MCP 服务器 — 从 AI 编码助理中管理重置、 发行、 牵引请求和组织

概览

一个生产准备的模型背景协议服务器,用于与自托管的Gitea平台进行无缝整合. 这个服务器在保存目录结构的同时,提供了创建寄存器和上传文件的工具. 本指南提供安装和配置Gitea MCP服务器的分步指令,包括排除常见问题. - : 在任何已配置的 Gitea 实例上创建新寄存器 - : 在保存目录结构的同时上传文件和文件夹 - : 自动同步整个工程进行初始承诺(仅新文件) - : 用于修改现有文件的智能更新解决冲突工具 - : 同步连接多个 Gitea 实例 - : 尊重 API 速率限制每个实例 - : 高效的文件上传,可配置批量大小 - : 结构化记录,安全输出 - : 用重试逻辑进行强力错误处理 - : 完全类型安全和现代 JavaScript 特性 - 节点18.0.

概述(AI 翻译)

一个生产准备的模型背景协议服务器,用于与自托管的Gitea平台进行无缝整合. 这个服务器在保存目录结构的同时,提供了创建寄存器和上传文件的工具.

□ 安装和设置指南

本指南提供安装和配置Gitea MCP服务器的分步指令,包括排除常见问题.

□ 特性

  • ** 仓库创建**:在任何已配置的吉他实例上创建新仓库
  • 文件上传:在保存目录结构的同时上传文件和文件夹
  • Project Sync:为初始任务自动同步整个项目(仅新文件)
  • ** 高级文件更新**: 用于修改现有文件的具有冲突解决功能的智能更新工具
  • ** 多功能支持**:同时连接多个吉他实例
  • ** 定期限制**:遵守每个案例的API费率限制
  • 批次处理:高效的文件上传,可配置批次大小
  • ** 综合伐木**:结构化伐木,安全产出
  • ** 不当处理**: 处理重试逻辑的强力错误
  • TypeScript:完全类型安全和现代JavaScript特性

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Gitea MCP Server

A production-ready Model Context Protocol (MCP) server for seamless integration with self-hosted Gitea platforms. This server provides tools for creating repositories and uploading files while preserving directory structure.

Installation and Setup Guide

This guide provides step-by-step instructions for installing and configuring the Gitea MCP server, including troubleshooting common issues.

Features

  • Repository Creation: Create new repositories on any configured Gitea instance
  • File Upload: Upload files and folders while preserving directory structure
  • Project Sync: Automatically sync entire projects for initial commits (new files only)
  • Advanced File Updates: Smart update tool with conflict resolution for modifying existing files
  • Multi-Instance Support: Connect to multiple Gitea instances simultaneously
  • Rate Limiting: Respect API rate limits per instance
  • Batch Processing: Efficient file upload with configurable batch sizes
  • Comprehensive Logging: Structured logging with security-safe output
  • Error Handling: Robust error handling with retry logic
  • TypeScript: Full type safety and modern JavaScript features

Quick Start

Prerequisites

  • Node.js 18.0.0 or higher
  • Access to one or more Gitea instances
  • Personal access tokens for authentication

Installation

  1. Clone the repository:
git clone 
cd gitea-mcp
  1. Install dependencies:
npm install
  1. Configure environment variables:
cp .env.example .env
# Edit .env with your Gitea instance details
  1. Build the project:
npm run build
  1. Start the server:
npm run start:mcp

Troubleshooting Common Issues

Windows Compatibility

If you’re running on Windows, you might encounter issues with the build script. The default build script uses the chmod command, which is not available on Windows. The package.json has been updated to use a Windows-compatible build script.

Logging Configuration

If you encounter issues with the logging configuration, make sure you have the pino-pretty package installed:

npm install --save-dev pino-pretty

Environment Variables

The .env file should contain the following configuration:

# Server Configuration
NODE_ENV=development
LOG_LEVEL=debug

# Gitea Configuration
# Replace with your Gitea instance URL and token
GITEA_INSTANCES=[{"id":"main","name":"Main Gitea Instance","baseUrl":"https://your-gitea-instance.com","token":"your-personal-access-token","timeout":30000,"rateLimit":{"requests":100,"windowMs":60000}}]

# Upload Configuration
MAX_FILE_SIZE=10485760
MAX_FILES=100
BATCH_SIZE=10

# Gitea API Configuration
GITEA_TIMEOUT=30000
GITEA_MAX_RETRIES=3
在 GitHub 查看完整 README

安装

docker run -d \
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "gitea-mcp": { "command": "node", "args": ["./build/index.js"], "cwd": "/path/to/gitea-mcp", "env": { "NODE_ENV": "production", "LOG_LEVEL": "info" } } } }