这是一个提供管理 GitHub 通知工具的 MCP(模型上下文协议)服务器。此服务器允许像 Claude 这样的AI助手通过自然语言命令帮助您管理 GitHub 通知。
notifications 或 repo 范围的 GitHub 个人访问令牌(经典版)克隆此仓库
git clone https://github.com/yourusername/github-notifications-mcp-server.git
cd github-notifications-mcp-server
安装依赖项
npm install
构建项目
npm run build
创建一个 .env 文件,并添加您的 GitHub 令牌
GITHUB_TOKEN=your_github_personal_access_token_here
npm start
在您的 claude_desktop_config.json 文件中添加服务器:
{
"mcpServers": {
"github-notifications": {
"command": "node",
"args": ["/absolute/path/to/github-notifications-mcp-server/build/index.js"],
"env": {
"GITHUB_TOKEN": "your_github_personal_access_token_here"
}
}
}
}
| 工具名称 | 描述 |
|---|---|
list-notifications | 列出认证用户的所有 GitHub 通知 |
mark-notifications-read | 将所有通知标记为已读 |
get-thread | 获取关于通知线程的信息 |
mark-thread-read | 将特定线程标记为已读 |
mark-thread-done | 将线程标记为完成 |
get-thread-subscription | 获取线程的订阅状态 |
set-thread-subscription | 订阅线程 |
delete-thread-subscription | 取消订阅线程 |
list-repo-notifications | 列出特定仓库的通知 |
mark-repo-notifications-read | 将仓库的通知标记为已读 |
manage-repo-subscription | 管理仓库订阅:所有活动、默认(参与和@提及)或忽略(静音) |
这里是一些示例提示,您可以使用 Claude Desktop 在连接服务器后进行操作:
此服务器会自动将 GitHub API URL 转换为其对应的 Web UI URL。例如:
https://api.github.com/repos/nodejs/node/pulls/57557https://github.com/nodejs/node/pull/57557转换处理包括:
api.github.com/repos 转换到 github.compulls 改为 pull)github-notifications-mcp-server/
├── src/ # 源代码
│ ├── tools/ # 工具实现
│ ├── types/ # 类型定义
│ ├── utils/ # 实用函数
│ ├── index.ts # 入口点
│ └── server.ts # 服务器配置
├── build/ # 编译后的 JavaScript
├── .env # 环境变量
├── package.json # 依赖项
├── tsconfig.json # TypeScript 配置
└── README.md # 文档
npm run build
运行自动化测试:
npm test
手动测试 URL 转换:
npm run test:url
MIT