Gitee

by normal-coder
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Enables AI to interact with Gitee repositories, including creating/managing repositories, branches, files, issues, and pull requests. Supports operations like pushing code, creating issues, managing PRs, and performing user-related actions on Gitee's platform.

Gitee MCP サーバー

MCP を通じて AI が Gitee リポジトリ/Issues/Pull Request を操作します


サポートされているAI操作

カテゴリMCPツール説明
リポジトリ操作create_repositoryGiteeリポジトリを作成する
fork_repositoryGiteeリポジトリをフォークする
支店運営create_branchGiteeリポジトリに新しいブランチを作成する
list_branchesGiteeリポジトリ内のブランチを一覧表示する
get_branchGiteeリポジトリ内の特定のブランチの詳細を取得する
ファイル操作get_file_contentsGiteeリポジトリ内のファイルまたはディレクトリの内容を取得する
create_or_update_fileGiteeリポジトリでファイルを作成または更新する
push_files複数のファイルをGiteeリポジトリにプッシュする
発行業務create_issueGiteeリポジトリに問題を作成する
list_issuesGiteeリポジトリの問題を一覧表示する
get_issueGiteeリポジトリ内の特定の問題の詳細を取得する
update_issueGiteeリポジトリの問題を更新する
add_issue_commentGiteeリポジトリの問題にコメントを追加する
プルリクエスト操作create_pull_requestGiteeリポジトリにプルリクエストを作成する
list_pull_requestsGiteeリポジトリ内のプルリクエストを一覧表示する
get_pull_requestGiteeリポジトリ内の特定のプルリクエストの詳細を取得する
update_pull_requestGiteeリポジトリのプルリクエストを更新する
merge_pull_requestGiteeリポジトリにプルリクエストをマージする
ユーザー操作get_userGiteeユーザー情報を取得する
get_current_user認証されたGiteeユーザー情報を取得する

使用法

Smithery経由でインストール

Smithery経由で Claude Desktop 用の Gitee MCP Server を自動的にインストールするには:

npx -y @smithery/cli install @normal-coder/gitee-mcp-server --client claude

構成

  • GITEE_API_BASE_URL : オプション、Gitee OpenAPI エンドポイント、デフォルトはhttps://gitee.com/api/v5
  • GITEE_PERSONAL_ACCESS_TOKEN : 必須、Giteeアカウントの個人アクセストークン(PAT)。Giteeアカウント設定の個人アクセストークンから取得できます。
  • DEBUG : オプション。デバッグログを有効にするにはtrueに設定し、デフォルトでは無効になっています。

NPX経由でMCPサーバーを実行する

{ "mcpServers": { "Gitee": { "command": "npx", "args": [ "-y", "gitee-mcp-server" ], "env": { "GITEE_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>" } } } }

Dockerコンテナ経由でMCPサーバーを実行する

  1. Dockerイメージを取得する
# Get from DockerHub docker pull normalcoder/gitee-mcp-server # Build locally docker build -t normalcoder/gitee-mcp-server .
  1. MCPサーバーを構成する
{ "mcpServers": { "Gitee": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITEE_PERSONAL_ACCESS_TOKEN", "normalcoder/gitee-mcp-server" ], "env": { "GITEE_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>" } } } }

開発ガイド

依存関係をインストールする

npm install

建てる

npm run build

ビルドが成功すると、 /distには実行可能な MCP サーバーが含まれます。

サーバーを実行

npm start

MCP サーバーは stdio 上で実行されるため、MCP クライアントによってサブプロセスとして使用できるようになります。

Dockerイメージのビルド

Docker を使用してサーバーを実行することもできます。

docker build -t normalcoder/gitee-mcp-server .

Docker で MCP サーバーを実行します。

docker run -e GITEE_PERSONAL_ACCESS_TOKEN=<YOUR_TOKEN> normalcoder/gitee-mcp-server

MCPサーバーのデバッグ

デバッグには@modelcontextprotocol/inspectorを使用できます。

環境変数のルート ディレクトリに.envファイルを作成します。

GITEE_API_BASE_URL=https://gitee.com/api/v5 GITEE_PERSONAL_ACCESS_TOKEN=<YOUR_TOKEN>

デバッグ ツールを実行して、サービスと Web デバッグ インターフェースを開始します。

npx @modelcontextprotocol/inspector npm run start --env-file=.env

このプロジェクトには、デバッグ情報を印刷するためのdebug()関数が含まれています。使用方法は次のとおりです。

import { debug } from './common/utils.js'; debug('Message to log'); debug('Message with data:', { key: 'value' });

デバッグ ログは、 DEBUG環境変数がtrueに設定されている場合にのみ出力されます。

依存関係

  • @modelcontextprotocol/sdk : サーバー実装用の MCP SDK
  • universal-user-agent : ユーザーエージェント文字列を生成する
  • zod : スキーマ検証用
  • zod-to-json-schema : ZodスキーマをJSONスキーマに変換します

ライセンス

MITライセンスに基づきライセンスされています。MITライセンスの条件に従い、本ソフトウェアを自由に使用、改変、配布することができます。詳細については、プロジェクトリポジトリのLICENSEファイルをご覧ください。

関連リンク

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Gitee 用の MCP ツール サーバー。リポジトリ ファイル/ブランチ、問題、プル リクエストの管理をサポートします。

  1. Supported AI Operations
    1. Usage
      1. Installing via Smithery
      2. Configuration
      3. Run MCP Server via NPX
      4. Run MCP Server via Docker Container
    2. Development Guide
      1. Install Dependencies
      2. Build
      3. Run Server
      4. Build Docker Image
      5. Debug MCP Server
    3. Dependencies
      1. License
        1. Related Links
          ID: cck9xigm1d