Square MCP 扩展
🎥 Square MCP 服务器视频演示
本教程帮助你开始使用 Square MCP 服务器,对 Square 商家账号进行交互式和自动化操作。Square MCP 服务器是一个开源项目,让你通过 goose 与 Square API 交互。
Square 提供两个版本的 MCP 服务器:
- 远程 MCP 服务器,由 Square 托管。它使用 OAuth 认证,并允许对 API 使用做细粒度权限控制。
- 本地 MCP 服务器,可以在自己的机器上运行。它使用访问令牌认证,并允许完整的 API 访问。
信息
运行安装命令需要系统已安装 Node.js,这些命令会用到 npx。
配置
- Square Remote MCP
- Square Local MCP
快速安装
- goose Desktop
- goose CLI
命令
npx mcp-remote https://mcp.squareup.com/sse
- goose Desktop
- goose CLI
- 启动安装程序
- 点击
OK确认安装 - goose 应会打开一个浏览器标签页,进入 OAuth 权限页面。仔细核对你要允许的权限,然后点击
Grant Access。 - 系统会要求你登录或重新认证 Square,并可能要求你确认要允许的权限。
- 在 goose 中进入聊天
- Run the
configurecommand:
goose configure
- Choose to add a
Command-line Extension.
┌ 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 (Run a local command or script)
│ ○ Remote Extension (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?
│ Command-line Extension
│
◆ What would you like to call this extension?
│ square-mcp-remote
└
- Enter the command to run when this extension is used.
┌ 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?
│ square-mcp-remote
│
◆ What command should be run?
│ npx mcp-remote https://mcp.squareup.com/sse
└
- 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?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ square-mcp-remote
│
◇ What command should be run?
│ npx mcp-remote https://mcp.squareup.com/sse
│
◆ 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?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ square-mcp-remote
│
◇ What command should be run?
│ npx mcp-remote https://mcp.squareup.com/sse
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Enter a description for this extension:
│ undefined
└
- Choose
Nowhen asked to add environment variables.
┌ 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?
│ square-mcp-remote
│
◇ What command should be run?
│ npx mcp-remote https://mcp.squareup.com/sse
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◇ Enter a description for this extension:
│ undefined
│
◆ Would you like to add environment variables?
│ No
│
└ Added square-mcp-remote extension
下次开始会话时,goose 会打开浏览器,让你授予权限并登录 Square 账号。
快速安装
- goose Desktop
- goose CLI
命令
npx square-mcp-server start
环境变量
ACCESS_TOKEN: <YOUR_API_KEY>
SANDBOX: <true/false>
PRODUCTION: <true/false>
注意:使用 SANDBOX 或 PRODUCTION 其中之一,不要同时使用。ACCESS_TOKEN 应是沙箱令牌或生产令牌,与你选择的环境一致。
- goose Desktop
- goose CLI
- Launch the installer
- Click
Yesto confirm the installation - Get your Square Access Token and paste it in
Set either SANDBOX or PRODUCTION to true (the access token must match the environment) - 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
Command-line Extension.
┌ 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 (Run a local command or script)
│ ○ Remote Extension (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?
│ Command-line Extension
│
◆ What would you like to call this extension?
│ square-mcp
└
- Enter the command to run when this extension is used.
┌ 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?
│ square-mcp
│
◆ What command should be run?
│ npx square-mcp-server start
└
- 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?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ square-mcp
│
◇ What command should be run?
│ npx square-mcp-server start
│
◆ 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?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ square-mcp
│
◇ What command should be run?
│ npx square-mcp-server start
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Enter a description for this extension:
│ undefined
└
- Add environment variables for this extension.
信息
Obtain your Square Access Token and paste it in. Set either
SANDBOX or PRODUCTION to true (the access token must match the environment)┌ 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?
│ square-mcp
│
◇ What command should be run?
│ npx square-mcp-server start
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◇ Enter a description for this extension:
│ undefined
│
◆ Would you like to add environment variables?
│ Yes
│
◇ Environment variable name:
│ ACCESS_TOKEN
│
◇ Environment variable value:
│ ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪
│
◇ Add another environment variable?
│ Yes
│
◇ Environment variable name:
│ SANDBOX
│
◇ Environment variable value:
│ true
│
◇ Add another environment variable?
│ No
│
└ Added square-mcp extension
使用示例
Square MCP 服务器让你通过庞大的服务目录与 Square 的 Connect API 交互,从而访问 Square API 生态。
goose 提示词
( O)> 从下面这张图片找出我的食物菜单,并导入我的 Square 商家账号。"my-burger-menu.png"
goose 输出
我来帮你把这些菜单项导入 Square 目录。我会用 Square API 为每个汉堡创建目录商品。步骤如下:
1. 先查看目录 API 的服务信息和类型
2. 再为每个汉堡创建目录商品
现在查看创建目录对象所需的类型信息
接下来用目录 API 逐个为菜单里的汉堡创建目录商品:
(输出已截断)
我已经成功把菜单里的所有汉堡创建到你的 Square 目录中。每个汉堡都包含:
- 菜单上的准确名称
- 完整描述
- 正确价格
- 用于下单的标准变体
创建内容摘要:
- The Classic - $10.00
- Cheeseburger - $11.00
- Primetime Burger - $12.00
- Double Bacon - $14.00
- Texas Meatlover - $12.50
- Buffalo Burger - $12.00
- The Atomic - $12.50
- Little Bird - $11.00
- Mushroom Burger - $10.00
所有商品现在都在你的 Square 目录中,可以在销售点系统里使用。每个汉堡都带有完整描述,并有一个价格已指定的 "Regular" 变体。商品默认既可销售也可库存管理,且在所有门店可用。