Margyn MCP

Ask your store anything. Get an analyst’s answer.

Connect your AI assistant to Margyn and ask about revenue, profit, and ad performance in plain language — with real numbers, compared to the prior period.

Read-only by default · OAuth 2.1 · Works with Claude + ChatGPT

https://app.margyn.io/api/mcp/mcp

What is MCP?

MCP (Model Context Protocol) is an open standard that lets AI assistants connect to external tools and data sources. Margyn's MCP server gives your AI assistant direct access to your store's P&L metrics — so you can ask questions like "What was my profit last month?" and get an instant answer.


What it can do

33 tools, grouped by what you're trying to do. Ask in plain language — the assistant picks the right tool and compares against the prior period automatically.

Know how you're doing

Your scoreboard: revenue, profit, ROAS, ad spend, and data freshness across every store and platform.

list_clientsget_data_healthget_dashboard_metricsget_profit_loss

Diagnose profit & cost

Where margin leaks and why a P&L line moved — split into volume × mix × rate, with what to fix first.

get_profit_healthget_cost_breakdownget_metric_change_analysisget_target_recommendationsget_profit_opportunitiesget_operating_expenses

Optimize advertising

Cross-platform ad performance, creative + audience fatigue, attribution windows, budget pacing, and Performance Max.

get_ad_performanceget_meta_insightsget_budget_pacingget_pmax_analytics

Customers & retention

Cohort retention, repeat-purchase cadence, and true LTV:CAC with payback.

get_cohort_analysisget_retention_kpisget_ltvget_time_between_orders

Products & inventory

Product-level margins and forward stockout / restock timing.

get_product_analyticsget_inventory_outlook

Trends & timing

Demand seasonality, anomaly alerts, growth opportunities, COD economics, and a forward action calendar.

get_sales_timeseriesget_seasonality_patternsget_anomaly_radarget_growth_opportunitiesget_cod_economicsget_growth_calendar

Record what happened

Write down what happened in the store that day — a campaign launch, a price change, a stockout, a supplier delay — so the next analysis says that instead of guessing. Only you can edit or delete a note.

log_annotation

Create ads & research competitors

Paid · write

Generate on-brand ad creatives, forecast creative investment, and reverse-engineer competitors' live Meta ads.

start_ad_campaigngenerate_ad_creativeget_generation_statusget_creative_forecastanalyze_competitor_adssave_competitor_report

The full toolkit lives inside Margyn

Exactly what each tool returns and with which parameters — plus the built-in analytics playbook that wields them like an experienced operator — unlocks once you connect.

Connect Margyn

Analytics Playbook

The MCP server includes a built-in analytics playbook that auto-loads into your AI assistant. This ensures the AI analyzes your data the way an experienced e-commerce analyst would.

Profit Waterfall

RevenueCM1CM2Net Profit

CM1 = Revenue − COGS − Shipping | CM2 = CM1 − Ad Spend | Net Profit = CM2 − Operating Expenses

The playbook automatically selects the right tool for your question and compares against the previous period.


Cost Decomposition: Why a P&L Line Moved

The cost-breakdown tools split any P&L line's change into three additive effects vs a comparison period. "Shipping costs up 34%" isn't an answer — knowing which of the three drove it, is.

Δ Cost = sum of three effects

Volume+Mix+Rate
  • Volume effect: the business is just bigger — more orders, same mix, same rates.
  • Mix effect: shares among groups shifted (e.g. customers using a pricier gateway, a heavier carrier).
  • Rate effect: a provider raised their rate — same mix is now more expensive.

Example: "Payment costs up 34.5% — why?"

The AI calls get_cost_breakdown with costType="payment" grouped by gateway and reads the three effects:

  • Volumen +12% — more orders.
  • Mix +21% — customers shifted to Barion (3.2% fee) away from Shopify Payments (2.4%).
  • Rate +1% — no real fee structure change.

"Most of the 34.5% jump is mix — customers are using Barion more, which charges 0.8pp more than Shopify Payments. Route more checkouts back to Shopify Payments and you recover ~21% of the increase."


Connecting

Claude

Works on claude.ai web and the Claude Desktop app.

  1. 1Open Settings > Connectors
  2. 2Click "Add custom connector"
  3. 3Paste the server URL:
https://app.margyn.io/api/mcp/mcp
  1. 4Approve the OAuth authentication in the popup
  2. 5Done! Start asking questions about your store.

High-Value Prompts

Try these right after connecting:

Overview

How's my store doing this month?

Why did my profit drop last week?

Is my data fresh across every platform?

How are my TikTok, Meta and Google ads performing side by side?

Products

Which are my most profitable products?

Which products waste ad budget without profit?

Performance Max

How are my PMax campaigns performing by channel?

Which PMax assets are working best?

Is PMax driving brand or non-brand searches?

Customers

Show me cohort retention for the last 6 months.

How much do new vs returning customers spend on average?

What is my new-customer CPA and ROAS by channel?

What is my LTV:CAC ratio and how long until I make my ad spend back?

Do my cohorts pay back their CAC, and when?

Meta ads deep-dive

Which of my creatives have the best hook rate?

Which audiences are burning out — show me frequency and CTR drift.

How much does 7-day click attribution add to my reported ROAS vs 1-day?

Which campaigns are overspending or underspending vs daily budget?

Which Meta ads have the best completion rate on video?

Decision support

What ROAS do I need to be profitable? What is my breakeven ROAS?

Why did my margin change last week — break it down by component.

How many of my products are missing cost data?

Where am I losing the most money — what should I fix first?

What happened that day

Why did revenue jump on the 14th? Is there a note about it?

Log that the summer sale started on the 14th.

Which changes last month have a note, and which do not?

We were down for half a day on the 9th — log it, and tell me what it cost.

Cost diagnostics

Why did payment costs go up last month?

Which carrier raised rates — break shipping cost down by provider.

What's driving refunds — product issue or fulfilment issue?

Are discounts eating my margin? Show me by code.


Security

Connecting an AI to your financial data should be safe by default. Here is how it is:

Read-only by default

The connector reads your analytics. It never touches your orders, products, costs or settings.

OAuth 2.1 + PKCE

Scoped, revocable sign-in. No API keys to paste or leak.

Nothing is stored

Every request is fetched live from Margyn. The AI assistant never retains your data.

Scoped per store

Access is checked on every call — the AI only sees stores you're a member of.

Paid tools (ad-creative generation) stay off until an admin turns them on. Everything that writes — a note on your chart, a saved competitor report — needs an admin account, and each one is named on the approval screen.


FAQ