GitLab服务器交互工具

一个基于TypeScript的MCP服务器,用于与自托管的GitLab实例交互,提供项目、问题和问题笔记的管理功能。

  • by Foxhunt
  • JavaScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 Foxhunt/gitlab-mcp-server

使用说明

GitLab MCP服务器

与GitLab服务器交互。

这是一个基于TypeScript的MCP服务器,与自托管的GitLab实例交互。服务器提供了获取和管理GitLab数据的工具,特别是项目、问题和问题注释(注释)。可用的工具有: list_projects, get_issues, get_issue_notes, search, get_issue, get_todos, get_wiki_page,以及 list_wiki_pages.

特性

此GitLab MCP服务器提供以下工具:

  • list_projects:列出用户可访问的所有项目。
  • get_issues:使用基本筛选获取特定项目的问题。
  • get_issue_notes:获取特定问题的注释(注释)。
  • search:根据搜索词搜索项目和问题。
  • get_issue:使用项目的ID和IID从项目中检索特定问题。
  • get_todos:使用可选筛选器检索待办事项列表。
  • get_wiki_page:通过项目ID和slug检索特定的wiki页面。
  • list_wiki_pages:检索给定项目的所有wiki页面。

发展

安装依赖项:

npm install

构建服务器:

npm run build

对于自动重建的开发:

npm run watch

安装

要与Claude Desktop一起使用,请添加服务器配置:

{
  "mcpServers": {
    "gitlab-server": {
      "command": "/path/to/gitlab-server/build/index.js",
      "env": {
        "GITLAB_API_TOKEN": "<Gitlab API Token >",
        "GITLAB_HOST": "<GitLab Host URL>"
      }
    }
  }
}

调试

由于MCP服务器通过stdio进行通信,调试可能具有挑战性。我们建议使用 MCP检查员,可作为包脚本使用:

npm run inspector

检查器将提供一个URL,用于访问浏览器中的调试工具。

GitLab API文档

https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/api https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/rest/_index.md https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/rest/authentication.md https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/projects.md https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/issues.md https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/notes.md https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/issue_links.md https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/search.md https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/wikis.md