Sample Shop MCP server

Sample shop MCP server: paginated search, idempotent orders, guarded cancellation. Four languages.

我该使用它吗

质量与安全性

A
描述质量
95%
模式完整度
98%
命名质量
100%
投毒风险
100%
权限匹配度
100%
协议合规性
100%

基于对工具定义和协议合规性的自动分析。

上下文开销

~697token 数(工具定义)
~1.1 KB典型响应大小
对注意力有中等影响(占 128k 上下文窗口的 0.54%)

这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。

安装

一键安装

将以下内容添加到你的 `claude_desktop_config.json` 文件中:

{
  "mcpServers": {
    "sample-shop-mcp": {
      "command": "npx",
      "args": [
        "@apitoagents/sample-shop-mcp"
      ]
    }
  }
}

可运行的软件包

npm@apitoagents/sample-shop-mcp1.0.1stdio

远程端点

https://demo.apitoagents.com/mcpstreamable-http

它能做什么

工具清单

工具(4)

🟢 只读🟡 写入🔴 删除⚪ 未知
🟢search_products(query, category, limit, cursor)

Search the shop catalogue by phrase and optional category. Returns one page of up to `limit` products and a `nextCursor`; when nextCursor is not null, more results exist and you must say so rather than claiming the list is complete. Use get_product for full details of one item. This tool does not place orders.

输入模式

{
  "type": "object",
  "properties": {
    "query": {
      "description": "Words to match against product names and descriptions.",
      "type": "string",
      "maxLength": 100
    },
    "category": {
      "description": "Restrict results to one category.",
      "type": "string",
      "enum": [
        "lighting",
        "furniture",
        "kitchen"
      ]
    },
    "limit": {
      "default": 5,
      "description": "Page size.",
      "type": "integer",
      "minimum": 1,
      "maximum": 20
    },
    "cursor": {
      "description": "Opaque token from a previous page's nextCursor. Never invent one.",
      "type": "string"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
🟢get_product(productId)

Return the full details of one product by its id (for example p-1001). Use search_products first if you only know a name.

输入模式

{
  "type": "object",
  "properties": {
    "productId": {
      "type": "string",
      "description": "The product id from search_products."
    }
  },
  "required": [
    "productId"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
🟡create_order(productId, quantity, idempotencyKey)

Place an order for one product. Generate one random idempotencyKey per user request and reuse the same key if you retry after an error or timeout; the shop returns the original order instead of creating a duplicate. Confirm product and quantity with the user before calling. Returns the order with its id, status and total.

输入模式

{
  "type": "object",
  "properties": {
    "productId": {
      "type": "string",
      "description": "Product id from search_products or get_product."
    },
    "quantity": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10,
      "description": "Units to order, 1 to 10."
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128,
      "description": "A unique key you generate for this order attempt and reuse on retry."
    }
  },
  "required": [
    "productId",
    "quantity",
    "idempotencyKey"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
🔴cancel_order(orderId, confirm)

Cancel an order that has not shipped. This cannot be undone. Call it first with confirm=false to get the order details, show them to the user, and only after the user explicitly agrees call again with confirm=true.

输入模式

{
  "type": "object",
  "properties": {
    "orderId": {
      "type": "string",
      "description": "The order id, for example o-5001."
    },
    "confirm": {
      "default": false,
      "description": "Set true only after the user has explicitly confirmed the cancellation.",
      "type": "boolean"
    }
  },
  "required": [
    "orderId"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}

社区

评价此服务器

证据

最近观测

已验证未记录版本4 个工具