Square Model Context Protocol Server

by square
Apache 2.0
157
44

Integrations

  • Enables integration with Apple Pay through Square's API, allowing for payment processing via Apple's payment platform.

  • Provides access to Square's complete API ecosystem, enabling interactions with services such as catalog management, customer management, payment processing, order management, inventory tracking, appointment booking, gift cards, loyalty programs, and many other Square business services.

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 访问令牌中的指南获取访问令牌。你也可以在运行命令之前设置环境变量。

配置选项

环境变量目的例子
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 服务器:

# 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中:

{ "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 文档,了解各项服务的详细信息:

服务描述
applepayApple Pay 集成
bankaccounts银行账户管理
bookingcustomattributes预订的自定义属性
bookings预约管理
cards支付卡管理
cashdrawers现金抽屉管理
catalog目录管理(项目、类别等)
checkout结账和付款处理
customercustomattributes客户的自定义属性
customergroups客户分组
customersegments客户细分
customers客户管理
devicesSquare设备管理
disputes付款纠纷处理
events事件追踪
giftcardactivities礼品卡活动追踪
giftcards礼品卡管理
inventory库存跟踪
invoices发票管理
labor劳动力管理
locationcustomattributes位置的自定义属性
locations位置管理
loyalty忠诚度计划管理
merchantcustomattributes商家自定义属性
merchants商户账户管理
oauth验证
ordercustomattributes订单的自定义属性
orders订单管理
payments付款处理
payouts付款管理
refunds退款管理
sites网站集成
snippetsSquare 在线代码集成
subscriptions订阅管理
team员工管理
terminalSquare 终端管理
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 规范自动生成。欢迎贡献代码,但请注意,修改需要合并到生成此代码的生成器中。请在提交拉取请求之前,先创建一个问题来讨论建议的修改。

You must be authenticated.

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

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

  1. Quick Start
    1. Configuration Options
      1. Integration with AI Assistants
        1. Goose Integration
        2. Claude Desktop Integration
      2. Tool Reference
        1. Service Catalog
          1. Usage Pattern
            1. Development and Debugging
              1. Using MCP Inspector
              2. Development Workflow
            2. Contributing

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that provides persistent task management capabilities for AI assistants, allowing them to create, update, and track tasks beyond their usual context limitations.
                Last updated -
                1
                TypeScript
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that connects AI assistants like Claude to Moneybird accounting software, enabling management of contacts, financial data, products, and business operations through natural language.
                Last updated -
                1
                JavaScript
                MIT License
                • Apple
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server enabling AI assistants to interact with Kong Konnect's API Gateway, providing tools to query analytics data, inspect configurations, and manage control planes through natural language.
                Last updated -
                10
                22
                TypeScript
                Apache 2.0
                • Apple
              • A
                security
                A
                license
                A
                quality
                A server implementing Model Context Protocol that enables AI assistants to interact with Slack API through a standardized interface, providing tools for messaging, channel management, user information retrieval, and more.
                Last updated -
                9
                18
                JavaScript
                Apache 2.0

              View all related MCP servers

              ID: sbtj6cl8kw