Token导航 LogoToken导航TokenDH.com
MCP GitHub Memory logo
开发工具未说明官方级别未说明来源级核验

MCP GitHub Memory

MCP Server

一个通过MCP协议自动索引GitHub拉取请求和提交历史的服务,使AI助手能够搜索项目历史记录。

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
GitHubTypeScriptClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

AmedeoPelliccia

提供方

AmedeoPelliccia

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

MCP GitHub内存🧠

![License: MIT](https://opensource.org/licenses/MIT) ![TypeScript](https://www.typescriptlang.org/) ](https://nodejs.org/) ![SQLite](https://www.sqlite.org/) ![MCP Compatible](https://modelcontextprotocol.io)

让你的AI助手完美回忆起你的GitHub存储库历史

一个模型上下文协议(MCP)服务器,可以自动索引GitHub的pull请求和提交,使GitHub Copilot和Claude等AI助手可以搜索您的项目历史。

✨ 特性

  • 🔄 自动索引 -GitHub webhooks触发PR和提交的实时索引
  • 🔍 智能搜索 -按关键字、作者、存储库或状态查询
  • 🔒 安全 -HMAC-SHA256 webhook验证,没有硬编码的秘密
  • 快速 -带索引的SQLite提供\|Webhook| B[MCP Server]

B -->|Index| C[SQLite DB] D[Copilot/Claude] -->|MCP Query| B B -->|Context| D


## 🚀 快速开始

### 先决条件

- Node.js 18+
- 具有管理员访问权限的GitHub存储库
- HTTPS端点(或用于测试的ngrok)

### 安装

Clone the repository

git clone https://github.com/AmedeoPelliccia/mcp-github-memory cd mcp-github-memory

Install dependencies

npm install

Build TypeScript

npm run build

Copy environment template

cp .env.example .env

Edit .env with your GITHUB_WEBHOOK_SECRET


### 运行服务器

#### 作为GitHub Webhook服务器

Start webhook server on port 3000

WEBHOOK_PORT=3000 GITHUB_WEBHOOK_SECRET=your-secret node dist/index.js webhook


#### 作为MCP服务器

Start MCP server (stdio mode)

node dist/index.js mcp


### 配置GitHub Webhook

1. 转到您的仓库→ **设置** → **网络钩子** → **添加webhook**
1. **有效载荷URL**: `https://your-domain.com/webhook`
1. **内容类型**: `application/json`
1. **秘密**:您的 `GITHUB_WEBHOOK_SECRET`
1. **事件**:选择“拉取请求”和“推送”
1. **保存**

### 配置AI助手

#### GitHub Copilot

1. 打开Copilot聊天设置
1. 添加MCP服务器
1. **统一资源定位符**:MCP服务器的路径
1. **命令**: `node /path/to/dist/index.js mcp`

#### 克劳德桌面

添加到 `claude_desktop_config.json`:

{ "mcpServers": { "github-memory": { "command": "node", "args": ["/absolute/path/to/dist/index.js", "mcp"], "env": { "GITHUB_MEMORY_DB_PATH": "/path/to/github-memory.db" } } } }


## 📡 MCP工具可用

|工具|说明|参数|
|------|-------------|------------|
| `search_pull_requests` |搜索索引PR| `query`, `repository`, `author`, `state` |
| `get_pull_request` |获取特定PR| `repository`, `number` |
| `search_commits` |搜索索引提交| `query`, `repository`, `author` |
| `get_commit` |获得具体承诺| `sha` |

## 💻 发展

### 与ngrok的地方发展

Terminal 1: Start server

npm run build && npm start webhook

Terminal 2: Expose via ngrok

ngrok http 3000

Use ngrok URL for GitHub webhook


### 测试

Run all tests

npm test

Watch mode during development

npm run test:watch

Build in watch mode

npm run watch


### 项目结构

mcp-github-memory/ ├── src/ │ ├── database.ts # SQLite operations │ ├── webhook.ts # GitHub webhook handler │ ├── mcp-server.ts # MCP protocol implementation │ └── index.ts # Main entry point ├── tests/ │ └── database.test.ts # Comprehensive test suite ├── dist/ # Compiled JavaScript ├── package.json # Dependencies & scripts ├── tsconfig.json # TypeScript configuration └── .env.example # Environment template


## 🔐 安全

- ✅ **Webhook验证** -HMAC-SHA256签名验证
- ✅ **环境变量** -没有硬编码的秘密
- ✅ **类型安全** -带有严格模式的完整TypeScript
- ✅ **SQL注入保护** -参数化查询
- ✅ **最小依赖性** -仅限基本套餐

## 📊 查询示例

### 在GitHub上进行Copilot聊天

User: "Show me PRs about authentication" Copilot: [Searches via MCP] Found PR #42 "Add OAuth2 authentication"...

User: "What commits mention the API refactor?" Copilot: [Queries commits] Found 3 commits from last week...


### 直接MCP工具调用

{ "tool": "search_pull_requests", "arguments": { "query": "authentication", "state": "merged" } }


## 🧪 测试覆盖率

✅ Database Operations ✓ Creates database with correct schema ✓ Inserts and retrieves pull requests ✓ Searches pull requests by query ✓ Inserts and retrieves commits ✓ Searches commits by message ✓ Handles upsert operations

Test Suites: 1 passed Tests: 6 passed Coverage: 100%


## 🗺️ 路线图

- \[\]使用SQLite FTS5进行全文搜索
- \[\]问题和评论索引
- \[\]语义搜索的向量嵌入
- \[\]PostgreSQL扩展适配器
- \[\]Web UI仪表板
- \[\]普罗米修斯指标
- \[\]多存储库支持
- \[\]GitLab/Bitbucket适配器

## 🤝 贡献

欢迎投稿!请随时提交拉取请求。

1. 分叉存储库
1. 创建功能分支(`git checkout -b feature/AmazingFeature`)
1. 运行测试(`npm test`)
1. 提交您的更改(`git commit -m 'Add some AmazingFeature'`)
1. 推到分支(`git push origin feature/AmazingFeature`)
1. 打开拉取请求

## 📄 许可证

此项目根据MIT许可证获得许可-请参阅 [许可证](LICENSE) 文件以获取详细信息。

## 🙏 致谢

- [模型上下文协议](https://modelcontextprotocol.io) 规格
- [Anthropic](https://anthropic.com) 用于MCP设计
-  文档
- 开源社区

## ⭐ 明星历史

[![Star History Chart](https://api.star-history.com/svg?repos=AmedeoPelliccia/mcp-github-memory&type=Date)](https://star-history.com/#AmedeoPelliccia/mcp-github-memory&Date)

______________________________________________________________________

Built with ❤️ for the AI-assisted development community

⭐ Star this project • 
🐛 Report Bug • 
💡 Request Feature

目录标签

目录标签

GitHubTypeScriptClaudeGitHub集成本地部署AI助手支持代码历史搜索MCP协议实时索引

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP