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

git-mcp-server-multi-project

v1.0.0

Published

A Model Context Protocol (MCP) server for managing multiple Git repositories in a single workspace

Downloads

13

Readme

Git MCP Server Multi-Project

一个支持在单个 MCP 配置中管理多个 Git 仓库的 Model Context Protocol (MCP) 服务器。

功能特点

  • 多项目支持: 在一个 MCP 服务器中管理多个 Git 仓库
  • 自动扫描: 支持自动扫描工作目录下的所有 Git 项目
  • 丰富的 Git 操作: 支持 status、log、branch、diff、blame 等常用 Git 命令
  • 文件操作: 支持读取文件、列出目录、搜索文件等操作
  • 跨项目操作: 提供全局工具,可以一次查看所有项目的状态

安装

npm install

配置方式

方式一:自动扫描工作目录 (推荐)

设置 GIT_WORKSPACE 环境变量指向包含多个 Git 项目的工作目录,服务器会自动扫描该目录下的所有 Git 仓库。

{
  "mcpServers": {
    "git-my-workspace": {
      "command": "node",
      "args": ["/path/to/mcp-gitlab/index.js"],
      "env": {
        "GIT_WORKSPACE": "/path/to/your/workspace"
      }
    }
  }
}

方式二:手动指定项目列表

设置 GIT_PROJECTS 环境变量为 JSON 格式的项目配置数组:

{
  "mcpServers": {
    "git-my-workspace": {
      "command": "node",
      "args": ["/path/to/mcp-gitlab/index.js"],
      "env": {
        "GIT_PROJECTS": "[{\"name\":\"project-a\",\"path\":\"/path/to/workspace/project-a\"},{\"name\":\"project-b\",\"path\":\"/path/to/workspace/project-b\"},{\"name\":\"project-c\",\"path\":\"/path/to/workspace/project-c\"}]"
      }
    }
  }
}

可用工具

全局工具

| 工具名 | 描述 | |--------|------| | list_projects | 列出所有配置的 Git 项目 | | git_status_all | 获取所有项目的 Git 状态 | | git_branch_all | 获取所有项目的当前分支 |

项目专属工具

每个项目都会生成以下工具(工具名后缀为项目名,如 git_status_project-a):

| 工具名 | 描述 | |--------|------| | git_status_{project} | 获取 Git 状态 | | git_log_{project} | 获取提交历史 | | git_branch_{project} | 列出所有分支 | | git_current_branch_{project} | 获取当前分支名 | | git_diff_{project} | 显示差异 | | git_show_{project} | 显示特定提交详情 | | git_blame_{project} | 显示文件的逐行修改信息 | | git_stash_list_{project} | 列出所有 stash | | git_remote_{project} | 列出远程仓库 | | git_tags_{project} | 列出所有标签 | | read_file_{project} | 读取仓库中的文件 | | list_files_{project} | 列出目录中的文件 | | search_files_{project} | 搜索匹配模式的文件 | | git_file_history_{project} | 获取特定文件的提交历史 |

使用示例

示例配置

假设您的工作目录 /path/to/your/workspace 下有以下项目:

  • project-a
  • project-b
  • project-c
  • project-d

只需配置一个 MCP 服务器即可管理所有项目:

{
  "mcpServers": {
    "git-my-workspace": {
      "command": "node",
      "args": ["/path/to/mcp-gitlab/index.js"],
      "env": {
        "GIT_WORKSPACE": "/path/to/your/workspace"
      }
    }
  }
}

对比原有配置

之前: 需要为每个项目配置一个独立的 MCP 服务器

{
  "git-project-a": { ... },
  "git-project-b": { ... },
  "git-project-c": { ... },
  "git-project-d": { ... }
}

现在: 只需一个 MCP 服务器配置

{
  "git-my-workspace": {
    "command": "node",
    "args": ["/path/to/mcp-gitlab/index.js"],
    "env": {
      "GIT_WORKSPACE": "/path/to/your/workspace"
    }
  }
}

License

MIT