使用扩展
Extensions 是 goose 的附加能力。它们可以把你工作流里已经在使用的应用、服务和工具接入 goose,从而扩展 goose 的能力边界,让它能够访问更多数据、资源,或与其他系统协同工作。
扩展基于 Model Context Protocol (MCP),因此你可以把 goose 接到一个非常庞大的能力生态中。
goose 会在激活外部扩展前自动检查已知恶意软件。如果检测到恶意包,相关扩展会被阻止,并给出清晰的错误提示。
如果你想按步骤接入和使用具体的 goose 扩展,可以查看 MCP Servers 教程列表。
内置扩展
goose 自带了多种开箱即用的内置扩展:
- Developer:提供一组通用开发工具,适合软件开发工作流。默认启用
- Computer Controller:提供通用的计算机控制能力,适合网页自动化、文件缓存与自动化流程
- Memory:让 goose 在使用过程中逐步记住你的偏好
- Tutorial:提供交互式教程,帮助你学习 goose
- Auto Visualiser:在对话中自动生成图形化数据可视化内容
goose 默认具备较强自治能力。结合 Developer 扩展后,goose 可以在未经你逐次确认的情况下执行命令和修改文件。如果你希望更精细地控制这些行为,可以配置goose 权限模式、工具权限以及 .gooseignore 文件。简要概览可参考 Developer 扩展说明。
内置平台扩展
平台扩展也是内置扩展的一种,提供像会话搜索、任务跟踪和扩展管理这类全局能力。它们始终可用,也可以按需打开或关闭。
- Apps:创建、管理并以独立窗口方式启动自定义 HTML 应用
- Chat Recall:在全部历史会话中搜索对话内容
- Code Mode:执行 JavaScript 代码,用于工具发现和调用
- Extension Manager:在会话中动态发现、启用和停用扩展(默认启用)
- Summon:加载 skills 与 recipes,并把任务委派给 subagents(默认启用)
- Todo:管理任务列表,并跨会话追踪进度(默认启用)
- Top of Mind:在每轮对话时把持久指令注入 goose 的工作记忆
开关内置扩展
- goose Desktop
- goose CLI
- 点击左上角的 打开侧边栏。
- 点击侧边栏中的
Extensions。 - 在
Extensions区域中,可以直接打开或关闭内置扩展。
如果你已经知道想添加哪个扩展,可以直接运行:
goose mcp {name}
如果你想浏览可用扩展:
- 运行:
goose configure - 在菜单中选择
Add Extension,通过上下方向键选择后按Enter - 选择
Built-In Extension - 选择要启用的扩展
- 设置扩展 timeout(秒)
- 按
Enter
示例:添加内置扩展
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Built-in Extension
│
◇ Which built-in extension would you like to enable?
│ Auto Visualiser
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
└ Enabled Auto Visualiser extension
goose 自带的扩展本身也是 MCP servers。如果你希望把这些 MCP servers 提供给其他 agent 使用,也完全可以单独接入。
发现扩展
goose 提供了一个集中式扩展目录,你可以从中发现、安装并使用扩展。
即使某个扩展没有出现在官方目录中,你仍然可以把任何其他 MCP Server 接入 goose。
添加扩展
你可以通过扩展目录、CLI 或 UI 直接安装扩展。
如果你处在企业内网或 airgapped 环境中,而扩展无法激活,请查看Airgapped / Offline Environments。
MCP Servers
任何符合 MCP 规范的 server 都可以作为 goose 扩展安装。
可用的 MCP servers 也可以在 MCP Server Directory 中查找。
- goose Desktop
- goose CLI
- 点击左上角的 打开侧边栏。
- 点击侧边栏中的
Extensions。 - 在
Extensions区域点击Add custom extension。 - 在
Add custom extension弹窗中填写所需信息:- 如果需要环境变量,点击变量右侧的
Add Timeout字段用于设置 goose 等待这个扩展返回工具调用结果的最长时间
- 如果需要环境变量,点击变量右侧的
- 点击
Add
示例:添加 Knowledge Graph Memory MCP Server
- Type:
Standard IO - ID:
kgm-mcp(这个值可以按需自定义) - Name:
Knowledge Graph Memory(这个值可以按需自定义) - Description:
maps and stores complex relationships between concepts(这个值可以按需自定义) - Command:
npx -y @modelcontextprotocol/server-memory
- 运行:
goose configure
-
选择
Add Extension。 -
选择要添加的扩展类型:
Built-In Extension:使用 goose 自带的扩展Command-Line Extension:把本地命令或脚本作为扩展接入Remote Extension (Streamable HTTP):通过 Streamable HTTP 连接远程系统
-
按照你所选扩展类型完成后续提示。
示例:添加 Knowledge Graph Memory MCP Server
- Node
- Python
- Java
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Knowledge Graph Memory
│
◇ What command should be run?
│ npx -y @modelcontextprotocol/server-memory
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Would you like to add environment variables?
│ No
│
└ Added Knowledge Graph Memory extension
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Wikipedia Reader
│
◇ What command should be run?
│ uvx mcp-wiki
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Would you like to add environment variables?
│ No
│
└ Added Wikipedia Reader extension
Note: Java and Kotlin extensions are only support on Linux and macOS
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Spring Data Explorer
│
◇ What command should be run?
│ jbang -Dspring.profiles.active=dev org.example:spring-data-mcp:1.0.0
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Would you like to add environment variables?
│ Yes
│
◇ Environment variable name:
│ SPRING_DATASOURCE_URL
│
◇ Environment variable value:
│ jdbc:postgresql://localhost:5432/mydb
│
◇ Add another environment variable?
│ No
│
└ Added Spring Data Explorer extension
Deeplinks
Extensions 也可以通过 goose 的 deeplink 协议安装。URL 格式会根据扩展类型而变化:
- StandardIO
- Streamable HTTP
goose://extension?cmd=<command>&arg=<argument>&id=<id>&name=<name>&description=<description>
必填参数:
cmd:要执行的基础命令,必须是jbang、npx、uvx、goosed或docker之一arg:仅cmd类型使用。命令参数;如果有多个参数,可以重复写多个argtimeout:等待扩展响应的最长时间(秒)id:扩展的唯一标识name:扩展显示名称description:扩展功能简介
例如,npx -y @modelcontextprotocol/server-github 这条命令会对应到:
goose://extension?cmd=npx&arg=-y&arg=%40modelcontextprotocol/server-github&timeout=<timeout>&id=<id>&name=<name>&description=<description>
注意,npx 命令中的每个参数都必须单独作为一个 arg 传递。
goose://extension?url=<remote-streamable-http-url>&type=streamable_http&id=<id>&name=<n>&description=<description>
参数说明:
url:远程 Streamable HTTP server 的 URLtype:必须设置为streamable_httptimeout:等待扩展响应的最长时间(秒)id:扩展的唯一标识name:扩展显示名称description:扩展功能简介
例如,如果远程地址是 https://example.com/streamable,则 URL 编码后的 deeplink 类似这样:
goose://extension?url=https%3A%2F%2Fexample.com%2Fstreamable&type=streamable_http&timeout=<timeout>&id=<id>&name=<n>&description=<description>
deeplink 中的所有参数都必须做 URL 编码。例如空格要替换为 %20,@ 要替换为 %40。
Config Entry
对高级用户来说,也可以直接编辑配置文件(~/.config/goose/config.yaml),添加、删除或修改扩展:
extensions:
github:
name: GitHub
cmd: npx
args: [-y @modelcontextprotocol/server-github]
enabled: true
envs: { "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>" }
type: stdio
timeout: 300
启用 / 停用扩展
你可以随时启用或停用已安装扩展,既可以作为新会话的默认配置,也可以只调整当前会话使用的扩展。
为新会话设置默认扩展
对默认扩展的改动只会影响后续新会话,不会影响当前已经在运行的会话。
- goose Desktop
- goose CLI
- 点击左上角的 打开侧边栏。
- 点击侧边栏中的
Extensions。 - 用扩展旁边的开关来启用或停用它。
- 运行以下命令,打开 goose 配置:
goose configure - 选择
Toggle Extensions。 - 系统会列出当前已安装扩展。
- 按
space切换扩展状态,实心表示启用。
示例:
┌ goose-configure
│
◇ What would you like to configure?
│ Toggle Extensions
│
◆ enable extensions: (use "space" to toggle and "enter" to submit)
│ ◼ developer
│ ◻ fetch
└
在会话中途修改扩展
会话内修改扩展不会丢失当前对话,也不需要重新开始。中途启用或停用的扩展只作用于当前会话,不会改动新会话的默认配置。
- goose Desktop
- goose CLI
- 点击应用底部的 按钮。
- 用扩展旁边的开关来启用或停用它。
在交互式会话中,你可以通过 slash commands 动态添加扩展:
添加一个 stdio 扩展:
/extension npx -y @modelcontextprotocol/server-memory
添加一个内置扩展:
/builtin developer
自动启用的扩展
goose 的 Smart Extension Recommendation 系统会根据你的任务自动识别并建议合适的扩展。本节说明如何使用这套机制,以及它的能力边界。
当你提出一个任务时,goose 会先检查当前已启用的扩展及其工具是否足够完成请求。如果不够,它就会建议你安装或启用其他扩展。你也可以直接按扩展名字点名要求启用。
动态启用的扩展只会在当前会话中生效。若要跨会话保留,请参考启用 / 停用扩展。
自动检测
goose 会根据任务需求自动判断是否需要某个扩展。下面是一个示例:当对话中需要访问 PostgreSQL 数据库时,goose 会主动识别并启用数据库扩展。
- goose Desktop
- goose CLI
goose Prompt
Find all orders with pending status from our production database
goose Output
I'll help you search for available extensions that might help us interact with PostgreSQL databases.
🔍 Search Available Extensions
└─ Output ▼
I see there's a PostgreSQL extension available. Let me enable it so we can query your database.
🔧 Manage Extensions
└─ action enable
extension_name postgresql
The extension 'postgresql' has been installed successfully
Great! Now I can help you query the database...
goose Prompt
Find all orders with pending status from our production database
goose Output
I apologize, but I notice that I don't currently have access to your database. Let me search if there are any database-related extensions available.
─── search_available_extensions | platform ──────────────────────────
I see that there is a "postgresql" extension available. Let me enable it so I can help you query your database.
─── enable_extension | platform ──────────────────────────
extension_name: postgresql
■ goose would like to enable the following extension, do you approve?
| ● Yes, for this session
| ○ No
直接请求
goose 也支持显式启用某个扩展。也就是说,你可以直接告诉它要用哪个工具。
- goose Desktop
- goose CLI
更新扩展属性
goose 会依赖扩展属性来决定如何处理某个扩展。如果你想调整扩展的显示方式或运行行为,例如名称、timeout、环境变量等,就需要修改这些属性。
- goose Desktop
- 配置文件
- 点击左上角的 打开侧边栏
- 点击侧边栏里的
Extensions - 在目标扩展旁点击 按钮
- 在弹窗里编辑需要修改的属性
- 点击
Save Changes
- 找到 goose 的配置文件,例如 macOS 上的
~/.config/goose/config.yaml - 直接修改该扩展对应的属性并保存
删除扩展
你可以移除已经安装的扩展。
- goose Desktop
- 配置文件
- 点击左上角的 打开侧边栏
- 点击侧边栏里的
Extensions - 在目标扩展旁点击 按钮
- 在弹窗里点击
Remove Extension
删除前需要先把扩展停用。
-
运行:
goose configure -
选择
Remove Extension -
从列表中找到你要删除的扩展
-
按
space选中它,实心表示已选中┌ goose-configure
│
◇ What would you like to configure?
│ Remove Extension
│
◆ Select extensions to remove (note: you can only remove disabled extensions - use "space" to toggle and "enter" to submit)
│ ◼ fetch
└ -
按
Enter保存
带扩展启动会话
你可以直接在 CLI 启动一个“只在当前会话启用这些扩展”的定制 session。
- 这样做不会把扩展安装成永久配置
- 如果这些扩展本来就已经启用,就没必要重复加
内置扩展
要在启动会话时启用内置扩展,可以运行:
goose session --with-builtin "{extension_id}"
例如,要同时启用 Developer 和 Computer Controller:
goose session --with-builtin "developer,computercontroller"
或者写成:
goose session --with-builtin developer --with-builtin computercontroller
外部扩展
要在启动会话时启用外部扩展,可以运行:
goose session --with-extension "{extension command}" --with-extension "{another extension command}"
例如,要启用 Fetch 扩展:
goose session --with-extension "uvx mcp-server-fetch"
环境变量
有些扩展要求环境变量。你可以把它们直接写进命令:
goose session --with-extension "VAR=value command arg1 arg2"
例如,要启用 GitHub 扩展:
goose session --with-extension "GITHUB_PERSONAL_ACCESS_TOKEN=<YOUR_TOKEN> npx -y @modelcontextprotocol/server-github"
如果你用的是 npx 命令,需要本机先安装 Node.js。
通过 Streamable HTTP 启用远程扩展
要在启动会话时启用远程 Streamable HTTP 扩展,可以运行:
goose session --with-streamable-http-extension "{extension URL}" --with-streamable-http-extension "{another extension URL}"
例如:
goose session --with-streamable-http-extension "https://example.com/streamable"
在容器中运行扩展
goose 还支持通过 --container 参数,让扩展直接在 Docker 容器里运行,特别适合 devcontainer 工作流。具体做法见 在 Docker 容器中运行扩展。
开发扩展
goose 扩展建立在 MCP 之上。MCP 是一个标准协议,允许 AI 模型和 agent 安全连接本地或远程资源。如果你要自己开发扩展,可以从把扩展实现成 MCP server开始。
相关教程:
- 构建自定义扩展 - 创建一个基于 Python 的 MCP 扩展
- 构建 MCP Apps - 创建带交互界面的应用型扩展