GitHub 扩展
🎥Plug & Play
Watch the demo
本教程介绍如何将 GitHub MCP 服务器 添加为 goose 扩展,以实现文件操作、仓库管理、搜索等功能。
快速安装
- goose Desktop
- goose CLI
添加 Remote Extension (Streamable HTTP) 扩展类型,并填写:
端点 URL
https://api.githubcopilot.com/mcp/
自定义请求头
Authorization: Bearer <YOUR_GITHUB_PERSONAL_ACCESS_TOKEN>
配置
这些步骤配置远程 MCP 服务器。其他部署方式见官方 GitHub MCP 服务器文档。
- goose Desktop
- goose CLI
- Launch the installer
- Click
Yesto confirm the installation - Get your GitHub Personal Access Token and paste it in
- Click
Add Extension - Click the button in the top-left to open the sidebar
- Navigate to the chat
- Run the
configurecommand:
goose configure
- Choose to add a
Remote Extension (Streamable HTTP).
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◆ What type of extension would you like to add?
│ ○ Built-in Extension
│ ○ Command-line Extension
│ ● Remote Extension (Streamable HTTP) (Connect to a remote extension via MCP Streamable HTTP)
└
- Give your extension a name.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Remote Extension (Streamable HTTP)
│
◆ What would you like to call this extension?
│ github
└
- Enter the Streamable HTTP endpoint URI.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Remote Extension (Streamable HTTP)
│
◇ What would you like to call this extension?
│ github
│
◆ What is the Streamable HTTP endpoint URI?
│ https://api.githubcopilot.com/mcp/
└
- Enter the number of seconds goose should wait for actions to complete before timing out. Default is
300seconds.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Remote Extension (Streamable HTTP)
│
◇ What would you like to call this extension?
│ github
│
◇ What is the Streamable HTTP endpoint URI?
│ https://api.githubcopilot.com/mcp/
│
◆ Please set the timeout for this tool (in secs):
│ 300
└
- Enter a description for this extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Remote Extension (Streamable HTTP)
│
◇ What would you like to call this extension?
│ github
│
◇ What is the Streamable HTTP endpoint URI?
│ https://api.githubcopilot.com/mcp/
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Enter a description for this extension:
│ GitHub 仓库管理与操作
└
- Add a custom header for this extension.
信息
获取你的 GitHub Personal Access Token,并将其作为
Bearer 令牌粘贴。┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Remote Extension (Streamable HTTP)
│
◇ What would you like to call this extension?
│ github
│
◇ What is the Streamable HTTP endpoint URI?
│ https://api.githubcopilot.com/mcp/
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◇ Enter a description for this extension:
│ GitHub 仓库管理与操作
│
◆ Would you like to add custom headers?
│ Yes
│
◇ Header name:
│ Authorization
│
◇ Header value:
│ Bearer ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
│
◇ Add another header?
│ No
│
└ Added github extension
使用示例
创建 GitHub Personal Access Token 时,我授予了以下权限:
- 仓库:goose-demo
- 元数据的读取权限
- 代码、提交状态、issue 和 pull request 的读写权限
goose 提示词
在我的 angiejones/goose-demo 仓库中创建一个名为 hello-world 的新分支。把 README.md 改成 “this was written by goose” 并提交。用你的更改打开一个 pull request。
goose 输出
我来帮你创建新分支、更新 README,并打开一个 pull request。步骤如下:
1. 首先,在你的仓库中创建名为 “hello-world” 的新分支
2. 然后更新 README.md 文件
3. 最后创建 pull request
开始执行:
1. 创建新分支:
─── create_branch | github ──────────────────────────
branch: hello-world
owner: angiejones
repo: goose-demo
2. 现在更新新分支中的 README.md:
─── create_or_update_file | github ──────────────────────────
branch: hello-world
content: this was written by goose
message: Update README.md with goose message
owner: angiejones
path: README.md
repo: goose-demo
3. 最后创建 pull request:
─── create_pull_request | github ──────────────────────────
base: main
body: ...
head: hello-world
owner: angiejones
repo: goose-demo
title: Update README.md
很好!我已完成所有请求的任务:
1. 创建了名为 “hello-world” 的新分支
2. 把 README.md 更新为 “this was written by goose”
3. 创建了 pull request,将这些更改合并到 main 分支
你可以在此查看 pull request:https://github.com/angiejones/goose-demo/pull/1
pull request 已可供你审阅。还需要我对它做些什么吗?