GI

Gitee MCP Server for Repos, Issues, Pull Requests

Manage Gitee repos, issues, and pull requests with the MCP server, enabling AI assistants to interact with Gitee's API for automated repo workflows.

Quick Install
npx -y @oschina/mcp-gitee

Overview

Gitee MCP Server implements the Model Context Protocol (MCP) for Gitee, providing an adapter that exposes Gitee repository, issue, pull request and notification operations as MCP tools. By running this server, AI assistants and other MCP-hosted workflows can call Gitee API operations in a standardized, tool-like interface — enabling automated code changes, issue triage, PR creation, and more.

This is useful when integrating code-aware agents into developer workflows: instead of hardcoding Gitee API calls into each assistant, the MCP server exposes a curated toolset and configuration options (API base, token, transport) so you can connect a variety of MCP hosts (Cursor, Claude, local runners, etc.) to your Gitee account and automate repository tasks securely and reproducibly.

Features

  • Access and manage Gitee repositories, issues, pull requests and notifications
  • Configurable API base URL (support official gitee.com and self-hosted instances)
  • Command-line and environment variable configuration
  • Multiple transport modes: stdio, SSE, HTTP
  • Toolset enable/disable controls (whitelist and blacklist modes)
  • Supports user, organization and enterprise repository operations
  • Easily invoked via an executable, npx package, or built from source

Installation / Configuration

Prerequisites:

  • Go 1.23+ (if building from source)
  • A Gitee personal access token with appropriate scopes (generate at Gitee profile → Personal access tokens)

Build from source:

git clone https://gitee.com/oschina/mcp-gitee.git
cd mcp-gitee
make build
# binary will be in ./bin/mcp-gitee

Install via go:

go install gitee.com/oschina/mcp-gitee@latest

Run the server (example using env variables):

GITEE_ACCESS_TOKEN=<your-token> \
GITEE_API_BASE=https://gitee.com/api/v5 \
mcp-gitee --transport=stdio

Or run via npx (no local install required):

# Example npx invocation that exposes the server to MCP hosts
GITEE_API_BASE="https://gitee.com/api/v5" \
GITEE_ACCESS_TOKEN="<your-token>" \
npx -y @gitee/mcp-gitee@latest

Example MCP host configuration (connect an MCP client to this server):

{
  "mcpServers": {
    "gitee": {
      "url": "https://api.gitee.com/mcp",
      "headers": {
        "Authorization": "Bearer <your personal access token>"
      }
    }
  }
}

Command-line options (selected):

  • –token: Gitee access token
  • –api-base: Gitee API base URL (default: https://gitee.com/api/v5)
  • –transport: Transport type (stdio, sse, http). Default: stdio
  • –address: Host:port for HTTP/SSE transport (default: localhost:8000)
  • –enabled-toolsets / –disabled-toolsets: Comma-separated tool lists

Environment variables:

  • GITEE_ACCESS_TOKEN — access token
  • GITEE_API_BASE — API base URL
  • ENABLED_TOOLSETS — comma-separated whitelist
  • DISABLED_TOOLSETS — comma-separated blacklist

Toolset management:

  • Whitelist mode: set ENABLED_TOOLSETS (or –enabled-toolsets). Only listed tools will be active.
  • Blacklist mode: set DISABLED_TOOLSETS (or –disabled-toolsets). Listed tools will be disabled, others enabled.
  • If both are provided, enabled-toolsets takes precedence. Tool names are case-sensitive.

Security note:

  • Treat GITEE_ACCESS_TOKEN as a secret. Prefer environment variables or secure vaults for production. Limit token scopes to the least privilege necessary.

Available Tools

Below are common MCP tools exposed by the server. For the complete and up-to-date list, see the repository.

Tool nameCategoryDescription
list_user_reposRepositoryList repositories the token can access
get_file_contentRepositoryRetrieve file contents from a repo
create_user_repoRepositoryCreate a repository under a user account
create_org_repoRepositoryCreate a repository under an organization
fork_repositoryRepositoryFork an existing repository
list_releasesRepositoryList releases for a repository
create_issueIssueOpen a new issue
list_issuesIssueList issues in a repo
comment_issueIssueAdd a comment to an issue
close_issueIssueClose an issue
create_pull_requestPull RequestCreate a pull request from a branch
merge_pull_requestPull RequestMerge a pull request
list_notificationsNotificationList account notifications

Use Cases

  1. Triage an issue and create a PR

    • Agent lists issues (list_issues), reads issue details, creates a workspace branch, commits fixes (get_file_content / update), then creates a PR (create_pull_request). After review automation, the agent can comment and close the issue.
  2. Automated release creation

    • On tag detection, the agent builds artifacts, creates a release entry (create_release), and posts release notes back to the repo.
  3. Repository scaffolding

    • Create new repos for projects or orgs programmatically (create_user_repo/create_org_repo), push templates, configure branch protections via API calls.
  4. Bot-powered code updates and notifications

    • Regular dependency updates: an agent forks or branches (fork_repository), applies changes, opens PRs, and notifies maintainers via issue comments or notifications.

Example sequence (start server and allow an MCP host to call):

# start server for local MCP host using stdio transport
GITEE_ACCESS_TOKEN="xxxx" GITEE_API_BASE="https://gitee.com/api/v5" mcp-gitee --transport=stdio

Then configure your MCP client to use the server (see MCP host config examples above) and call the available tools from your assistant.

Where to find it

Source code, full tool list and licensing information are available in the repository: https://github.com/oschina/mcp-gitee

License: MIT (see LICENSE file in the repo).