GitHub Issue Finder

GitHub Issue Finder

🚀 GitHub 支持助手

GitHub 支持助手是一个 MCP 服务器,它能助力支持工程师快速查找类似问题,显著加快故障排除的进程,提升工作效率。

🚀 快速开始

本部分将引导你完成 GitHub 支持助手的安装与配置,让你能迅速使用该工具。

📦 安装指南

安装依赖

在项目根目录下执行以下命令,安装所需依赖:

npm install

设置 GitHub 令牌

将你的 GitHub 个人访问令牌设置为环境变量,替换 your_github_personal_access_token 为实际的令牌:

export GITHUB_TOKEN=your_github_personal_access_token

构建服务器

执行以下命令构建服务器:

npm run build

与 Claude 集成

更新 claude 桌面配置文件,可使用以下命令打开配置文件:

code ~/Library/Application\ Support/Claude/claude_desktop_config.json

在配置文件中包含此仓库克隆到的完整路径,示例如下:

{
"mcpServers": {
"find-similar-github-issues": {
"command": "node",
"args": [
"/Users//build/index.js"
]
}
}
}

✨ 主要特性

  • 相似问题搜索:依据问题描述,在 GitHub 仓库中精准搜索类似问题。
  • 相似度评分:计算相似度评分,对搜索结果进行合理排名。
  • 格式化信息返回:返回格式化的故障排除信息及相关链接,方便查看与使用。

💻 使用示例

基础用法

服务器提供了 find-similar-issues 工具,可用于查找与给定描述类似的 GitHub 问题。示例代码如下:

# 调用 find-similar-issues 工具查找相似问题
# 假设使用 Python 的 subprocess 模块调用命令行工具
import subprocess

owner = "your_owner"
repo = "your_repo"
issueDescription = "your_issue_description"
maxResults = 5

command = f"node /path/to/your/build/index.js find-similar-issues --owner {owner} --repo {repo} --issueDescription '{issueDescription}' --maxResults {maxResults}"
result = subprocess.run(command, shell=True, capture_output=True, text=True)
print(result.stdout)

高级用法

若需自定义搜索参数,可调整 ownerrepoissueDescriptionmaxResults 的值。例如,要增加返回的最大类似问题数量:

import subprocess

owner = "your_owner"
repo = "your_repo"
issueDescription = "your_issue_description"
maxResults = 10  # 增加最大结果数量

command = f"node /path/to/your/build/index.js find-similar-issues --owner {owner} --repo {repo} --issueDescription '{issueDescription}' --maxResults {maxResults}"
result = subprocess.run(command, shell=True, capture_output=True, text=True)
print(result.stdout)

📚 详细文档

find-similar-issues 工具参数说明

参数 详情
owner GitHub 仓库所有者或组织名称
repo GitHub 仓库名称
issueDescription 要查找相似问题的描述
maxResults 要返回的最大类似问题数量(默认:5)

🔧 技术细节

本实现采用简单的杰卡德相似系数来比较文本。不过在生产环境中,为了获得更精准的匹配效果,建议采用更复杂的 NLP 技术,如词向量模型、深度学习模型等。杰卡德相似系数虽然实现简单,但对于语义理解和复杂文本的处理能力有限,而更高级的 NLP 技术能更好地捕捉文本的语义信息,提高匹配的准确性。

  • 0 关注
  • 0 收藏,9 浏览
  • system 提出于 2025-09-28 15:12

相似服务问题