K
Kifly/Developer Docs
Sign up →
Agent Integration

Connect to Claude

One-click install the Kifly MCP server into Claude Desktop or Claude.ai.

You'll be prompted for your Kifly agent key. Generate one at /dashboard/api-keys.

Kifly MCP Integration Guide

Connect any MCP-compatible agent (Claude, Gemini, or custom) to Kifly's live product catalog using the Model Context Protocol over HTTP.


Endpoint

https://kifly.io/api/mcp

Stateless StreamableHTTP transport. Every request is independent — no session state is held server-side between calls.


Authentication

Two options. Use whichever fits your agent runtime.

Option A — Static API key (simplest)

Generate a key from the Kifly seller dashboard → API Keys. Keys start with kfa_live_.

Pass it as a Bearer token on every request:

Authorization: Bearer kfa_live_xxxxxxxxxxxxxxxx

Works in any HTTP client or MCP host that lets you set custom headers.

Option B — OAuth 2.1 (required for claude.ai)

Kifly runs a full OAuth 2.1 server. claude.ai and other agents that require OAuth use this flow automatically.

EndpointURL
Authorization server metadatahttps://kifly.io/.well-known/oauth-authorization-server
Dynamic client registrationhttps://kifly.io/oauth/register
Authorizationhttps://kifly.io/oauth/authorize
Tokenhttps://kifly.io/oauth/token

PKCE S256 required. Refresh tokens rotate on each use (leak-containment chain).


Connecting from Google AI Studio (Gemini)

  1. Open aistudio.google.com
  2. In the left sidebar → ToolsAdd toolMCP Server
  3. Enter the server URL: https://kifly.io/api/mcp
  4. Under Headers, add:
    Authorization: Bearer kfa_live_xxxxxxxxxxxxxxxx
    
  5. Click Connect — Gemini will call tools/list and confirm the 9 available tools

Connecting from Claude Desktop (stdio)

For local stdio use, build the MCP package and add to claude_desktop_config.json:

{
  "mcpServers": {
    "kifly": {
      "command": "node",
      "args": ["/absolute/path/to/kifly-agent/kifly/packages/mcp/dist/cli.js"],
      "env": {
        "KIFLY_AGENT_KEY": "kfa_live_xxxxxxxxxxxxxxxx",
        "KIFLY_BASE_URL": "https://kifly.io"
      }
    }
  }
}

Required env vars: KIFLY_AGENT_KEY (seller API key) and KIFLY_BASE_URL (portal origin).


Available Tools (9)

ToolDescription
get_sellerSeller profile: location, storefront URL, delivery_zones, delivery_fee_cents, catalog_size. Call early to pre-screen whether the seller delivers to the buyer's area.
get_buyer_profileRepeat buyer identity via kfb_live_... token — name, email, default shipping address for auto-fill.
search_productsSemantic vector search. Omit q to browse; pass q for ranked results. Multilingual.
create_cartCreate a new shopping cart. Returns cart_id.
add_to_cartAdd a variant by variant_id and quantity.
set_shipping_addressRequired before checkout. Persist address, validate postal code against delivery_zones, return delivery-inclusive total.
checkoutStripe Payment Link + session_id. Requires prior set_shipping_address. Optional buyer_token pre-fills email.
order_statusPoll checkout session — pending, paid, shipped (with tracking), or failed.
submit_feedbackStructured agent feedback to the Kifly team (fire-and-forget, 10/min per token).

Recommended purchase flow

get_seller (optional)
  → get_buyer_profile (optional, if buyer has kfb_live_ token)
  → search_products
  → create_cart
  → add_to_cart (repeat)
  → set_shipping_address
  → checkout
  → [buyer pays at payment_url]
  → order_status (poll until paid or shipped)

search_products

{
  "q": "leather wallet",
  "limit": 10
}

q is optional — omit to browse the most recent listings. Returns a JSON-LD ItemList with name, description, kifly:variantId, offers.price, and kifly:seller on each item.

set_shipping_address

{
  "cart_id": "…",
  "shipping_address": {
    "name": "Ada Lovelace",
    "line1": "123 Market St",
    "city": "San Francisco",
    "region": "CA",
    "postal_code": "94103",
    "country": "US"
  }
}

Returns delivery_eligible, cart_total_with_delivery_cents, and on failure the seller's delivery_zones so the agent can explain out-of-range delivery.


Rate Limits

SurfaceLimit
/api/mcp120 requests / 60 seconds per token
/api/agent/*60 requests / 60 seconds per token
/api/agent/feedback10 requests / 60 seconds per token

Responses include x-ratelimit-limit, x-ratelimit-remaining, and x-ratelimit-reset headers. Breaches return 429 with retry-after.