cd /news/ai-agents/build-an-mcp-server-that-triages-sup… · home › topics › ai-agents › article
[ARTICLE · art-177068] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Build an MCP Server That Triages Support Tickets and Drafts Quotes (No API Key, Zero Dependencies)

A developer published a pattern for building a Model Context Protocol (MCP) server that triages support tickets and drafts quotes, keeping deterministic logic in code and leaving language work to the LLM. The server exposes four tools — triage, quote, draft_reply and daily_summary — with priority decided by a lookup matrix and quote totals computed in integer minor units, discount applied before tax, so the model never does arithmetic. The developer packaged it as a zero-dependency Node 22+ starter kit with 14 automated tests, including an end-to-end stdio JSON-RPC check.

recommendation

Move priority and pricing logic out of prompts into unit-tested MCP tools, and add one end-to-end stdio JSON-RPC test to catch client integration bugs.

more in playbook: Designing agent systems
read3 min views3 publishedNov 27, 2026

Disclosure: I sell a starter kit based on this pattern (linked at the end). Everything below works without buying it.

If you paste a ticket into a chat and ask "what priority is this?", you get a different answer every Monday. Support teams need the same rule applied every time, with an LLM handling the language parts: summarizing, drafting, translating.

The Model Context Protocol (MCP) lets you split those jobs cleanly:

Tool Input Output
triage impact, workaround available? priority, category, first-response target
quote line items in minor units, discount %, tax % exact totals
draft_reply ticket + decision, en orko reply draft for human review
daily_summary tickets for a UTC day Markdown + CSV by queue/priority/status

(Tool names here are illustrative; adapt them to your own server.)

Don't ask the model to "feel" urgency. Ask the customer (or the form) two things: how bad is the impact? and is there a workaround?

// priority.js — deterministic, testable
const MATRIX = {
  high:   { false: "P1", true: "P2" },
  medium: { false: "P2", true: "P3" },
  low:    { false: "P3", true: "P4" },
};
export function priority(impact, hasWorkaround) {
  const row = MATRIX[impact];
  if (!row) throw new Error(`unknown impact: ${impact}`);
  return row[String(Boolean(hasWorkaround))];
}

Four lines of table beat a paragraph of prompt engineering, and you can unit-test it.

Floating point will eventually produce a quote of $1,049.9999999. Keep amounts in minor units (cents, or KRW won), and apply the discount before tax:

// quote.js
export function quote(items, discountPct = 0, taxPct = 0) {
  const subtotal = items.reduce((s, i) => s + i.qty * i.unitMinor, 0);
  const discount = Math.round((subtotal * discountPct) / 100);
  const taxable  = subtotal - discount;
  const tax      = Math.round((taxable * taxPct) / 100);
  return { subtotal, discount, taxable, tax, total: taxable + tax };
}

quote([{ qty: 3, unitMinor: 25000 }], 10, 10);
// → { subtotal: 75000, discount: 7500, taxable: 67500, tax: 6750, total: 74250 }

The model never does arithmetic. It calls quote and quotes the result.

The reply tool returns text only. No SMTP, no auto-send. That keeps you out of spam territory and lets an agent check the recipient, the facts, and the terms. In regulated markets (e.g. Korea's commercial-messaging rules) this matters.

Any MCP client with local stdio support works:

{
  "mcpServers": {
    "support-quote": { "command": "node", "args": ["/absolute/path/to/server.js"] }
  }
}

Then, in the client:

"Triage today's tickets, quote ticket #12 for 3 seats at ₩25,000 with 10% off and 10% VAT, and draft a Korean reply."

Unit-test priority and quote directly, then add one end-to-end test that spawns the server, sends a JSON-RPC tools/call, and asserts the response. That single test catches 90% of "works in my editor, breaks in the client" bugs.

I packaged this pattern as MCP Support & Quote Starter: four tools, EN/KO replies, Markdown + CSV daily summaries, 14 automated tests including end-to-end stdio checks, and zero npm dependencies (Node 22+).

Lead-gen instead of support? The sibling kit scores and ranks inbound leads: https://alborotar.github.io/mcp-automation-starter/

Free companion tool: CSV ⇄ JSON ⇄ SQL ⇄ Markdown converter that runs entirely in your browser: https://alborotar.github.io/data-swiss-army/

── more in #ai-agents 4 stories · sorted by recency
── more on @model context protocol 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/build-an-mcp-server-…] indexed:0 read:3min 2026-11-27 · —