Skip to main content

MCP Server Reference

Tools

search_docs

Search all Stackfront documentation pages by keyword. Returns matching pages with excerpts. Input:
PropertyTypeRequiredDescription
querystringYesSearch terms to find in documentation content
Example response:
[Cart Overview](docs://cart/overview)
Manage cart lifecycle, add lines, update quantities, and proceed to checkout.
[Cart Usage](docs://cart/usage)
Add products to cart, display cart contents, update line items.
Use cases:
  • “Search docs for loyalty points redemption”
  • “Find the documentation on push notifications”
  • “What does the docs say about checkout?”

get_sdk_api

Look up any Stackfront SDK hook, service, or type by name. Returns the full TypeScript signature, parameters, return type, and JSDoc description. Input:
PropertyTypeRequiredDescription
namestringYesExact or close match name (e.g. useCart, CartService, SdkBranding)
Example output for useCart:
## useCart (Hook)

Add products to cart and manage checkout.

```typescript
function useCart(): { cart: any; loading: boolean; error: any; addLines: ...; removeLines: ...; checkoutUrl: string | null }
Resource: sdk://hook/useCart File: hooks/useCart.ts

**What is searched (in order):**

1. **Hooks** (24 total) — `useProducts`, `useCart`, `useCustomer`, `useAuth`, `useWishlist`, `usePush`, `useLoyalty`, `useStories`, `useReviews`, `useSocialProof`, `useIntegrations`, etc.
2. **Services** (17 total) — `ProductService`, `CartService`, `CustomerService`, `LoyaltyService`, `ReviewService`, `StoryService`, `SocialProofService`, `IntegrationService`, `WishlistService`, `DeviceService`, `EventService`, `ConfigService`, `StorageService`, `BillingService`, `ApiClient`, `StorefrontClient`, etc.
3. **Types** (46 total) — `SdkConfig`, `SdkBranding`, `SdkBanner`, `SdkPopup`, `SdkAnnouncement`, `LoyaltyAccountResponse`, `ProductReview`, `SocialProofSignals`, `CartLineInput`, `CustomerAccessToken`, etc.

---

### `get_code_example`

Get a copy-paste-ready code example for a specific Stackfront feature. Returns a complete, working React Native component.

**Input:**

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `topic` | `string` | Yes | Feature topic: `cart`, `products`, `search`, `auth`, `push`, `loyalty`, `reviews`, `engagement` |

**Available topics:**

| Topic | Example Content |
|-------|-----------------|
| `cart` | Cart screen with add/remove/checkout |
| `products` | Product listing with infinite scroll |
| `search` | Search bar with results |
| `auth` | Login/register screen |
| `push` | Push notification setup |
| `loyalty` | Points display and tier progress |
| `reviews` | Review list and submission form |
| `engagement` | Stories, wishlist, social proof |

**Use cases:**

- "Get a code example for cart"
- "Show me how to implement product search"
- "I need a loyalty points component"

---

## Resources

All resources are read-only and expose documentation or SDK metadata as markdown or plain text.

### Docs Resources

| URI | Description |
|-----|-------------|
| `docs://index` | Table of contents for all documentation pages |
| `docs://{slug}` | Individual documentation page content in markdown (e.g. `docs://cart/overview`) |

### SDK Resources

| URI | Description |
|-----|-------------|
| `sdk://hooks` | All 24 hooks with signatures and descriptions |
| `sdk://services` | All 17 service classes with method listings |
| `sdk://types` | All 46 TypeScript types and interfaces |
| `sdk://graphql` | All 18 GraphQL queries and mutations |

### Individual Resources

| URI Pattern | Count | Example |
|-------------|-------|---------|
| `sdk://hook/{name}` | 24 | `sdk://hook/useCart` |
| `sdk://service/{name}` | 17 | `sdk://service/CartService` |
| `sdk://type/{name}` | 46 | `sdk://type/SdkConfig` |

These are useful when the `get_sdk_api` tool identifies the right resource — your AI assistant can read it for full details.

---

## Prompts

### `integrate-sdk`

A step-by-step guide for integrating the Stackfront SDK into a new React Native project.

**No arguments required.** The prompt walks through:

1. Installing the `react-native-stackfront-sdk` package
2. Wrapping the app in `StackfrontProvider` with `shopDomain`, `developerApiKey`, and `appVersion`
3. Using hooks in screens

### `build-feature`

A structured workflow for implementing a specific Stackfront feature. Takes one argument:

**Arguments:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `feature` | `string` | Yes | Feature name (e.g. `product-listing`, `cart`, `push-notifications`, `loyalty`, `auth`, `reviews`, `search`) |

The prompt instructs the AI to:

1. Read the relevant hook resource (`sdk://hook/use{Feature}`)
2. Read the relevant docs page (`docs://{feature-slug}`)
3. Search for a matching code example via `get_code_example`
4. Generate a complete, typed, production-ready screen component with loading and error states