gitee-mcp-adapter
Facilitates interaction with the Gitee platform's programming interface (API) for comprehensive management of code repositories, tracking issues, and handling proposed code modifications (pull requests). Enables automated software development cycles through streamlined issue creation and PR submission.
Author

oschina
Quick Info
Actions
Tags
Gitee Model Context Protocol Server Implementation
This document details the Gitee MCP Server, a specific instantiation of the Model Context Protocol (MCP) designed to interface with Gitee's remote services. It furnishes a comprehensive suite of utilities enabling AI entities to manipulate repositories, manage reported problems (issues), and process feature contributions (pull requests) residing on Gitee.
Core Capabilities
- Operational control over Gitee code storage units (repositories), tracked problems (issues), proposed changes (pull requests), and system alerts (notifications).
- Adaptable configuration for the API endpoint base Uniform Resource Locator (URL), accommodating self-hosted or enterprise Gitee instances.
- Configuration via command-line arguments for simplified setup.
- Support for operations spanning personal accounts, collaborative organizations, and private enterprise environments.
- Capability for dynamic activation or deactivation of tool subsets.
Exemplary Workflow: Issue Resolution via Automated Code Submission
1. Retrieve the specified Issue associated with the repository. 2. Execute necessary code modifications and subsequently generate a Pull Request referencing the original Issue's specifications. 3. Post contextual feedback (comment) on the Issue and mark it as resolved (Close Issue).Deployment Prerequisites and Sourcing
(This installation sequence can be bypassed when invoking via npx)
Necessary Components
- The Go programming language runtime, version 1.23.0 or superior.
- A valid Gitee credential profile offering an access token. Token Generation Portal
Compilation from Source Code
-
Obtain the source repository: bash git clone https://gitee.com/oschina/mcp-gitee.git cd mcp-gitee
-
Execute the build process: bash make build
Ensure the resulting executable, ./bin/mcp-gitee, is placed within your system's PATH environment variable.
Installation via Go Modules
bash go install gitee.com/oschina/mcp-gitee@latest
Invocation Guidelines
To ascertain the currently installed build designation:
bash mcp-gitee --version
MCP Host Configuration
Reference for detailed application configuration examples: Configuration Documentation - Connecting directly to the official public mcp-gitee host (no local installation needed):
{
"mcpServers": {
"gitee": {
"url": "https://api.gitee.com/mcp",
"headers": {
"Authorization": "Bearer
- Invocation via Node Package Execute (
npx):
{
"mcpServers": {
"gitee": {
"command": "npx",
"args": [
"-y",
"@gitee/mcp-gitee@latest"
],
"env": {
"GITEE_API_BASE": "https://gitee.com/api/v5",
"GITEE_ACCESS_TOKEN": "
- Invocation via Compiled Executable:
{
"mcpServers": {
"gitee": {
"command": "mcp-gitee",
"env": {
"GITEE_API_BASE": "https://gitee.com/api/v5",
"GITEE_ACCESS_TOKEN": "
Command-Line Parameters
--token: The requisite Gitee authentication token.--api-base: The root URI for the Gitee service interface (defaults tohttps://gitee.com/api/v5).--version: Display the software version identifier.--transport: Communication protocol methodology (options:stdio,sse, orhttp; default isstdio).--address: Network socket specification for server initialization (default islocalhost:8000).--enabled-toolsets: A comma-separated listing of specific functionalities to permit execution (overrides default enablement).--disabled-toolsets: A comma-separated listing of specific functionalities to explicitly forbid execution.
Environmental Variable Configuration
The server settings can alternatively be established through environment variables:
GITEE_ACCESS_TOKEN: Authentication credential for Gitee.GITEE_API_BASE: The base path for API calls.ENABLED_TOOLSETS: Tool identifier whitelist, comma-delimited.DISABLED_TOOLSETS: Tool identifier blacklist, comma-delimited.
Functionality Subset Control (Toolsets)
Toolset operation adheres to two primary modes:
- Explicit Enablement (Whitelist Strategy):
- Activated by utilizing the
--enabled-toolsetsCLI flag or theENABLED_TOOLSETSenvironmental variable. - Upon specification, only the enumerated functions remain active; all others are deactivated.
-
Illustration:
--enabled-toolsets="list_user_repos,get_file_content" -
Explicit Disablement (Blacklist Strategy):
- Activated by utilizing the
--disabled-toolsetsCLI flag or theDISABLED_TOOLSETSenvironmental variable. - Upon specification, the enumerated functions are rendered inaccessible, while the remaining functions stay active.
- Illustration:
--disabled-toolsets="list_user_repos,get_file_content"
Observation: - If both enablement and disablement lists are supplied, the enablement list takes precedence. - Tool identifiers are sensitive to case differences.
Licensing
This software is provided under the terms of the MIT License. Further specifics are documented in the accompanying LICENSE file.
Accessible Functionalities
The server exposes numerous dedicated utilities for Gitee ecosystem interaction:
| Utility Name | Domain Context | Operational Summary |
|---|---|---|
| list_user_repos | Repository | Retrieve a registry of repositories accessible by the authenticated user. |
| get_file_content | Repository | Fetch the encoded contents of a specified file within a repository. |
| create_user_repo | Repository | Provision a new code repository under the user's direct ownership. |
| create_org_repo | Repository | Provision a new code repository under an organizational mandate. |
| create_enter_repo | Repository | Provision a new code repository within an enterprise structure. |
| fork_repository | Repository | Duplicate an existing repository under the current user's scope. |
| create_release | Repository | Formalize a new version release artifact for a repository. |
| list_releases | Repository | Enumerate all established releases associated with a repository. |
| search_open_source_repositories | Repository | Execute a query across publicly available Gitee code projects. |
| list_repo_pulls | Pull Request | Generate a catalog of pending merge requests for a specified repository. |
| merge_pull | Pull Request | Integrate the changes from a specified pull request into the target branch. |
| create_pull | Pull Request | Initiate a new request to merge changes from a source branch. |
| update_pull | Pull Request | Modify parameters or targets of an existing pull request. |
| get_pull_detail | Pull Request | Retrieve comprehensive metadata for a singular pull request. |
| comment_pull | Pull Request | Append textual feedback or annotations to a pull request thread. |
| list_pull_comments | Pull Request | Display all comments attached to a specific pull request. |
| get_diff_files | Pull Request | Obtain a listing of files and associated changes within a pull request delta. |
| create_issue | Issue | Log a new tracked item, bug report, or feature request. |
| update_issue | Issue | Modify the status, title, or body of an existing tracked item. |
| get_repo_issue_detail | Issue | Fetch granular information for an issue within a repository context. |
| list_repo_issues | Issue | Output a collection of all tracked items pertinent to a repository. |
| comment_issue | Issue | Add commentary to the discussion thread of a tracked item. |
| list_issue_comments | Issue | View all annotations appended to a specific tracked item. |
| get_user_info | User | Fetch identification details for the currently authorized principal. |
| search_users | User | Perform a directory search for other Gitee platform members. |
| list_user_notifications | Notification | Retrieve a chronological feed of system alerts directed at the user. |
Community Involvement
We actively encourage external participation and code enhancements from the open-source collective! To contribute to this repository, please adhere to the established protocol:
- Initiate a fork of the primary repository.
- Establish a dedicated branch for your proposed feature enhancement or defect correction.
- Implement your modifications, ensuring robust code documentation accompanies them.
- Submit a formal pull request accompanied by a lucid explanation detailing the nature of your introduced alterations.
Consult the CONTRIBUTING document for supplementary guidance on participation standards.
