← 返回
未分类 Key 中文

Store Mcp Connect

Connect an AI agent to a Mobazha store via MCP (Model Context Protocol). Use when the user wants their agent to directly manage store products, orders, and s...
通过 MCP(模型上下文协议)将 AI 代理连接到 Mobazha商店。用于当用户希望其代理直接管理店铺产品、订单等。
fengzie
未分类 clawhub v0.2.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 398
下载
💾 0
安装
1
版本
#latest

概述

Connect AI Agent to Your Store (MCP)

Connect your AI coding agent to your Mobazha store via MCP (Model Context Protocol). Once connected, your agent can directly manage products, orders, messages, and more.

> This skill requires credentials. The agent needs an API token from your store to connect. The agent must ask for your explicit consent before initiating any connection to your store. Tokens should be stored in environment variables, never committed to source control.

What You Get

After connecting, your AI agent has access to 30+ store management tools:

CategoryToolsWhat They Do
------------------------------
Productslistings_create, listings_update, listings_delete, listings_list_mine, listings_import_jsonFull product CRUD + bulk import
Ordersorders_get_sales, orders_confirm, orders_fulfill, orders_refundOrder lifecycle
Chatchat_get_conversations, chat_send_messageBuyer communication
Discountsdiscounts_create, discounts_update, discounts_deletePromotions
Collectionscollections_create, collections_add_productsProduct organization
Profileprofile_get, profile_updateStore identity
Notificationsnotifications_list, notifications_mark_readActivity feed
Searchsearch_listings, search_profilesMarketplace discovery
Financeexchange_rates_get, wallet_get_receiving_accounts, fiat_get_providersPayments and rates

Connection Method: SSE (Recommended)

All Mobazha deployments include a built-in MCP SSE endpoint. This is the recommended method because:

  • No additional binary to install or maintain
  • Tools are always up-to-date with your store version
  • Works with Claude Code, Cursor, Codex, and all modern AI agents

SSE Endpoint

DeploymentSSE URL
---------------------
SaaShttps://app.mobazha.org/platform/v1/mcp/sse
Standalone (custom domain)https://shop.example.com/platform/v1/mcp/sse
Standalone (local Docker)http://localhost/platform/v1/mcp/sse
Native install (local)http://localhost:5102/platform/v1/mcp/sse
Native install (VPS)http://:5102/platform/v1/mcp/sse

Step 1: Get Your API Token

SaaS Store

  1. Log in to your store at app.mobazha.org
  2. Go to Settings > API
  3. Click Generate Token
  4. Copy the token

Standalone Store (Docker with domain)

Open your store's admin panel in a browser and generate a token via Settings > API, or via curl:

curl -X POST https://shop.example.com/platform/v1/auth/tokens \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "<your-admin-password>"}'

Native Install (local or VPS)

The default gateway port for native installs is 5102:

curl -X POST http://localhost:5102/platform/v1/auth/tokens \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "<your-admin-password>"}'

For a VPS, replace localhost with your server's IP or use an SSH tunnel:

ssh -L 5102:localhost:5102 root@<vps-ip>
# Then use http://localhost:5102 from your local machine

Step 2: Configure Your AI Agent

Claude Code

Add to ~/.claude.json (or project-level .mcp.json):

{
  "mcpServers": {
    "mobazha-store": {
      "type": "sse",
      "url": "https://shop.example.com/platform/v1/mcp/sse",
      "headers": {
        "Authorization": "Bearer <your-token>"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "mobazha-store": {
      "url": "https://shop.example.com/platform/v1/mcp/sse",
      "headers": {
        "Authorization": "Bearer <your-token>"
      }
    }
  }
}

Or go to Settings > MCP Servers > Add Server and enter the SSE URL.

Codex CLI

codex mcp add mobazha-store --transport sse \
  --url "https://shop.example.com/platform/v1/mcp/sse" \
  --header "Authorization: Bearer <your-token>"

OpenCode

Add to opencode.json:

{
  "mcp": {
    "mobazha-store": {
      "type": "sse",
      "url": "https://shop.example.com/platform/v1/mcp/sse",
      "headers": {
        "Authorization": "Bearer <your-token>"
      }
    }
  }
}

> Replace https://shop.example.com with your actual store URL from the table above.


Step 3: Verify the Connection

Ask your AI agent:

> "List my store's products" or "Show my recent orders"

The agent should call listings_list_mine or orders_get_sales and return results. If it works, the connection is live.

For a guide on what you can do with MCP tools, see the store-management skill.


Advanced: stdio Transport

For environments where SSE is not supported by the AI agent, or for air-gapped setups, a mobazha-mcp stdio binary is available. It ships with the standalone Docker image and native install.

When to Use stdio

  • Your AI agent doesn't support SSE MCP transport
  • Air-gapped or restricted network environment
  • Development/debugging of the MCP layer itself

Using stdio from Standalone Docker

The binary is bundled in the container:

docker exec -it <container> mobazha-mcp --gateway-url http://localhost:5102 --token <token>

stdio CLI Reference

FlagEnv VariableDefaultDescription
-----------------------------------------
--gateway-urlMOBAZHA_GATEWAY_URLhttp://localhost:5102Store gateway URL
--tokenMOBAZHA_TOKEN(required)Bearer token
--search-urlMOBAZHA_SEARCH_URL(optional)Marketplace search API URL

stdio Agent Configuration

{
  "mcpServers": {
    "mobazha-store": {
      "command": "mobazha-mcp",
      "args": ["--gateway-url", "http://localhost:5102"],
      "env": {
        "MOBAZHA_TOKEN": "<your-token>"
      }
    }
  }
}

Troubleshooting

"connection refused" or timeout

  • Native install: verify the store is running with curl http://localhost:5102/healthz
  • Standalone Docker: the SSE endpoint is at port 80/443 (not 5102), try curl http://localhost/healthz
  • For remote stores, check that the domain resolves and HTTPS is configured

"401 Unauthorized"

  • Verify the token: curl -H "Authorization: Bearer " http://localhost:5102/v1/profiles
  • Token may have expired — generate a new one
  • Ensure the token has the required scopes for the tools you want to use

"tool not found"

  • search_listings and search_profiles require the marketplace search service
  • Some tools require specific scopes on the API token (e.g., listings:write for listings_create)

Credential Safety

  • Never hardcode tokens in source code or config files committed to git
  • Store the token in environment variables or a secrets manager
  • Add MCP config files to .gitignore if they contain tokens
  • Tokens can be revoked and regenerated at any time from the store admin panel
  • The agent must never log, display, or transmit tokens to any party other than the target store endpoint

版本历史

共 1 个版本

  • v0.2.0 当前
    2026-05-03 10:34 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Mobazha Product Image Prompt

fengzie
为产品摄影、品牌形象和营销视觉创作有效的AI图像生成提示。适用于需要产品图、生活场景等。
★ 0 📥 470

Store Onboarding

fengzie
完成新 Mobazha 店铺的首次设置向导,配置管理员密码、店铺名称、货币及资料。
★ 0 📥 420

Using Mobazha

fengzie
Mobazha 技能的入口,提供可用技能概览并根据用户意图引导 AI 代理加载相应技能。
★ 0 📥 474