Skip to main content
Glama

Sunleaf MCP Demo

An MCP server that lets AI assistants such as Claude Desktop and Cursor answer customer questions from a shop's own files: its product catalog, FAQs and policy pages.

Demo with fictional sample data. Not a client project.

What it shows

  • A business's own files, connected to an AI assistant. Sunleaf Tea Co. is a made-up tea shop. Its catalog, FAQs and policies are plain JSON and Markdown files in data/.

  • Read-only. The assistant can search and read. It cannot change anything.

  • Cited answers. Every passage comes with an id the assistant can cite, such as [faq-006] or [policy:returns#opened-tins], and each policy's scope rules travel with any section of it that is returned.

  • Honest when unsure. When nothing in the data matches, the server says so. When only part of a question matches, it returns the closest passages marked as partial, and the assistant is told to answer only from what they actually say.

  • No API keys, no network calls. The server runs locally over stdio and makes no network requests itself. Your AI client may send the data it returns to its model provider (see Security notes).

Related MCP server: Shopify MCP Server

Tools, resources and prompt

Name

Kind

What it does

search_products

tool

Keyword search over the catalog, with optional category and in-stock filters

get_product

tool

Full details for one product id

search_faqs

tool

The best-matching FAQ entries, with their ids

get_policy

tool

The full shipping, returns, privacy or wholesale policy

answer_sources

tool

Searches FAQs and policies together. Returns cited passages marked as answers or partial matches, with each policy's scope rules, and says so when nothing matches

sunleaf://catalog

resource

All products (JSON)

sunleaf://faqs

resource

All FAQs (JSON)

sunleaf://policies/{name}

resource template

One policy (Markdown)

customer_reply

prompt

Drafts a reply to a customer message using only these sources

Quick start

You need Node.js 20 or later to run the server. The tests need Node.js 22.12 or later.

git clone https://github.com/panditfloki/sunleaf-mcp-demo.git
cd sunleaf-mcp-demo
npm install
npm run build
npm test

Connect to Claude Desktop

  1. Open the Claude Desktop config file (create it if it does not exist):

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %AppData%\Claude\claude_desktop_config.json

  2. Add the server, using the absolute path to your copy of this repository:

    {
      "mcpServers": {
        "sunleaf": {
          "command": "node",
          "args": ["/ABSOLUTE/PATH/TO/sunleaf-mcp-demo/build/index.js"]
        }
      }
    }
  3. Quit Claude Desktop completely and open it again.

  4. If the server does not show up, check the logs (~/Library/Logs/Claude/mcp*.log on macOS). If Claude cannot find node, which is common when Node.js was installed with nvm, replace "node" with the full path that which node prints.

A ready-to-edit copy is in examples/claude_desktop_config.json.

Connect to Cursor

Add this to .cursor/mcp.json in this folder, then open the folder in Cursor:

{
  "mcpServers": {
    "sunleaf": {
      "type": "stdio",
      "command": "node",
      "args": ["${workspaceFolder}/build/index.js"]
    }
  }
}

To use it in every project, put the same entry in ~/.cursor/mcp.json with an absolute path instead of ${workspaceFolder}. In Cursor Settings, the MCP section should then show sunleaf as connected. A copy is in examples/cursor-mcp.json.

Test with MCP Inspector

MCP Inspector needs Node.js 22.19 or later.

npm run inspect

This opens the Inspector in your browser, where you can list the tools and call them. For a scripted check:

npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list

Questions to try

  • "Do you have a caffeine-free tea under $15?"

  • "What is your return policy for opened tins?"

  • "How should I brew the Darjeeling first flush?"

  • "Do you ship to Canada?" The shipping policy lists where the shop ships and Canada is not on it, so the assistant should say no and cite the policy.

  • "What is your FSSAI licence number?" The data does not hold it, so the assistant should say the data does not cover it.

Use your own data

Point the server at your own folder with the SUNLEAF_DATA_DIR environment variable. The folder needs the same layout:

my-shop/
  products.json
  faqs.json
  policies/
    shipping.md
    returns.md
    privacy.md
    wholesale.md
  • products.json: an array of products with id, name, category, price_inr, price_usd, sizes (list), in_stock (true or false), tags (list) and short_description.

  • faqs.json: an array of FAQs with id, question, answer and tags (list), plus an optional policy (shipping, returns, privacy or wholesale) naming the policy that governs the FAQ. The named policy file must exist.

  • policies/: Markdown files. Each ## heading becomes a separate section that can be cited. Missing policy files are skipped.

  • Start each policy with a section that states its scope, such as where you ship or who can apply. answer_sources returns that first section together with any other section of the same policy and with any FAQ linked to it through policy, so an answer about shipping costs or a wholesale FAQ cannot lose the rule about destinations.

  • Ids ignore case and surrounding spaces, in validation and lookup alike. X-1 and x-1 count as the same id, so a file with both is rejected as a duplicate.

The server checks both JSON files when it starts, and stops with a clear message if a field is missing or an id is used twice.

In Claude Desktop, set the variable in the server entry:

"sunleaf": {
  "command": "node",
  "args": ["/ABSOLUTE/PATH/TO/sunleaf-mcp-demo/build/index.js"],
  "env": { "SUNLEAF_DATA_DIR": "/ABSOLUTE/PATH/TO/my-shop" }
}

Use an absolute path. A relative path is resolved from this package's folder, not from wherever the AI client starts.

Screenshots

Coming soon: Claude Desktop (docs/claude-desktop.png), Cursor (docs/cursor.png), MCP Inspector (docs/inspector.png) and a short demo GIF (docs/demo.gif).

Security notes

  • Read-only. No tool writes, deletes or sends anything.

  • Local files only. The server reads its data folder and nothing else. It makes no network calls.

  • stdio. It runs as a local process that your AI client starts and stops.

  • Real business data. Whatever the tools return is shown to the AI client and, through it, to the model provider. Only put in the data folder what you are comfortable sharing that way.

How it works

  • src/index.ts starts the server over stdio. It never writes to stdout, because stdout carries the MCP protocol. Logs go to stderr.

  • src/server.ts registers the tools, resources and prompt with the official MCP TypeScript SDK (@modelcontextprotocol/server v2).

  • src/search.ts is a small offline keyword search. A word in a product name or FAQ question counts 3 times, in tags 2 times and in body text once, and rare words count more than common ones.

  • answer_sources grades each passage by the share of the question it covers, weighted by rarity. At least half: it is returned as an answer. Less: the closest passages come back marked as partial, because some questions are answered by exclusion ("Do you ship to Canada?" is answered by the list of countries the shop ships to). Nothing at all: it says so.

  • src/data.ts loads and checks the data folder.

Limits. This is keyword search, not semantic search. A paraphrase that shares no words with the data can miss, and no retrieval method can guarantee that an AI never guesses. For real business data, add embeddings or a synonym list, and keep the instruction to answer only from returned passages.

Development

npm run dev    # run from source with tsx
npm test       # unit tests and an in-process client/server test
npm run build  # compile to build/

License

MIT. See LICENSE.


© 2026 dydxfx · https://dydxfx.com

Available Tools

5 tools
answer_sourcesFind answer sourcesA
Read-onlyIdempotent

Search the FAQs and policies together for a customer question. Returns passages with ids to cite, marked as answers or as partial matches, plus the scope rules of any policy they come from or are governed by. A partial match can still answer by exclusion: a list of the countries the shop ships to answers whether it ships somewhere else. If nothing matches, it says so: tell the customer instead of guessing.

Inputs: question (required). Returns: match, sources

get_policyGet policyA
Read-onlyIdempotent

The full text of one Sunleaf store policy as Markdown: shipping, returns, privacy or wholesale.

Inputs: name (required).

get_productGet productA
Read-onlyIdempotent

Full details for one Sunleaf product by its id (from search_products): description, sizes, tags, price and stock.

Inputs: id (required). Returns: product

search_faqsSearch FAQsA
Read-onlyIdempotent

Find the Sunleaf FAQ entries that best match a question. Returns each question and answer with its FAQ id for citation.

Inputs: query (required), max_results.

search_productsSearch productsA
Read-onlyIdempotent

Search the Sunleaf Tea Co. catalog by keywords such as a tea type, flavour, occasion or teaware item. Returns matching products with id, category, price in INR and USD, sizes and stock status. Use get_product for full details.

Inputs: query (required), category, max_results, in_stock_only. Returns: results

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: FAQ search, product search, product detail retrieval, policy retrieval, and a combined answer tool that searches both FAQs and policies with citations. Even though search_faqs and answer_sources overlap on FAQs, answer_sources is broader and returns different output, so there's no real ambiguity.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (search_faqs, search_products, get_product, get_policy, answer_sources). The pattern is predictable and uniform throughout.

    Tool Count5/5

    With 5 tools, the server is well-scoped for a read-only customer support context covering products, FAQs, and policies. Each tool serves a necessary role, and the count is neither too thin nor excessive.

    Completeness5/5

    The surface fully covers the domain: product search and details, FAQ search, policy retrieval, and a combined answer tool that handles cross-domain queries. There are no obvious missing operations for the stated purpose of answering customer questions.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to access and manage Shopify store data including products, orders, inventory, and analytics through the Model Context Protocol. It allows users to query store performance and customer details using natural language.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Provides AI assistants with real-time access to Shopify store analytics, sales data, and inventory through ShopifyQL and the Admin GraphQL API. It enables users to query store performance, customer metrics, and marketing insights using natural language.
      13
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to search and retrieve unified product knowledge from documentation, training sessions, resolved support tickets, and curated team answers, with source attribution, and to report gaps that trigger a human review loop.
      MIT