Mcp Feather Code

Mcp Feather Code

🚀 Feather Code MCP 服务器

这是一个基于模型上下文协议(MCP),为 Claude 桌面端提供的全面 GitHub 集成方案。借助 15 个强大工具,你可以直接在 Claude 中使用所有 GitHub 功能。

🚀 快速开始

Feather Code MCP 服务器是一个利用模型上下文协议(MCP),为 Claude 桌面端提供全面 GitHub 集成的工具。借助 15 个强大工具,你可以直接在 Claude 中使用所有 GitHub 功能。

安装

你可以选择快速安装(推荐)或手动安装:

快速安装(推荐)

  • Linux/macOS
curl -fsSL https://raw.githubusercontent.com/yourusername/feather-code/main/install.sh | bash
  • Windows
Invoke-WebRequest -Uri https://raw.githubusercontent.com/yourusername/feather-code/main/install.bat -OutFile install.bat
.\install.bat

手动安装

  1. 克隆仓库:
git clone https://github.com/yourusername/feather-code.git
cd feather-code
  1. 安装依赖:
pip install -r requirements.txt
  1. 设置认证:
export GITHUB_PAT=your_github_personal_access_token

使用

与 Claude 桌面端配合使用

将以下内容添加到你的 Claude 桌面端配置中:

{
"mcpServers": {
"feather-code": {
"command": "python3",
"args": ["/path/to/feather-code/feather_code.py"]
}
}
}

独立使用

在任何 Git 仓库中运行:

cd /your/github/repo
python3 /path/to/feather_code.py

✨ 主要特性

  • 🚀 15 个 GitHub 工具 - 全面覆盖 GitHub API。
  • 🔍 自动检测 - 自动从 Git 中检测仓库。
  • 🔐 灵活认证 - 支持个人访问令牌(PAT)、GitHub 应用和基于文件的令牌。
  • 📦 零配置 - 在任何 Git 仓库中开箱即用。
  • 符合 MCP 标准 - 基于官方 MCP SDK 构建。

📦 安装指南

快速安装(推荐)

  • Linux/macOS
curl -fsSL https://raw.githubusercontent.com/yourusername/feather-code/main/install.sh | bash
  • Windows
Invoke-WebRequest -Uri https://raw.githubusercontent.com/yourusername/feather-code/main/install.bat -OutFile install.bat
.\install.bat

手动安装

  1. 克隆仓库:
git clone https://github.com/yourusername/feather-code.git
cd feather-code
  1. 安装依赖:
pip install -r requirements.txt
  1. 设置认证:
export GITHUB_PAT=your_github_personal_access_token

💻 使用示例

基础用法

与 Claude 桌面端配合使用

将以下内容添加到你的 Claude 桌面端配置中:

{
"mcpServers": {
"feather-code": {
"command": "python3",
"args": ["/path/to/feather-code/feather_code.py"]
}
}
}

独立使用

在任何 Git 仓库中运行:

cd /your/github/repo
python3 /path/to/feather_code.py

📚 详细文档

可用工具

仓库管理

  • get_repository_info - 获取全面的仓库详细信息。
  • get_repository_languages - 获取仓库语言分布。
  • get_repository_topics - 获取仓库主题/标签。

问题管理

  • list_issues - 列出并过滤仓库问题。
  • create_issue - 创建带有标签的新问题。
  • update_issue - 更新现有问题。
  • get_issue - 获取详细的问题信息。
  • add_issue_comment - 为问题添加评论。

拉取请求管理

  • get_pull_requests - 列出并过滤拉取请求。
  • create_pull_request - 创建新的拉取请求。
  • get_pull_request - 获取详细的拉取请求信息。

代码与仓库

  • list_branches - 列出仓库分支。
  • get_commits - 按条件获取提交历史。
  • get_file_content - 读取仓库中的文件内容。
  • search_code - 在仓库中搜索代码。

认证方式

个人访问令牌(推荐)

  1. https://github.com/settings/tokens/new 创建一个令牌。
  2. 选择作用域:reporead:org(用于私有仓库)。
  3. 设置令牌:
export GITHUB_PAT=ghp_your_token_here

令牌文件

echo "ghp_your_token_here" > ~/.github_token
export GITHUB_PAT_FILE=~/.github_token

GitHub 应用(高级)

export GITHUB_APP_ID=123456
export GITHUB_INSTALLATION_ID=789012
export GITHUB_PRIVATE_KEY_PATH=/path/to/private-key.pem

配置

所有配置均通过环境变量完成:

属性 详情 默认值
GITHUB_OWNER 仓库所有者 从 Git 自动检测
GITHUB_REPO 仓库名称 从 Git 自动检测
GITHUB_PAT 个人访问令牌 -
GITHUB_PAT_FILE 令牌文件路径 -
GITHUB_APP_ID GitHub 应用 ID -
GITHUB_INSTALLATION_ID 应用安装 ID -
GITHUB_PRIVATE_KEY_PATH 应用私钥路径 -
GITHUB_API_URL GitHub API URL https://api.github.com

使用示例

创建问题

用户:创建一个标题为 "Bug: Login not working" 并带有 bug 标签的新问题
Claude:我将为你创建该问题。
[使用 create_issue 工具]
创建了问题 #123:"Bug: Login not working"

搜索代码

用户:查找所有包含 "authentication" 的文件
Claude:我将搜索包含 "authentication" 的文件。
[使用 search_code 工具]
找到 5 个包含 "authentication" 的文件:
- src/auth/login.py
- src/auth/middleware.py
...

开发

运行测试

python3 test_comprehensive.py
python3 validate_production_ready.py

从源代码构建

pip install -e .

故障排除

"Repository not detected"

  • 确保你处于一个带有 GitHub 远程仓库的 Git 仓库中。
  • 或者设置 GITHUB_OWNERGITHUB_REPO 环境变量。

"Authentication failed"

  • 检查你的 GitHub 令牌是否具有所需的作用域。
  • 确保令牌未过期。
  • 尝试使用个人访问令牌(PAT)而非 GitHub 应用认证。

"Tool not found"

  • 更新到最新版本。
  • 检查 Claude 桌面端是否已重新加载 MCP 配置。

📄 许可证

本项目采用 MIT 许可证,详情请参阅 LICENSE 文件。

👥 贡献

欢迎贡献代码!请按以下步骤操作:

  1. 分叉仓库。
  2. 创建功能分支。
  3. 进行更改。
  4. 提交拉取请求。

🛠️ 支持

  • 0 关注
  • 0 收藏,27 浏览
  • system 提出于 2025-09-27 04:48

相似服务问题

相关AI产品