Skip to main content
Glama

Square Model Context Protocol Server

Official
by square

Square 模型上下文协议服务器(测试版)

该项目遵循模型上下文协议标准,允许AI助手与Square的连接API进行交互。

快速入门

使用 npx 启动并运行 Square MCP 服务器:

# Basic startup npx square-mcp-server start # With environment configuration ACCESS_TOKEN=YOUR_SQUARE_ACCESS_TOKEN SANDBOX=true npx square-mcp-server start # local runs npx /path/to/project/square-mcp-server

YOUR_SQUARE_ACCESS_TOKEN替换为你实际的 Square 访问令牌。你可以按照Square 访问令牌中的指南获取访问令牌。你也可以在运行命令之前设置环境变量。

远程 MCP 服务器

Square 现在提供托管的远程 MCP 服务器:

https://mcp.squareup.com/sse

建议使用远程 MCP,因为它使用 OAuth 身份验证,允许您直接使用 Square 帐户登录,而无需手动创建或管理访问令牌。

配置选项

环境变量

目的

例子

ACCESS_TOKEN

您的 Square API 访问令牌

ACCESS_TOKEN=sq0atp-...

SANDBOX

使用 Square 沙盒环境

SANDBOX=true

PRODUCTION

使用 Square 生产环境

PRODUCTION=true

DISALLOW_WRITES

限制为只读操作

DISALLOW_WRITES=true

SQUARE_VERSION

指定 Square API 版本

SQUARE_VERSION=2025-04-16

与人工智能助手集成

鹅集成

要使用Goose配置 Square MCP 服务器:

远程 MCP

要在 Goose 中安装 Square 远程 MCP,请在安装了 Goose 的计算机上单击此 URL:

goose://extension?cmd=npx&arg=mcp-remote&arg=https%3A%2F%2Fmcp.squareup.com%2Fsse&id=square_mcp_production_remote&name=Square%20MCP%20Remote&description=Square%20Production%20MCP%20Remote

或者将 URL 复制并粘贴到浏览器的地址栏中。

# Automatic installation npx square-mcp-server install # Get URL for manual installation npx square-mcp-server get-goose-url

install命令会自动更新您的 Goose 配置。

Claude 桌面集成

对于 Claude Desktop 集成,请参阅模型上下文协议快速入门指南。将此配置添加到您的claude_desktop_config.json中:

远程 MCP

{ "mcpServers": { "mcp_square_api": { "command": "npx", "args": ["mcp-remote", "https://mcp.squareup.com/sse"] } } }

这种方法允许您直接使用 Square 帐户凭据进行身份验证,而无需管理访问令牌。

本地 MCP

{ "mcpServers": { "mcp_square_api": { "command": "npx", "args": ["square-mcp-server", "start"], "env": { "ACCESS_TOKEN": "YOUR_SQUARE_ACCESS_TOKEN", "SANDBOX": "true" } } } }

工具参考

Square MCP 服务器提供了一套简化的工具用于与 Square API 交互:

工具

描述

主要用途

get_service_info

发现可用于服务的方法

探索与发现

get_type_info

获取详细参数要求

请求准备

make_api_request

执行 Square 的 API 调用

执行操作

服务目录

Square MCP 服务器提供对 Square 完整API 生态系统的访问。查看Square API 文档,了解各项服务的详细信息:

服务

描述

applepay

Apple Pay 集成

bankaccounts

银行账户管理

bookingcustomattributes

预订的自定义属性

bookings

预约管理

cards

支付卡管理

cashdrawers

现金抽屉管理

catalog

目录管理(项目、类别等)

checkout

结账和付款处理

customercustomattributes

客户的自定义属性

customergroups

客户分组

customersegments

客户细分

customers

客户管理

devices

Square设备管理

disputes

付款纠纷处理

events

事件追踪

giftcardactivities

礼品卡活动追踪

giftcards

礼品卡管理

inventory

库存跟踪

invoices

发票管理

labor

劳动力管理

locationcustomattributes

位置的自定义属性

locations

位置管理

loyalty

忠诚度计划管理

merchantcustomattributes

商家自定义属性

merchants

商户账户管理

oauth

验证

ordercustomattributes

订单的自定义属性

orders

订单管理

payments

付款处理

payouts

付款管理

refunds

退款管理

sites

网站集成

snippets

Square 在线代码集成

subscriptions

订阅管理

team

员工管理

terminal

Square 终端管理

vendors

供应商管理

webhooksubscriptions

事件通知

使用模式

为了通过 MCP 与 Square API 实现最佳交互:

  1. 发现:使用get_service_info探索可用的方法

    get_service_info(service: "catalog")
  2. 理解:使用get_type_info了解参数要求

    get_type_info(service: "catalog", method: "list")
  3. 执行:使用make_api_request执行操作

    make_api_request(service: "catalog", method: "list", request: {})

开发与调试

使用 MCP 检查器

MCP Inspector提供了一个可视化的测试界面:

# Build the project npm run build # Start the inspector with the Square MCP Server npx @modelcontextprotocol/inspector node dist/index.js start

开发工作流程

  1. 克隆存储库

  2. 安装依赖项: npm install

  3. 启动开发模式: npm run watch

  4. 运行服务器: node dist/index.js start

  5. 使用 MCP 检查器测试您的更改

贡献

此代码库根据 Square 的 OpenAPI 规范自动生成。欢迎贡献代码,但请注意,修改需要合并到生成此代码的生成器中。请在提交拉取请求之前,先创建一个问题来讨论建议的修改。

Deploy Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

使 AI 助手能够通过模型上下文协议标准与 Square 的 Connect API 进行交互,从而实现管理客户、处理付款和处理库存等操作。

  1. 快速入门
    1. 远程 MCP 服务器
      1. 配置选项
        1. 与人工智能助手集成
          1. 鹅集成
          2. Claude 桌面集成
        2. 工具参考
          1. 服务目录
            1. 使用模式
              1. 开发与调试
                1. 使用 MCP 检查器
                2. 开发工作流程
              2. 贡献

                Related MCP Servers

                • A
                  security
                  F
                  license
                  A
                  quality
                  Implements the Model Context Protocol to allow AI models to access and interact with blockchain data, including reading contract states, retrieving events, and accessing transaction information across various networks.
                  Last updated -
                  10
                  65
                  64
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server implementation that enables AI assistants to interact with Linear project management systems, allowing them to create, retrieve, and modify data related to issues, projects, teams, and users.
                  Last updated -
                  8
                  3
                • -
                  security
                  F
                  license
                  -
                  quality
                  Enables AI models to interact with Linear for issue tracking and project management through the Model Context Protocol, supporting capabilities like creating issues, searching, managing sprints, and bulk updating statuses.
                  Last updated -
                  5
                • -
                  security
                  A
                  license
                  -
                  quality
                  Enables AI assistants to interact with Slack workspaces through the Model Context Protocol, providing tools for reading/sending messages, managing channels, and accessing Slack API functionality.
                  Last updated -
                  1
                  MIT License

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/square/square-mcp-server'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server