GaurGaur docs

Connecting Claude over MCP

Wire a Jaffle consumer into Claude Desktop, then ask analytical questions that turn into query_contract calls.

Use case

Give Claude Desktop natural-language access to a Jaffle consumer over MCP, so the same governance (consumer scope + row-level security) that applies to REST and chat calls also applies to whatever Claude asks.

Prerequisites

  • A Gaur consumer with the MCP server protocol enabled. We'll assume jaffle-public exposing all five Jaffle contracts.
  • An API key issued for that consumer.
  • Claude Desktop installed.

1. Add the server to Claude Desktop

Open the config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add a jaffle entry under mcpServers:

claude_desktop_config.json
{
  "mcpServers": {
    "jaffle": {
      "url": "https://<base-url>/v1/api/jaffle-public/mcp",
      "headers": {
        "Authorization": "Bearer gaur_***************"
      }
    }
  }
}

2. Restart Claude Desktop

The Jaffle tools appear in the tools panel. If they don't, check the config file's JSON syntax and that the consumer has MCP enabled.

3. Ask a question

What were our top 5 products by revenue last month?

Under the hood Claude:

  1. Calls search_objects("revenue by product").
  2. Calls describe_object on product_performance to read its context and the contract JSON (dimensions, measures, field rules).
  3. Calls query_contract("product_performance", { ... }) with the right shape.
  4. Writes the answer from the rows.

4. Validate scope

Issue a key with auth.store_id set to one store, restart with the new key, and ask the same question. Claude can only return results scoped to that store; there's no path to widen scope from inside an agent loop.

Questions that work well

The contracts and their context determine what Claude can answer correctly. All of these route through query_contract:

  • "Gross margin by product category, last quarter?"
  • "Daily revenue by store for April. Which grew the most?"
  • "Busiest hours? Revenue by hour, weekday vs. weekend."
  • "Tax remitted per jurisdiction last year?"
  • "Retention for customers who first ordered in Q1 2026?"

When Claude picks the wrong contract

The problem is almost always the contract's description field or its attached context, not Claude. Sharpen both: "Per-SKU performance, sliceable by product and category" beats "Performance data". The Business Context Use Cases section is what an agent reads to decide between two contracts that look similar.

Notes

The same MCP server works with Cursor, Opencode, Codex CLI, and any MCP-aware tool. See Using MCP for the config snippets per client. To orient an agent to a consumer, the server also exposes discovery resources (manifest, contract list, query schema, and a markdown briefing).

Source code

apikeys.json in the sample dataset has a ready-made API key shape; the consumer side lives in your workspace.

On this page