mcp-gitee-ent
mcp-gitee-ent is the Model Context Protocol (MCP) server implementation for Gitee Enterprise.
Gitee Enterprise MCP Server is a Model Context Protocol (MCP) server implementation for Gitee Enterprise. It provides a set of tools for interacting with Gitee Enterprise API, allowing AI assistants to manage enterprise repositories, issues, pull requests, and more. 1. Get specific enterprise issues 2. Improve the issue content 3. Divide subtasks 4. Create PR/Review PR 2. Build the project: Move ./bin/mcp-gitee-ent PATH env
Summary extracted from the README.
Gitee Enterprise MCP Server
Gitee Enterprise MCP Server is a Model Context Protocol (MCP) server implementation for Gitee Enterprise. It provides a set of tools for interacting with Gitee Enterprise API, allowing AI assistants to manage enterprise repositories, issues, pull requests, and more.
Features
- Interact with Gitee Enterprise repositories, issues, pull requests, and knowledge-base documents
- Support for enterprise-level operations and management
- Configurable API base URL to support different Gitee Enterprise instances
- Support for SSE and Stdio transport
- Dynamic toolset enable/disable
- Get specific enterprise issues

- Improve the issue content

- Divide subtasks

- Create PR/Review PR

Installation(This step can be skipped directly when starting npx)
Prerequisites
- Go 1.23.0 or higher
- MCP token, Go to get
Building from Source
-
Clone the repository:
git clone https://gitee.com/oschina/mcp-gitee-ent.git cd mcp-gitee-ent -
Build the project:
make buildMove ./bin/mcp-gitee-ent PATH env
Use go install
go install gitee.com/oschina/mcp-gitee-ent@latest
Usage
Check mcp-gitee-ent version:
mcp-gitee-ent --version
MCP Hosts Configuration
Config example:
- npx
{
"mcpServers": {
"gitee-ent": {
"command": "npx",
"args": [
"-y",
"@gitee/mcp-gitee-ent@latest"
],
"env": {
"GITEE_ENT_API_BASE": "https://api.gitee.com/enterprises",
"GITEE_ENT_MCP_ACCESS_TOKEN": "<your mcp ent access token>",
"GITEE_ENT_MCP_ALLOWED_FILE_ROOTS": "/absolute/path/to/allowed/files"
}
}
}
}
- executable
{
"mcpServers": {
"gitee-ent": {
"command": "mcp-gitee-ent",
"env": {
"GITEE_ENT_API_BASE": "https://api.gitee.com/enterprises",
"GITEE_ENT_MCP_ACCESS_TOKEN": "<your mcp ent access token>",
"GITEE_ENT_MCP_ALLOWED_FILE_ROOTS": "/absolute/path/to/allowed/files"
}
}
}
}
Command-line Options
--token: access token--api-base: Gitee Ent API base URL (default: https://api.gitee.com/enterprises)--web-base: Enterprise web origin used to build html_url (default: https://e.gitee.com)--version: Show version information--transport: Transport type (stdio or sse, default: stdio)--sse-address: The host and port to start the SSE server on (default: localhost:8000)--enabled-toolsets: Comma-separated list of tools to enable (if specified, only these tools will be enabled)--disabled-toolsets: Comma-separated list of tools to disable
Environment Variables
You can also configure the server using environment variables:
GITEE_ENT_MCP_ACCESS_TOKEN: Gitee MCP ent access tokenGITEE_ENT_API_BASE: Gitee ENT API base URLGITEE_ENT_WEB_BASE: Enterprise web origin used to build html_url (default: https://e.gitee.com)GITEE_ENT_MCP_ALLOWED_FILE_ROOTS: Allowed absolute directories for document upload and download. Separate multiple directories with the operating system path-list separator (:on Unix,;on Windows). Defaults to the server's current working directory.ENABLED_TOOLSETS: Comma-separated list of tools to enableDISABLED_TOOLSETS: Comma-separated list of tools to disable
Document File Access Scope
| Configuration | Effective scope |
|---|---|
| Not set | The MCP server process's current working directory and its descendants |
/ on Unix/macOS |
Any existing path that the MCP server process can access |
C:\;D:\ on Windows |
Any accessible path on the listed drives |
/srv/gitee-imports:/srv/gitee-exports on Unix/macOS |
Only the listed directories and their descendants |
Configured roots must be existing absolute directories. Symbolic links are resolved before the scope check, and operating-system permissions, container mounts, and sandbox restrictions still apply. Setting a filesystem root grants the document tools broad local read/write access, so use it only for a trusted local MCP server; use dedicated import and export directories for shared or remote deployments.
Toolset Management
Toolset management supports two modes:
-
Enable specified tools (whitelist mode):
- Use
--enabled-toolsetsparameter orENABLED_TOOLSETSenvironment variable - Specify after, only listed tools will be enabled, others will be disabled
- Example:
--enabled-toolsets="update_enterprise_issue,list_enterprise_repositories"
- Use
-
Disable specified tools (blacklist mode):
- Use
--disabled-toolsetsparameter orDISABLED_TOOLSETSenvironment variable - Specify after, listed tools will be disabled, others will be enabled
- Example:
--disabled-toolsets="update_enterprise_issue,list_enterprise_repositories"
- Use
Note:
- If both
enabled-toolsetsanddisabled-toolsetsare specified,enabled-toolsetstakes precedence - Tool names are case-sensitive
- An explicit entry in
enabled-toolsetswins over the same entry indisabled-toolsets
Progressive Tool Discovery
The server exposes three discovery meta-tools so that a client can work with the full catalog without listing every tool up front:
search_tools(query, domain?, limit?)finds candidate tool names by natural-language query. Results include the tool name, summary, domain, risk, and required argument names.domainnarrows the search to one catalog domain, andlimitdefaults to 8 (maximum 20).inspect_tool(name)returns the full input schema, notes, and a valid example for one exact tool name. Inspect a search result before invoking it when argument names or formats are unclear.invoke_tool(name, arguments)executes one exact tool name with a JSON argument object. It cannot call itself recursively.
Tool discovery is filtered by the same toolset configuration as direct tool registration. A tool that is disabled or hidden by ENABLED_TOOLSETS / DISABLED_TOOLSETS is rejected by both inspect_tool and invoke_tool, and it is not returned by search_tools. When a request carries its own tool filter, inspect_tool and invoke_tool reject tools outside that filter as well, and unknown-name suggestions only include tools available to the request.
Search never fabricates results. If a query only matches ineligible tools (for example, a disabled domain), it still returns the regular no-match message and suggests broadening the keywords or removing the domain filter.
The discovery meta-tools are infrastructure: search_tools, inspect_tool, and invoke_tool remain available when an ENABLED_TOOLSETS allowlist is set, even if they are not explicitly listed. They are hidden only when explicitly named in DISABLED_TOOLSETS, unless they are also explicitly named in ENABLED_TOOLSETS, in which case the enabled entry wins.
Canonical Parameter Names
Tool arguments use unambiguous names; renamed legacy arguments are rejected with a migration hint.
| Canonical | Replaces / meaning |
|---|---|
repository_id |
project_id; accepts a repository ID or repository path |
repository_ids |
project_ids; repository IDs for filters or associations |
program_id |
Gitee Program (项目) ID, not a repository |
program_ids |
Multiple Gitee Program (项目) IDs |
passed |
Boolean test-report state previously named state |
state_id |
Numeric state previously named state |
statuses |
Comma-separated program status filters previously named status |
priorities |
Comma-separated priority filters previously named priority |
assignee_ids |
Comma-separated assignee filters previously named assignee_id |
linked_issue_id |
Numeric issue filter previously named issue_id |
test_plan_ids |
Array of numeric test-plan IDs when listing reports |
pull_request_iid is the repository-scoped display IID; pull_request_id is the internal database ID.
Available Tools
The server provides various tools for interacting with Gitee Enterprise:
| Tool | Category | Description |
|---|---|---|
| list_enterprises | Enterprise | List user's enterprises |
| list_enterprise_repositories | Repository | List repositories in an enterprise |
| create_enterprise_repository | Repository | Create a repository in an enterprise |
| create_enterprise_repo_release | Repository | Create a release for repository |
| list_enterprise_repo_releases | Repository | List releases for repository |
| get_enterprise_repository_file_content | Repository | Get the content of a specific file in the repository |
| get_enterprise_repo_tree | Repository | Get the tree structure of a repository |
| list_enterprise_pulls | Pull Request | List enterprise pull requests |
| create_enterprise_repo_pull | Pull Request | Create a pull request for repository |
| merge_enterprise_pull | Pull Request | Merge a pull request |
| get_enterprise_pull_detail | Pull Request | Get pull request detail |
| update_enterprise_pull | Pull Request | Update a pull request |
| get_enterprise_pull_diff | Pull Request | Get pull request diff |
| comment_enterprise_pull | Pull Request | Comment on a pull request |
| list_enterprise_pull_comments | Pull Request | List pull request comments |
| create_enterprise_issue | Issue | Create an issue |
| update_enterprise_issue | Issue | Update an issue |
| get_enterprise_issue_detail | Issue | Get issue detail |
| list_enterprise_issues | Issue | List issues |
| comment_enterprise_issue | Issue | Comment on an issue |
| list_enterprise_issue_comments | Issue | List issue comments |
| get_user_info | User | Get user info |
| list_enterprise_members | Member | List members of an enterprise |
| list_enterprise_groups | Group | List groups in an enterprise |
| list_enterprise_labels | Label | List labels of an enterprise |
| list_programs | Program | List programs of an enterprise |
| list_scrum_sprints | Program | List Scrum Sprints |
| create_scrum_sprint | Program | Create a Scrum Sprint |
| list_scrum_versions | Program | List Scrum Versions |
| list_issue_types | Issue Type | List issue types |
| list_issue_type_states | Issue State | List issue states |
| create_enterprise_document | Document | Create a new enterprise knowledge-base document |
| create_enterprise_document_node | Document | Create a page or folder inside an existing document |
| rename_enterprise_document_folder | Document | Rename a folder in an existing document |
| list_enterprise_documents | Document | List or search accessible enterprise knowledge-base documents |
| list_enterprise_document_pages | Document | List and flatten a document's page tree |
| get_enterprise_document_page | Document | Get a document page's source content and metadata |
| upload_enterprise_document_files | Document | Import local ZIP, HTML, TXT, or Markdown files into a document |
| download_enterprise_document | Document | Export a document as Markdown, HTML, or PDF to a local directory |
| update_enterprise_document_page | Document | Replace a page's content with a version precondition |
| search_tools | Discovery | Find candidate tool names by natural-language query |
| inspect_tool | Discovery | Show the full argument schema and a valid example for one tool |
| invoke_tool | Discovery | Execute one enabled tool by exact name with a JSON argument object |
Enterprise Document Workflow
- Call
list_enterprisesto resolve the targetenterprise_id. - To start a new document, call
create_enterprise_documentand use the returneddocument_idin the other document tools. Otherwise calllist_enterprise_documentsand use itsdocument_id. Useprogram_idfor program documents orcreated_by_me=trueto limit the result when needed.- To find documents by keyword, pass
search. The server matches document names and page names (and page content when full-text search is enabled) and returns page-level hits, each carrying itsdocument_idandpage_id; the result is ordered by the sort field descending with a server-fixed page size, soprogram_id,created_by_me,direction, andper_pagecannot be combined withsearch.
- To find documents by keyword, pass
- Call
list_enterprise_document_pagesto resolve a page'spage_id, flattened path, content type, and current version. To add structure, callcreate_enterprise_document_nodewithtypeset topageorfolder, passing an optionalparent_idto nest it under an existing folder. Rename a folder withrename_enterprise_document_folder; rename a page viaupdate_enterprise_document_page'spage_name. - Call
get_enterprise_document_pageimmediately before editing. Preserve the returned content representation and pass its version asexpected_versiontoupdate_enterprise_document_page.
document_id is the underlying WikiInfo.id. document_node_id identifies the document's location in the enterprise knowledge-base tree and is returned only as metadata. page_id identifies a page or folder inside the document.
Document permissions are enforced by Gitee Enterprise. A document returned by list_enterprise_documents may still be read-only for the authenticated user.
Upload and File Access
upload_enterprise_document_filesadds pages to an existing document; it does not create a document. It accepts 1 to 20 absolute paths with.zip,.html,.txt, or.mdextensions. Each file must be no larger than 6 MiB, and imported content may contain at most 20 pages.- Upload and download paths refer to the machine running this MCP server, not the Agent user's remote machine. Paths must be absolute, resolve inside
GITEE_ENT_MCP_ALLOWED_FILE_ROOTS, and already exist. The download destination must be a directory. - Import processing may finish asynchronously. After an upload, call
list_enterprise_document_pagesorget_enterprise_document_pageagain to obtain the imported page's final version before updating it.
Export and Update Safety
- Markdown and HTML exports may be ZIP archives; PDF exports are PDF files.
download_enterprise_documentdoes not overwrite an existing path unlessoverwrite=trueis explicitly supplied. update_enterprise_document_pageperforms a complete content replacement, not a patch. An emptycontentvalue clears the page. The tool re-reads the page and rejects the update whenexpected_versionis stale.page_nameoptionally renames the page, andmentioned_user_idsaccepts enterprise user IDs returned bylist_enterprise_members.
Release
The repository provides a repeatable local release workflow that validates and builds tagged source, creates or reuses a Gitee Release, synchronizes its release notes, and uploads missing artifacts. See docs/releasing.md. npm publishing remains a separate resumable step.
Contribution
We welcome contributions from the open-source community! If you'd like to contribute to this project, please follow these guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure the code is well-documented.
- Submit a pull request with a clear description of your changes.
For more information, please refer to the CONTRIBUTING file.