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.
npx -y @oschina/mcp-giteeOverview
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:
# binary will be in ./bin/mcp-gitee
Install via go:
Run the server (example using env variables):
GITEE_ACCESS_TOKEN=<your-token> \
GITEE_API_BASE=https://gitee.com/api/v5 \
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>" \
Example MCP host configuration (connect an MCP client to this server):
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 name | Category | Description |
|---|---|---|
| list_user_repos | Repository | List repositories the token can access |
| get_file_content | Repository | Retrieve file contents from a repo |
| create_user_repo | Repository | Create a repository under a user account |
| create_org_repo | Repository | Create a repository under an organization |
| fork_repository | Repository | Fork an existing repository |
| list_releases | Repository | List releases for a repository |
| create_issue | Issue | Open a new issue |
| list_issues | Issue | List issues in a repo |
| comment_issue | Issue | Add a comment to an issue |
| close_issue | Issue | Close an issue |
| create_pull_request | Pull Request | Create a pull request from a branch |
| merge_pull_request | Pull Request | Merge a pull request |
| list_notifications | Notification | List account notifications |
Use Cases
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.
Automated release creation
- On tag detection, the agent builds artifacts, creates a release entry (create_release), and posts release notes back to the repo.
Repository scaffolding
- Create new repos for projects or orgs programmatically (create_user_repo/create_org_repo), push templates, configure branch protections via API calls.
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"
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).