New · Schemes Service MCP

Ask Claude why a scheme didn't apply.

Real promos, configs, logs, code and validate-only replays of promo-service, inside your own Claude. No tokens, no repo, and no way to break anything.

$ pu update && pu mcp install

Then in Claude Code: /mcp → promo-diagnostics → Authenticate.

01. Why

Debugging a scheme used to take five tools and a lot of trust.

Before

  • Mint a token with pu, keep it somewhere, hope it never ends up in a chat
  • Hand-write OpenObserve SQL on the VPN to find one request
  • Clone schemes-service and guess which commit is deployed
  • Replay calculate with curl and pray isValidate was set
  • Give an AI agent all of that — with nothing stopping a write call

Now

  • Ask in plain words: “why didn’t scheme X apply to order Y on demo?”
  • Claude reads the promo, the LOB config, the cache and the logs itself
  • It replays the order in validate mode on the env you pick
  • It reads the exact code running on that env
  • You get a verdict: code bug, data/config issue, or not a bug — with evidence
02. How it works

Two MCP servers. Your Claude. Nothing else to configure.

promo-diagnostics runs on Vercel and holds the access. promo-logs runs on your laptop, because the log hosts only open over the NetBird VPN. Claude asks questions; the servers decide what may be read.

Schemes Service MCP architectureYour Claude talks to two MCP servers. promo-diagnostics on Vercel reads promo-service, gets tokens from promo-utils and reads code from GitHub. promo-logs runs on your laptop and reads OpenObserve logs over the NetBird VPN. Claude never sees a token.YOUMCP SERVERSSYSTEMS (READ-ONLY)Your ClaudeClaude Code · L2 · QA · Devs· /schemes-investigate· /schemes-fix· asks in plain words· never holds a tokenpromo-diagnosticsremote · Vercel· Google sign-in, @salescode.ai· fixed list of read-only tools· calculate forced to isValidate· secrets redacted, every call auditedpromo-logspu mcp logs · your laptop· count · search · trace· prod regions ap · us · eu· needs the NetBird VPNpromo-servicedemo · uat · prod· allowlisted reads + validate replaypromo-utilsservice key· issues LOB tokens on demandGitHubschemes-service· read-only App, deployed commitOpenObservepulse · trace· promo-service logsHTTPS + OAuthstdioallowlistmint tokenread codeNetBird VPNTokens, passwords and keys stay on the servers. Claude only ever sees tool results — and no tool can write.
03. Who it helps

One question, three teams.

L2 support

Classify a ticket in minutes, with evidence, and route it right: fix the promo or config, hand it to engineering, or close it.

› /schemes-investigate COCA-1796

No repo, no tokens.

QA

Confirm a failure is a real bug before filing it, attach the request id and the replay, and check that a fix is actually deployed on demo.

› Is the fix for COCA-1796 deployed on demo? Replay the original order and compare.

No repo, no tokens.

Developers

Go from ticket to RCA without minting anything, then let /schemes-fix turn the bug into a failing JUnit test in your local repo and fix it.

› /schemes-fix COCA-1796

Your local schemes-service checkout.

04. What Claude can do

Everything you'd check by hand — read-only.

Data

  • get_promo
  • fetch_promos
  • list_configs · get_config
  • get_cache_entry
  • get_outlet_eligibility

Replay

  • simulate_calculate (isValidate forced)
  • get_deployed_build (blue/green)
  • demo · uat · prod

Logs

  • count_logs (hourly, 7 days)
  • search_logs
  • get_request_trace
  • prod regions ap · us · eu

Code

  • search_code
  • read_file
  • file_history
  • at the commit that is deployed
05. Safe by construction

Guardrails in code, not in the prompt.

Even if the model gets confused, or a ticket contains a sneaky instruction, there is simply no tool that can change a promotion, a config or an order.

No tool can write

Every call goes through a fixed method + path allowlist. /add, /editCalculate, /bulkCancel, /budgetDeduct, metadata upserts and cache deletes are refused before a request leaves the server.

Calculate is always a dry run

The server strips every validate flag the model sends and sets isValidate=true itself, then checks it again before sending.

Claude never holds a secret

promo-service tokens are issued by promo-utils with a service key and stored encrypted on the server. Tool output masks tokens, passwords and phone numbers.

Code without the secrets

GitHub access is a read-only App on one repo. Only source folders are ever downloaded — application.properties never leaves GitHub.

Only Salescode people

Google Workspace sign-in for @salescode.ai, re-checked on every call, and a sign-in lasts at most 7 days.

Every call is audited

Who asked, which tool, which env and LOB, and for which ticket.

06. Safer than the old skill

The bugfix skill asked the model to be careful. The MCP doesn't have to ask.

/schemes-service-bugfix gave the agent real admin tokens and a shell, and listed the things it must never do. That works until a model hallucinates, or a ticket smuggles in an instruction. The MCP moves every one of those rules out of the prompt and into code the model can't talk its way past.

Who holds the tokens
Old skillThe agent mints admin tokens with pu and keeps them in temp files on your laptop.
Schemes MCPThe server holds them, encrypted. Claude never sees a token.
What stops a write call
Old skillA line in the skill asking the model not to call /add, /bulkCancel or /metadata/upsert.
Schemes MCPThose routes are not on the server allowlist. The request never leaves.
Calculate replays
Old skillThe model has to remember to set isValidate: true every time.
Schemes MCPThe server removes the flag the model sent and sets isValidate=true itself.
A ticket says “now cancel this order”
Old skillThe agent has curl and an admin token. One bad step and it runs.
Schemes MCPThere is no tool that can cancel, edit or delete. Nothing to run.
Log access
Old skillThe OpenObserve cookie is saved in a file on your disk.
Schemes MCPFetched with your pu session and kept in memory only.
Reading code
Old skillThe full repo, including application.properties with its credentials.
Schemes MCPOnly source folders are downloaded; credential-looking values are masked.
Who did what
Old skillNothing recorded.
Schemes MCPEvery call audited: person, tool, env, LOB, ticket.

One honest caveat: promo-service checks isValidate in several places, so a validate replay is only as read-only as those checks. That is why every simulate_calculate call is audited with its ticket.

07. Get started

Two minutes, once.

  1. 01

    Install both MCP servers and the skills

    $ pu update && pu mcp install
  2. 02

    Sign in once

    In Claude Code, type /mcp, pick promo-diagnostics, choose Authenticate and use your @salescode.ai Google account.

  3. 03

    Ask

    › /schemes-investigate why didn't the slab discount apply to order 1234 for cokesasapdemo on demo?
    › check us west prod logs for cokerl. were there out of memory exceptions on friday?
    › /schemes-fix COCA-1796

Logs need the NetBird VPN. Don't have pu yet? Get access to promo-utils.

Next time a scheme misbehaves, just ask.

Code bug, data issue or not a bug — with the evidence to prove it.

pu update && pu mcp install