npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nilsir/mcp-server-gitlab

v1.0.1

Published

GitLab MCP Server - 通过 MCP 协议与 GitLab API 交互

Readme

GitLab MCP Server

通过 MCP(Model Context Protocol) 协议让 Claude 操作 GitLab API 的服务器。

Node.js TypeScript MCP SDK


功能

共 15 个工具,覆盖 GitLab 核心操作:

| 分类 | 工具 | 说明 | |------|------|------| | 服务器信息 | get_mcp_server_version | 返回服务器版本信息 | | Issues | create_issue | 创建 Issue | | Issues | get_issue | 获取 Issue 详情 | | Merge Requests | create_merge_request | 创建 MR | | Merge Requests | get_merge_request | 获取 MR 详情 | | Merge Requests | get_merge_request_commits | 获取 MR 提交列表 | | Merge Requests | get_merge_request_diffs | 获取 MR 差异 | | Merge Requests | get_merge_request_pipelines | 获取 MR 关联 Pipeline | | Pipelines | get_pipeline_jobs | 获取 Pipeline Job 列表 | | Pipelines | manage_pipeline | 列出/创建/重试/取消/删除 Pipeline | | 工作项 | create_workitem_note | 为工作项创建评论(GraphQL) | | 工作项 | get_workitem_notes | 获取工作项评论列表(GraphQL) | | 搜索 | search | 全局/群组/项目搜索 | | 搜索 | search_labels | 搜索标签 | | 搜索 | semantic_code_search | 语义代码搜索(需 GitLab Duo Enterprise) |


环境要求

  • Node.js >= 18.0.0
  • GitLab Personal Access Token(需要 api scope)

安装与配置

环境变量

| 变量名 | 必填 | 说明 | |--------|------|------| | GITLAB_TOKEN | 是 | GitLab Personal Access Token | | GITLAB_URL | 否 | GitLab 实例地址,默认 https://gitlab.com |

方式一:npx(推荐,无需本地安装)

Claude Code 命令行添加:

claude mcp add --scope project gitlab -- npx @nilsir/mcp-server-gitlab

或手动配置 .mcp.json

{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["@nilsir/mcp-server-gitlab"],
      "env": {
        "GITLAB_TOKEN": "your_token_here",
        "GITLAB_URL": "https://gitlab.example.com"
      }
    }
  }
}

方式二:从源码构建

git clone https://github.com/nilsir/mcp-server-gitlab.git
cd mcp-server-gitlab
npm install && npm run build

Claude Code 命令行添加:

claude mcp add --scope project gitlab -- node /path/to/dist/index.js

或手动配置 .mcp.json

{
  "mcpServers": {
    "gitlab": {
      "command": "node",
      "args": ["/path/to/mcp-server-gitlab/dist/index.js"],
      "env": {
        "GITLAB_TOKEN": "your_token_here",
        "GITLAB_URL": "https://gitlab.example.com"
      }
    }
  }
}

开发

# 安装依赖
npm install

# 运行测试(监听模式)
npm test

# 单次运行测试(37 个测试)
npm run test:run

# 编译 TypeScript
npm run build

# 开发模式(无需编译,直接运行 TypeScript)
npm run dev

# 本地调试(使用 MCP Inspector)
npx @modelcontextprotocol/inspector node dist/index.js

技术栈

  • 运行时:TypeScript + Node.js (ESM)
  • MCP SDK@modelcontextprotocol/sdk ^1.12.0
  • 参数校验:Zod
  • 测试框架:Vitest
  • HTTP 客户端:原生 fetch(无额外依赖)

License

MIT