Kapruka MCP

com.kapruka由 kapruka.com 发布官方发布者v0.9.0更新于 Oct 24, 2026

Free public MCP server for Kapruka.com — Sri Lanka's largest e-commerce platform.

已验证Streamable HTTP可网页运行效率与工作流商业与电商

概览

AI 生成的概览

让助手搜索 Kapruka.com 商品、查配送、创建订单并追踪发货。

可以做什么
该服务器把 Kapruka.com 的电商功能封装成工具,让助手列出分类、按关键词搜索商品、获取单个商品详情,并查询可配送城市与配送费用。它还能创建免注册的访客订单并返回付款链接、按订单号追踪配送进度,以及把 1 到 4 件商品合成一张可分享的 JPEG 卡片。另有工具列出可寄送国际礼品的国家及该国商店的全部商品。
适用场景
当用户想在 Kapruka.com 上找商品、查价格与库存、确认可配送城市与日期,或创建并追踪订单时适用;也适合需要把商品整理成可分享图片卡片的聊天销售场景。
运行要求
远程端点,无需在本机安装软件包;输入未声明任何认证、环境变量或请求头。
安装前请注意
创建订单会产生实际购买与付款链接,完成付款前应由用户确认购物车、收件人与配送信息。追踪订单只需订单号,应避免在公开场合泄露。商品与配送数据来自第三方电商平台。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Kapruka MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/com.kapruka%2Fkapruka-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "kapruka": {
      "type": "http",
      "url": "https://mcp.kapruka.com/mcp"
    }
  }
}

README

Kapruka MCP Server

Python MCP server that wraps the Kapruka.com REST API and exposes it as tools for LLMs and third-party MCP clients.

Setup

bash
# 1. Create and activate a virtual environmentpython -m venv .venvsource .venv/bin/activate   # Windows: .venv\Scripts\activate
# 2. Install dependenciespip install -e ".[dev]"
# 3. Configure environmentcp .env.example .env# Edit .env with your Kapruka API URL and key

Running

bash
# Start the MCP server (streamable HTTP, default port 8000)python cli.py server
# Start with stdio transport (for use with MCP Inspector)python cli.py server --stdio
# Health-check the Kapruka REST APIpython cli.py ping
# List registered MCP toolspython cli.py tools

Testing with MCP Inspector

bash
npx @modelcontextprotocol/inspector python cli.py server --stdio

Project Structure

src/  server.py        # FastMCP server entry point  tools/           # One module per tool group (products, orders, …)  api/    client.py      # Async httpx client + error handling  config/    settings.py    # Env-based configurationtests/             # pytest test suitecli.py             # Developer CLI

Trusted partners

First-party callers that can't be IP-allowlisted (e.g. Kapruka's web assistant on Cloudflare Workers) authenticate with an X-Partner-Key header instead, with optional per-customer limits via X-Partner-Customer-Id. Configured with PARTNER_KEYS / PARTNER_SCOPES / PARTNER_LIMITS. See docs/PARTNER_ACCESS.md and the deploy steps in deploy/README.md.

Running Tests

bash
pytest

来源:README.md,提交 31a3556

工具

10

kapruka_list_categories

List Kapruka Product Categories

List top-level Kapruka product categories by name with browse URLs. Returns the site's NAVIGATION categories plus the public Kapruka.com URL for each category landing page — useful for sending a customer to a category to browse. These names are NOT search filters. kapruka_search_products filters on search facets, a different vocabulary (e.g. navigation 'Electronic' vs facet 'Electronics', 'Cakes' vs 'Kapruka Cakes'); every search response lists its valid facet names under facets.categories. Use those for `category`, never these. Internal IDs and product counts are not exposed. Results are cached for 30 minutes server-side. Args: params (ListCategoriesInput): - depth (int): Sub-category levels to include, 1 or 2 (default 1) - response_format (str): 'markdown' (default) or 'json' Returns: str: Category tree in the requested format. JSON schema: { "categories": [ { "name": str, "url": str, # kapruka.com category landing page "children": [{"name": str, "url": str, "children": [...]}] } ] } Error: "Error: <message>" on failure.

输入参数params必填

kapruka_get_product

Get Kapruka Product Details

Fetch full details for a single Kapruka product by its product ID. Returns name, description, price (with optional currency conversion), stock status, images, variants, shipping info, delivery scope, and a direct product URL. `economy_delivery` ("optional" | "only" | "only_5to7" | null) says whether the item can go by the cheaper economy courier; kapruka_check_delivery with the cart says whether an order is offered it. International gift store products carry `international_gift` {"country", "orderable", "store_url"}: they are delivered IN that country by Kapruka's partner (see kapruka_gift_countries), not in Sri Lanka. Discounts: `price` is what checkout charges, with any website discount already applied; `compare_at_price` is the pre-discount price when one applies (null otherwise). Each variant carries its own pair. Quote `price`. Delivery scope: most gifts ship island-wide, but restaurant food, hotel cakes and liquor only reach a limited city set (typically the Colombo area). The `delivery` object is the authority — search results do NOT carry it. When `delivery.island_wide` is false, tell the customer up front that the item is delivered only to selected cities, and confirm their city with kapruka_check_delivery(city, product_id) before promising anything. If `deliverable_city_count` exceeds the returned list, the list is truncated — say "and more", don't treat it as complete. Note: Some IDs starting with 'CATSYM' are category landing pages, not purchasable products — this tool will flag those clearly. Args: params (GetProductInput): - product_id (str): Kapruka product ID (e.g. 'cakeXX000000') - currency (str): Price currency — LKR (default), USD, GBP, AUD, EUR - type (Optional[str]): Optional type hint (e.g. 'specialgifts') - response_format (str): 'markdown' (default) or 'json' Returns: str: Product

输入参数params必填

kapruka_search_products

Search Kapruka Products

Search for products on Kapruka.com by keyword, with optional category filter and pagination. Returns a ranked list of matching products with prices, stock status, images, and URLs, plus the category facets available for the query (facets.categories) — the names that work in `category` to narrow the same search. Supports cursor-based pagination — pass next_cursor from one response into the next call. Pagination is capped at 3 pages per query to discourage catalog enumeration; for broader discovery, refine the query or narrow with a facet instead. Queries must be at least 3 characters and contain specific terms — pure stopword queries (e.g. "the", "a an") are rejected. Relevance: the API matches ANY single query word, so extra words add loosely related results rather than narrowing. Search the thing the customer wants (the head noun) and check the product names actually contain it before presenting them. Prices and min_price/max_price are both in `currency` — pass the customer's own budget in their own currency; do not convert it. Gifts for recipients OUTSIDE Sri Lanka are not in this search: use kapruka_gift_countries / kapruka_gift_country_products. A row's `price` is the discounted price checkout charges (the bounds filter on it); `compare_at_price` is set when on sale. Search results carry NO delivery-scope information. Food, hotel cakes and liquor are delivered only to selected cities — never infer deliverability from a search hit. Before quoting delivery on a specific item, call kapruka_get_product (read `delivery.island_wide`) or kapruka_check_delivery with `product_id`. Args: params (SearchProductsInput): - q (str): Search query (e.g. 'birthday cake', 'roses', 'tea gift'). Min 3 chars. - category (Optional[str]): A facet name from a previous search's facets.categories - limit (int): Results per page, 1–50 (default 10) -

输入参数params必填

kapruka_create_order

Create Kapruka Order (Guest Checkout)

Create a guest-checkout order on Kapruka and return a click-to-pay link. Builds a Kapruka order from the supplied cart + recipient + delivery + sender, then returns a checkout URL the customer opens in a browser to complete payment. No Kapruka account is required. Prices are locked for the lifetime of the link (60 minutes) — the customer pays exactly the quoted grand total even if the catalog price changes meanwhile. Free public tier limits: 30 orders per hour per client IP. Cart up to 30 items, quantity up to 99 per item. A fresh idempotency key is generated per call so retries on transient errors return the same checkout URL rather than duplicates. Args: params (CreateOrderInput): - cart (list[CartItem]): 1–30 lines. Catalogue line: product_id, quantity (default 1), optional icing_text (cakes only). Custom cake line: custom_cake_request_id + phone — orders the cake Kapruka staff quoted via kapruka_custom_cake_status (status must be 'quoted'; quantity is always 1; never send a price). Lines can be mixed in one order — one delivery fee covers everything; the whole cart must be deliverable to delivery.city. Only place a custom cake order after the customer clearly accepted the quoted total. - recipient (Recipient): name + phone (E.164 +9477… or local 077…) - delivery (Delivery): address, city (must be Kapruka-deliverable — use kapruka_list_delivery_cities), location_type (house/apartment/office/other, default house), date (YYYY-MM-DD, today-or-future Asia/Colombo), optional instructions, type ('standard' default | 'economy') - sender (Sender): name + anonymous flag - gift_message (Optional[str]): Up to 300 chars - currency (str): LKR (default), USD, GBP, AUD, EUR - response_format (str): 'markdown' (default) or 'json' Returns: str: Order confirmation with c

输入参数params必填

kapruka_track_order

Track Kapruka Order

Look up status and delivery progress for a Kapruka order by order number. Returns current status (received / confirmed / out-for-delivery / delivered / cancelled), the recipient and delivery details on file, a timestamped progress timeline, the cart contents, and flags for whether a delivery photo or video is available. Use this after a customer has placed and paid for an order and reads back the order number from their confirmation email or the order complete page. The order number is NOT the `order_ref` returned by kapruka_create_order (which is the pre-payment checkout reference). Once the customer completes payment in the browser, Kapruka emails them a separate order number — that is what this tool expects. Args: params (TrackOrderInput): - order_number (str): Kapruka order number (e.g. 'VIMP34456CB2') - response_format (str): 'markdown' (default) or 'json' Returns: str: Order tracking details in the requested format. JSON schema: { "order_number": str, "pnref": str, # internal payment reference (numeric; not the same as order_number) "status": str, # received | confirmed | shipped | delivered | cancelled | ... "status_display": str, # human label "order_date": str, # human-formatted, Asia/Colombo "delivery_date": str, # human-formatted "shipped_date": str | null, "amount": str, # LKR string (e.g. "15500.00") "payment_method": str, "comments": str | null, "recipient": {"name": str, "phone": str, "address": str, "city": str}, "greeting_message": str | null, "special_instructions": str | null, "progress": [{"step": str, "timestamp": str}], "live_tracking_available": bool, "has_delivery_video": bool, "has_delivery_photo": bo

输入参数params必填

kapruka_render_options_card

Render Product Options Card (Image)

Render 1-4 products as ONE shareable JPEG "menu" card and return its URL. The card shows each product's photo with a big numbered badge (the ref you assign), and its name + price printed under the photo. Built for chat commerce (WhatsApp): send the image, tell the customer "reply 1, 2 or 3", and they pick without opening links. No AI is involved — the image is server-composited from the live catalog data, so prices match what the product tools return. Ref numbering contract: refs are yours to assign — use sequential numbers per conversation and NEVER reuse one (if the first card was 1-3, the next card starts at 4). A number must keep meaning the same product for the whole conversation. Args: params (RenderOptionsCardInput): - items (list[CardProduct]): 1-4 of {product_id, ref} - currency (str): LKR (default), USD, GBP, AUD, EUR - courtesy ({currency, per_usd}, optional): home-currency figure printed under each USD price ("≈ JPY 2,544"); the caller's rate, echoed back - footer_note (str, optional): appended to the footer reply hint Returns: str: JSON: { "card_url": str, # public JPEG URL — send this as the image "items": [{"ref": int, "product_id": str, "name": str, "price": {"amount": float, "currency": str}, "price_note": str | null, "url": str}], "courtesy": {"currency": str, "per_usd": float} | null, # what was printed, or null "unavailable": [str] # product_ids that failed to load (omitted from card) } Error: "Error: <message>" when no product could be loaded.

输入参数params必填

kapruka_list_delivery_cities

List Kapruka Delivery Cities

List or search Sri Lankan cities Kapruka delivers to. Use the `query` param to filter (e.g. "colombo" → all Colombo zones, "anur" → Anuradhapura). Without a query you get the first 25 cities alphabetically, which is rarely what an agent needs — pass a query. Returns canonical city names (use these as the `city` argument to kapruka_check_delivery) plus any common aliases / vernacular spellings. Args: params (ListDeliveryCitiesInput): - query (Optional[str]): Partial match filter - limit (int): Max results, 1–50 (default 25) - response_format (str): 'markdown' (default) or 'json' Returns: str: Cities list in the requested format. JSON schema: { "cities": [{"name": str, "aliases": [str]}], "total_matched": int, "showing": int }

输入参数params必填

kapruka_check_delivery

Check Kapruka Delivery Availability and Rate

Check whether Kapruka can deliver to a given city on a given date, and the delivery fee. Returns whether the requested date is available (if not, the next available date plus reason) and the delivery fee the checkout will charge. THE FEE DEPENDS ON THE CART AND THE CURRENCY — the city's base rate is not what checkout charges. Sri Lankan customers (LKR) pay the city rate capped by the cart value (25% of the item value, at least LKR 300; some remote cities 50%), so a small cart to a far city pays far less than the rate. Overseas customers (USD) pay a fixed USD fee per city, whatever the cart. Pass `currency` and the `cart` you are about to order and the answer gives the EXACT fee kapruka_create_order will charge ("Delivery fee for this cart"). Without a cart, an LKR answer gives only the MOST the fee can be ("up to"). One shipment per order: the fee covers the whole cart. Pass `product_id` whenever the customer has named a product: the answer then also checks that ITEM's delivery scope (restaurant food, hotel cakes and liquor only reach selected cities, typically the Colombo area). With a product_id, `available` is true only if the date is open AND the item is deliverable to that city. When `item_deliverable` is false, offer the customer one of the returned `deliverable_cities` or an island-wide alternative — do not attempt kapruka_create_order with the same city, it will be rejected. An unknown product_id is silently ignored (no item fields in the result), so check `item_deliverable` is present before relying on it. product_id also selects the SAME-DAY rule the checkout applies to that item: vendor-delivered items (restaurant food) can go today until late afternoon; ordinary items move to the next date; ordinary same-day is only possible early in the morning near Colombo. So a check without product_id can differ from one with it — always pass it once an item is cho

输入参数params必填

kapruka_gift_countries

Kapruka International Gifts — Countries

List the countries Kapruka delivers gifts IN (international gift stores). Use when the RECIPIENT is outside Sri Lanka — e.g. "send flowers to my sister in Dubai", "a cake for my son in Melbourne". These gifts are delivered by Kapruka's partner in that country, not shipped from Sri Lanka. They are NOT in kapruka_search_products; list a store with kapruka_gift_country_products. For each country: how many gifts are in stock now (0 = nothing can be ordered there right now — say so), the delivery fee (one fee per order, whatever the number of items), and for Australia and the UAE the zones they deliver to — delivery is ONLY to those zones, each with its own fee. The earliest delivery date is 3 days from today (Sri Lanka date). Args: params: currency ('LKR' default or 'USD'), response_format. Returns: str. JSON: {"currency", "earliest_date", "countries": [{"country", "products_in_stock", "delivery_fee": {"amount","currency"}, "zone_required": bool, "zones": [{"name","delivery_fee"}], "earliest_date", "store_url"}]}

输入参数params必填

kapruka_gift_country_products

Kapruka International Gifts — Store

List EVERY gift in stock in one country's store (international gifts), grouped by type. The stores are small (tens of products), so this returns the whole store: read it and choose for the customer — there is no keyword search for these products. Prices are exactly what checkout charges for the item (no website discounts apply to these stores); delivery is extra — one fee per order (zone fee in Australia / the UAE), shown at the top. Use the `id` with kapruka_get_product for full detail and with kapruka_create_order (delivery.type "international_gift"). Args: params: country, type (optional filter), currency ('LKR' default or 'USD'), response_format. Returns: str. JSON: {"country", "currency", "count", "delivery": {country row from kapruka_gift_countries}, "products": [{"id", "name", "type", "summary", "price": {"amount","currency"}, "image_url", "url"}]}

输入参数params必填

版本历史

9
  1. v0.9.0最新Oct 20, 2026
  2. v0.8.0Oct 15, 2026
  3. v0.7.0Oct 12, 2026
  4. v0.6.1Oct 5, 2026
  5. v0.6.0Oct 3, 2026
  6. v0.5.0Sep 26, 2026
  7. v0.4.6Sep 21, 2026
  8. v0.4.0Sep 18, 2026
  9. v0.3.0Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。

其他 Kapruka 集成