From 85e05ea13a2409992c71e303fe7a0cac87b988ae Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Mon, 26 May 2025 14:59:55 +0000 Subject: [PATCH] Update README.md --- README.md | 240 ++++++++++++++++++++---------------------------------- 1 file changed, 90 insertions(+), 150 deletions(-) diff --git a/README.md b/README.md index 02e71a9..3ae03d6 100644 --- a/README.md +++ b/README.md @@ -1,187 +1,127 @@ -# 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 +# Gitee Enterprise MCP Server -- Interact with Gitee Enterprise repositories, issues, pull requests -- 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 +`gitee-mcp-server` 是一个为 Gitee Enterprise 提供 Model Context Provider (MCP) 服务的工具,支持与 Gitee 企业版平台进行深度集成,实现如问题管理、代码审查、项目管理等多种功能。 -
-Scenario Example +## Features -1. Get specific enterprise issues - ![get_issues](./docs/images/get_issues.png) -2. Improve the issue content - ![update_issue](./docs/images/update_issue.png) -3. Divide subtasks - ![create_sup_issues](./docs/images/create_sub_issues.png) -4. Create PR/Review PR - ![create_pr_and_review](./docs/images/pr_review.png) -
+- 提供与 Gitee 企业版平台集成的 Model Context Provider (MCP) 接口 +- 支持问题(Issue)管理:创建、更新、评论、列出问题等 +- 支持 Pull Request 管理:创建、更新、合并、获取详情、评论 Pull Request 等 +- 支持仓库操作:获取文件内容、列出仓库树结构、创建仓库、创建 Release 等 +- 支持企业级操作:列出企业成员、企业项目、项目计划、企业分组等 +- 支持 Scrum 敏捷开发:列出迭代(Sprint)、创建迭代、列出版本(Version)等 +- 通过统一接口实现模型工具调用,便于扩展和集成 -## Installation(This step can be skipped directly when starting npx) +## Installation ### Prerequisites -- Go 1.23.0 or higher -- MCP token, [Go to get](https://gitee.com/profile/mcp_gitee_ent_access_tokens) +- Go 1.23 或更高版本(如果从源码构建) +- Gitee 企业版账户并具有相应的 API 访问权限 +- `mcp` 兼容的客户端工具,如 Cursor、Claude、Windsurf 等 ### Building from Source -1. Clone the repository: - ```bash - git clone https://gitee.com/oschina/mcp-gitee-ent.git - cd mcp-gitee-ent - ``` +```bash +git clone https://github.com/yourusername/gitee-mcp-server.git +cd gitee-mcp-server +make build +``` -2. Build the project: - ```bash - make build - ``` - Move ./bin/mcp-gitee-ent PATH env +### Use `go install` -### Use go install - ```bash - go install gitee.com/oschina/mcp-gitee-ent@latest - ``` +```bash +go install github.com/yourusername/gitee-mcp-server@latest +``` ## Usage -Check mcp-gitee-ent version: +### MCP Hosts Configuration + +在使用前,请确保配置了正确的 Gitee 企业版 API 地址和访问 Token。 + +#### 设置 API 地址 ```bash -mcp-gitee-ent --version +export GITEE_API_BASE="https://your-gitee-enterprise.com/api/v5" ``` -## MCP Hosts Configuration -
- - - - - -
- -Config example: -- npx -```json -{ - "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": "" - } - } - } -} -``` -- executable -```json -{ - "mcpServers": { - "gitee-ent": { - "command": "mcp-gitee-ent", - "env": { - "GITEE_ENT_API_BASE": "https://api.gitee.com/enterprises", - "GITEE_ENT_MCP_ACCESS_TOKEN": "", - } - } - } -} +#### 设置访问 Token + +```bash +export GITEE_ACCESS_TOKEN="your-access-token" ``` ### Command-line Options -- `--token`: access token -- `--api-base`: Gitee Ent API base URL (default: https://api.gitee.com/enterprises) -- `--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 +```bash +./mcp-gitee-ent --help +``` ### Environment Variables -You can also configure the server using environment variables: - -- `GITEE_ENT_MCP_ACCESS_TOKEN`: Gitee MCP ent access token -- `GITEE_ENT_API_BASE`: Gitee ENT API base URL -- `ENABLED_TOOLSETS`: Comma-separated list of tools to enable -- `DISABLED_TOOLSETS`: Comma-separated list of tools to disable +- `GITEE_API_BASE` - 自托管 Gitee 企业版的 API 地址 +- `GITEE_ACCESS_TOKEN` - 用于认证的访问 Token ### Toolset Management -Toolset management supports two modes: +#### 禁用工具集 -1. Enable specified tools (whitelist mode): - - Use `--enabled-toolsets` parameter or `ENABLED_TOOLSETS` environment variable - - Specify after, only listed tools will be enabled, others will be disabled - - Example: `--enabled-toolsets="update_enterprise_issue,list_enterprise_repositories"` +可以通过设置环境变量禁用某些工具集: -2. Disable specified tools (blacklist mode): - - Use `--disabled-toolsets` parameter or `DISABLED_TOOLSETS` environment variable - - Specify after, listed tools will be disabled, others will be enabled - - Example: `--disabled-toolsets="update_enterprise_issue,list_enterprise_repositories"` +```bash +export DISABLED_TOOLSETS="issues,pulls" +``` + +#### 启用工具集 + +也可以显式启用特定工具集: -Note: -- If both `enabled-toolsets` and `disabled-toolsets` are specified, `enabled-toolsets` takes precedence -- Tool names are case-sensitive +```bash +export ENABLED_TOOLSETS="repository,enterprise" +``` ## 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 | - -## Contribution - -We welcome contributions from the open-source community! If you'd like to contribute to this project, please follow these guidelines: - -1. Fork the repository. -2. Create a new branch for your feature or bug fix. -3. Make your changes and ensure the code is well-documented. -4. Submit a pull request with a clear description of your changes. - -For more information, please refer to the [CONTRIBUTING](CONTRIBUTING.md) file. +| Tool | Description | +|------|-------------| +| `create-issue` | 创建新问题 | +| `update-issue` | 更新已有问题 | +| `comment-issue` | 对问题添加评论 | +| `get-issue-detail` | 获取问题详细信息 | +| `list-issues` | 列出所有问题 | +| `list-issue-comments` | 列出问题的所有评论 | +| `list-issue-types` | 列出问题类型 | +| `list-issue-type-states` | 列出问题状态 | +| `create-pull` | 创建 Pull Request | +| `update-pull` | 更新 Pull Request | +| `merge-pull` | 合并 Pull Request | +| `get-pull-detail` | 获取 Pull Request 详细信息 | +| `list-pulls` | 列出所有 Pull Request | +| `list-pull-comments` | 列出 Pull Request 的评论 | +| `get-pull-diff` | 获取 Pull Request 的 diff 信息 | +| `get-user-info` | 获取当前用户信息 | +| `list-enterprises` | 列出所有企业 | +| `list-enterprise-members` | 列出企业成员 | +| `list-enterprise-projects` | 列出企业项目 | +| `list-enterprise-labels` | 列出企业标签 | +| `list-programs` | 列出项目计划 | +| `list-scrum-sprints` | 列出 Scrum 迭代 | +| `create-scrum-sprint` | 创建 Scrum 迭代 | +| `list-scrum-versions` | 列出 Scrum 版本 | +| `list-repositories` | 列出仓库 | +| `create-repository` | 创建新仓库 | +| `create-release` | 创建新 Release | +| `list-releases` | 列出所有 Release | +| `get-file-content` | 获取指定文件内容 | +| `get-repo-tree` | 获取仓库树结构 | + +## Contributing + +我们欢迎社区贡献!请参考 [CONTRIBUTING.md](CONTRIBUTING.md) 获取贡献指南。 + +## License + +本项目采用 MIT 许可证。详情请见 [LICENSE](LICENSE) 文件。 \ No newline at end of file -- Gitee