Clover MCP Server

by ibraheem4
Verified

hybrid server

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

Integrations

  • Supports loading Clover OAuth credentials from .env files for secure configuration of the MCP server.

  • Allows installation and running of the Clover MCP server via npx commands, making it easy to deploy and integrate with the Clover API.

  • Used for development of the MCP server, with build processes that compile TypeScript code before deployment.

Clover MCP(模型上下文协议)服务器

使用 OAuth 身份验证与 Clover API 交互的最小 MCP 服务器。

概述

此 MCP 服务器允许生成式 AI 模型和其他客户端使用模型上下文协议 (MCP) 访问您的 Clover 商家数据。通过此集成,模型可以:

  • 检索商户信息
  • 列出库存物品
  • 列出订单
  • 访问单个商品和订单

快速入门

与 Claude AI 一起使用(推荐)

  1. 将其添加到您的 Claude MCP 设置中(通常在~/.config/anthropic/claude.mcp.json中):
{ "mcpServers": { "clover": { "command": "npx", "args": ["-y", "@ibraheem4/clover-mcp"], "env": { "CLOVER_CLIENT_ID": "your-clover-client-id", "CLOVER_CLIENT_SECRET": "your-clover-client-secret", "CLOVER_BASE_URL": "https://apisandbox.dev.clover.com" }, "disabled": false, "autoApprove": ["initiate_oauth_flow", "get_merchant_info", "list_inventory", "list_orders"] } } }
  1. 与 Claude 一起使用:
/mcp use clover
  1. 在与 Claude 的对话中启动 OAuth 流程:
Can you help me connect to my Clover account?

通过命令行使用

您可以直接运行 MCP 服务器:

# Install and run in one command npx @ibraheem4/clover-mcp # With credentials CLOVER_CLIENT_ID=your-client-id CLOVER_CLIENT_SECRET=your-client-secret npx @ibraheem4/clover-mcp

Clover OAuth 设置

在使用此 MCP 服务器之前,您需要设置一个 Clover 应用程序:

  1. developer.clover.com上创建Clover开发者帐户
  2. 在 Clover 开发者仪表板中注册新应用
  3. 使用以下配置来配置您的应用:
    • 网站网址: http://localhost:4000/oauth-callback
    • 默认 OAuth 响应: Code
  4. 记下您的客户端 ID 和客户端密钥
  5. 将这些凭据添加到您的环境或.env文件

MCP 工具

以下工具可通过 MCP 协议使用:

  • get_oauth_status :检查 OAuth 凭证是否可用
  • initiate_oauth_flow :启动 OAuth 流程以获取访问令牌
  • get_merchant_info :获取商家信息
  • list_inventory :列出带有可选过滤器的库存项目
  • list_orders :列出带有可选过滤器的订单

Claude 的示例用法

以下是连接后您可以与 Claude 一起使用的一些示例提示:

  1. 连接到 Clover
    I'd like to connect to my Clover account.
  2. 获取商户信息
    What information do you have about my Clover merchant account?
  3. 列出库存项目
    Show me the first 10 items in my inventory.
  4. 列出订单
    Can you list my most recent orders?

发展

本地安装

  1. 克隆此存储库
  2. 安装依赖项:
    npm install
  3. 设置您的 OAuth 凭据:
    cp .env.example .env # Edit .env with your Clover OAuth credentials
  4. 构建 TypeScript 代码:
    npm run build
  5. 启动 MCP 服务器:
    ./run.sh

发布更新

要将新版本发布到 npm:

# Update version in package.json npm version patch # or minor, or major # Build and publish npm run build npm publish

故障排除

如果您遇到 OAuth 问题:

  1. 验证您的 Clover 应用已正确注册
  2. 检查应用程序设置中的站点 URL 是否设置为http://localhost:4000/oauth-callback
  3. 确保您的客户端 ID 和客户端密钥正确
  4. 确保开发者仪表板中的“默认 OAuth 响应”设置为“代码”
  5. 尝试使用initiate_oauth_flow再次启动 OAuth 流程

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

使 AI 代理能够通过安全的 OAuth 认证 MCP 服务器访问并与 Clover 商家数据、库存和订单进行交互。

  1. Overview
    1. Quick Start
      1. Using with Claude AI (Recommended)
      2. Using via Command Line
    2. Clover OAuth Setup
      1. MCP Tools
        1. Example Usage with Claude
          1. Development
            1. Local Installation
            2. Publishing Updates
          2. Troubleshooting
            1. License
              ID: pfh59dosg1