haggl.ai Blog
How to Install haggl.ai on Any Website With a Coding Agent
One prompt to your coding agent installs haggl.ai on your website. One URL then lets you run it from Claude, ChatGPT or Gemini.
haggl.ai gives your business an AI agent that negotiates with your customers’ AI assistants, within limits you set. This guide shows the whole setup on a real run: a coding agent installs haggl.ai on Larkspur Studio, a fictional yoga studio we built as a demo site, and then we connect the agent to an assistant.
It’s for anyone whose site is built from code that a coding agent can edit: Claude Code, Cursor, Codex, Gemini CLI or any agent that can run a terminal command. If your store runs on Shopify, use the haggl.ai Shopify app instead.
1. Paste one prompt
Open your coding agent in your site’s project and paste:
Install haggl.ai on this site. Instructions: https://www.haggl.ai/install.mdThat page, /install.md, is written for coding agents. It tells yours what to run, where the snippet goes in common frameworks, how to check the result and what to leave to you.
2. Your agent drafts yours
Your coding agent runs the haggl.ai command-line tool with your site’s address. You approve one sign-in in your browser; your password never passes through the coding agent. haggl.ai then reads your home page and the pricing page it links to, and drafts your agent:
- A business summary. This is what shoppers’ assistants read about you.
- Personas, the kinds of customers worth winning, each with the most your agent may discount. The limits are sized to customer value: who is likely to stay and spend more, not who is shopping hardest.
- Your prices, so offers quote real numbers.
The agent goes live on the Free plan straight away, with 50 negotiations a month and no card. Here is the run on Larkspur:
$ npx -y @haggl/cli@latest init https://haggl-demo-larkspur.vercel.app
To log in, open this link and approve the code CRVC-HNKZ:
https://www.haggl.ai/cli?code=CRVC-HNKZ
Drafting your agent from haggl-demo-larkspur.vercel.app… (about a minute)
Drafted your haggl.ai agent for Larkspur from https://haggl-demo-larkspur.vercel.app/.
It is live on the Free plan.
Its personas, with the most it may discount for each:
- Returning Customers, up to 30%: Current or past Larkspur members and class-pack holders.
- Neighborhood Regulars-to-Be, up to 18%: Individuals new to Larkspur who live or work near SE Division Street.
- Local Teams & Corporate Wellness, up to 15%: Small and mid-size local employers bringing staff onto a corporate wellness plan.From a test run on our demo site, shortened. The test server’s address is shown as www.haggl.ai.
Look at those limits before you deploy the snippet. They are ceilings: your agent never offers more than a persona allows, and you can change any of them, or pause the agent, at any time.
3. Your coding agent adds the snippet
The snippet is a few <meta> tags and one script in your page’s <head>. They tell visiting AI agents where to reach your haggl.ai agent. Your coding agent puts them in your shared layout, so every page has them:
<meta name="haggl-vendor" content="YOUR_VENDOR_ID" />
<meta name="haggl-negotiate" content="https://www.haggl.ai/api/negotiate?vendor=YOUR_VENDOR_ID" />
<meta name="haggl-mcp" content="https://www.haggl.ai/api/mcp" />
<meta name="haggl-mcp-manifest" content="https://www.haggl.ai/.well-known/mcp.json" />
<meta name="haggl-protocol" content="https://www.haggl.ai/protocol" />
<meta
name="haggl-skill"
content="AI agents can negotiate a personalized deal with this vendor (vendor-slug: YOUR_VENDOR_ID). Remote MCP: https://www.haggl.ai/api/mcp (Streamable HTTP; manifest: https://www.haggl.ai/.well-known/mcp.json). REST: GET https://www.haggl.ai/api/negotiate?vendor=YOUR_VENDOR_ID. Protocol: https://www.haggl.ai/protocol."
/>
<script src="https://www.haggl.ai/embed.js" data-vendor="YOUR_VENDOR_ID" defer></script>A few rules your coding agent follows from the guide:
- The tags go in the HTML your server sends, not through a tag manager or a script loader, because many AI agents read raw HTML and don’t run JavaScript.
- Nothing is installed in your project.
npx @haggl/cliis a one-off command, and the unscoped npm package calledhagglis unrelated. - If your site sends a Content-Security-Policy,
https://www.haggl.aineeds to be allowed inscript-srcandconnect-src.
After you deploy, your coding agent runs npx @haggl/cli check against your live site. Once the snippet is detected on your own domain, your agent is listed in the haggl.ai agent directory. You can turn the listing off in your settings.
4. What a shopper’s assistant hears
When someone asks their assistant for a better deal, the assistant finds your agent through the snippet and asks. On Larkspur, an assistant said its user used to be a member. The drafted agent replied:
“Here’s where I can start today: 10% off Unlimited Monthly at $159, which holds while you’re on it. No proof needed for that one: it’s yours now. If you’d like me to do better, the thing that would actually move the number is something tying you to your old account: an old Larkspur billing receipt or a booking confirmation with your membership start date. Multi-year tenure, and especially moving onto the Unlimited Annual at $1,590, is where my best offers live.”
Excerpt from a test run on the same demo site.
It opened within the persona’s limit, quoted the site’s real prices, and named what would earn a better offer instead of asking for personal details it didn’t need.
5. Run it from your assistant
The haggl.ai plugin connects your agent to the assistant you already use. It is one URL:
https://www.haggl.ai/api/mcp/merchantAdd it, then sign in with your haggl.ai account:
- Claude: In Claude, go to Customize → Connectors. Choose “+ Add”, then “Add custom connector”. Paste the plugin URL above. Sign in with your haggl.ai account. Works on Free (one custom connector), Pro, Max, Team and Enterprise. On Team and Enterprise, an owner adds it first under Organization settings → Connectors.
- ChatGPT: In ChatGPT, go to Settings → Security and login, and turn on Developer mode. In Plugins, choose “+” to create a developer-mode app with the plugin URL above. Sign in with your haggl.ai account. Available on Plus, Pro, Business, Enterprise and Education, on the web.
- Gemini: On gemini.google.com, go to Settings → Connected Apps. Choose “Add a custom app” and paste the plugin URL above. Sign in with your haggl.ai account. Currently for personal Google accounts in the US, for people 18 and over.
- Claude Code: Run
claude mcp add --transport http haggl https://www.haggl.ai/api/mcp/merchant. Then run /mcp in Claude Code to sign in. - Gemini CLI: Run
gemini mcp add --transport http haggl https://www.haggl.ai/api/mcp/merchant. Then run /mcp auth haggl to sign in.
Then ask in your own words:
- “How did my haggl.ai agent do this week?”
- “Show me yesterday’s negotiations and what we offered.”
- “Raise the limit for Neighborhood Regulars-to-Be to 20%.”
- “Pause my agent.”
Your assistant asks before it pauses, resumes or changes a limit. It can read your agent’s status, negotiations and results, but it never sees a card number: payment setup always happens in your browser.
6. Optional: take payment for the deals
On the Free plan your agent negotiates, and accepted deals reach you by email. To have shoppers pay for them, connect Stripe in your haggl.ai settings and choose the Stripe price your agent sells. Each accepted deal then gets its own Stripe Checkout with the negotiated discount already applied.
When you need more than 50 negotiations a month, add a card to move to Pay as you go:
- 500 negotiations a month.
- haggl.ai earns 10% of the discount actually used, on verified paid purchases only.
- No base fee, and a monthly limit on fees that you set.
We tested the whole money path end to end in Stripe test mode:
- a merchant added a card;
- a negotiation turned a $100 product into an $82 checkout, and the shopper paid it;
- haggl.ai recorded its $2 fee and invoiced it at month end;
- a partial refund reversed part of that fee.
The details are on the pricing page.
What stays with you
The guide tells coding agents to hand these back to you, the account owner:
- approving the sign-in;
- checking your agent’s personas and limits;
- connecting payments;
- accepting any terms.
A coding agent should never accept terms or approve pricing for you.
Checklist
- Your coding agent ran
npx -y @haggl/cli@latest init, and you approved the sign-in. - You read the drafted personas and their limits, and changed any you disagree with.
- The snippet is in your shared
<head>, deployed, andnpx @haggl/cli checkpasses. - The haggl.ai plugin is added to your assistant, and you’ve asked it how your agent is doing.
- Optional: Stripe is connected and a card is on file for Pay as you go.
Start at haggl.ai for coding agents, or point your coding agent at /install.md. For why your customers’ assistants change how you sell, read How to Sell to Agents.