ParasSolanki_github Mcp Server

ParasSolanki_github Mcp Server

🚀 GitHub MCP 服务器

GitHub MCP 服务器是一个强大的工具,它提供了命令行接口,方便用户与 GitHub API 进行交互,可完成仓库搜索、问题管理和拉取请求等操作。

🚀 快速开始

你可以按照以下步骤快速使用 GitHub MCP 服务器:

  1. 安装服务器。
  2. 进行必要的配置。
  3. 依据需求使用相关命令。

📦 安装指南

方式一:使用 npm 安装

npm install -g github-mcp-server

方式二:从源码安装

  1. 克隆仓库:
git clone https://github.com/your-username/github-mcp-server.git
cd github-mcp-server
  1. 安装依赖:
npm install
  1. 构建并安装:
npm run build && npm install -g ./dist

🛠️ 配置

  1. 在环境中设置 GitHub 个人访问令牌:
export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here
  1. 更新配置文件 config.json,添加需要的仓库信息。

💻 使用示例

基本用法

github-mcp-server --owner your_owner --repo your_repo --token your_token

选项

  • --owner-o:指定仓库的所有者。
  • --repo-r:指定仓库的名称。
  • --token-t:指定 GitHub 的个人访问令牌。

工具使用示例

搜索仓库

github-mcp-server search-repositories --query your_query

参数

  • --query-q:要搜索的关键词或主题。

获取仓库信息

github-mcp-server get-repository --owner owner_name --repo repo_name

参数

  • --owner-o:仓库的所有者。
  • --repo-r:仓库的名称。

搜索问题

github-mcp-server search-issues --owner owner_name --repo repo_name --query your_query

参数

  • --owner-o:仓库的所有者。
  • --repo-r:仓库的名称。
  • --query-q:要搜索的问题关键字。

获取问题详情

github-mcp-server get-issue --owner owner_name --repo repo_name --issue_number issue_id

参数

  • --owner-o:仓库的所有者。
  • --repo-r:仓库的名称。
  • --issue_number-i:问题的编号。

实际使用示例

  1. 搜索包含 "modelcontextprotocol" 的仓库:
github-mcp-server search-repositories --query modelcontextprotocol
  1. 获取模型上下文协议服务器仓库的问题 739 信息:
github-mcp-server get-issue --owner modelcontextprotocol --repo servers --issue_number 739
  1. 获取模型上下文协议服务器仓库的拉取请求 717 信息:
github-mcp-server get-pull-request --owner modelcontextprotocol --repo servers --pull_request_number 717

🛠️ 开发指南

安装依赖

npm install

配置 GitHub 令牌

将你的 GitHub 个人访问令牌添加到 .env 文件中:

GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here

启动调试模式

npm run dev

构建项目

npm run build

使用调试工具

npm run debug
  • 0 关注
  • 0 收藏,26 浏览
  • system 提出于 2025-09-27 13:54

相似服务问题

相关AI产品