GitHub Notifications MCP Server

by mcollina
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

GitHub 通知 MCP 服务器

一个 MCP(模型上下文协议)服务器,提供用于管理 GitHub 通知的工具。该服务器允许像 Claude 这样的 AI 助手通过自然语言命令帮助您管理 GitHub 通知。

特征

  • 列出并过滤您的 GitHub 通知
  • 将通知标记为已读
  • 查看通知线程详细信息
  • 订阅或取消订阅通知线程
  • 将话题标记为已完成
  • 管理特定于存储库的通知
  • 控制存储库通知设置(所有活动、默认或静音)

先决条件

  • Node.js 18 或更高版本
  • 带有notificationsrepo范围的 GitHub 个人访问令牌(经典)

安装

  1. 克隆此存储库
    git clone https://github.com/yourusername/github-notifications-mcp-server.git cd github-notifications-mcp-server
  2. 安装依赖项
    npm install
  3. 构建项目
    npm run build
  4. 使用你的 GitHub 令牌创建一个.env文件
    GITHUB_TOKEN=your_github_personal_access_token_here

用法

直接运行服务器

npm start

与 Claude Desktop 一起使用

将服务器添加到您的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管理存储库订阅:all_activity、默认(参与和@mentions)或忽略(静音)

示例提示

以下是服务器连接后您可以在 Claude Desktop 中使用的一些示例提示:

  • “你能查看我的 GitHub 通知吗?”
  • “显示过去 24 小时内未读的通知。”
  • “将我的所有通知标记为已读。”
  • “您能告诉我有关通知线程 12345 的信息吗?”
  • “取消我订阅主题 12345。”
  • “我对 octocat/Hello-World 存储库有哪些通知?”
  • “将来自 octocat/Hello-World 存储库的所有通知标记为已读。”
  • “监视 octocat/Hello-World 存储库上的所有活动。”
  • “将 octocat/Hello-World 存储库设置为默认设置(参与和 @mentions)。”
  • “检查 octocat/Hello-World 存储库的通知设置。”
  • “将来自 octocat/Hello-World 存储库的所有通知静音。”

发展

URL 处理

此服务器会自动将 GitHub API URL 转换为其对应的 Web UI URL。例如:

  • API网址: https://api.github.com/repos/nodejs/node/pulls/57557
  • 转换为: https://github.com/nodejs/node/pull/57557

转换处理:

  • 域名从api.github.com/repos转换为github.com
  • 拉取请求的路径修正(将pulls更改为pull
  • 保留额外的路径段

项目结构

github-notifications-mcp-server/ ├── src/ # Source code │ ├── tools/ # Tool implementations │ ├── types/ # Type definitions │ ├── utils/ # Utility functions │ ├── index.ts # Entry point │ └── server.ts # Server configuration ├── build/ # Compiled JavaScript ├── .env # Environment variables ├── package.json # Dependencies ├── tsconfig.json # TypeScript configuration └── README.md # Documentation

建筑

npm run build

测试

运行自动化测试:

npm test

手动测试 URL 转换:

npm run test:url

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

MCP 服务器使 Claude 等 AI 助手能够通过自然语言命令帮助用户管理他们的 GitHub 通知。

  1. Features
    1. Prerequisites
      1. Installation
        1. Usage
          1. Running the server directly
          2. Using with Claude Desktop
        2. Available Tools
          1. Example Prompts
            1. Development
              1. URL Handling
              2. Project Structure
              3. Building
              4. Testing
            2. License
              ID: brdsnep31l