{"slug": "build-an-mcp-server-that-triages-support-tickets-and-drafts-quotes-no-api-key", "title": "Build an MCP Server That Triages Support Tickets and Drafts Quotes (No API Key, Zero Dependencies)", "summary": "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.", "body_md": "**Disclosure:** I sell a starter kit based on this pattern (linked at the end). Everything below works without buying it.\n\nIf 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.\n\nThe Model Context Protocol (MCP) lets you split those jobs cleanly:\n\n| Tool | Input | Output | \n|---|---|---|\n| `triage` | impact, workaround available? | priority, category, first-response target | \n| `quote` | line items in minor units, discount %, tax % | exact totals | \n| `draft_reply` | ticket + decision, `en` or`ko` | reply draft for human review | \n| `daily_summary` | tickets for a UTC day | Markdown + CSV by queue/priority/status | \n\n*(Tool names here are illustrative; adapt them to your own server.)*\n\nDon'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?*\n\n``` js\n// priority.js — deterministic, testable\nconst MATRIX = {\n  high:   { false: \"P1\", true: \"P2\" },\n  medium: { false: \"P2\", true: \"P3\" },\n  low:    { false: \"P3\", true: \"P4\" },\n};\nexport function priority(impact, hasWorkaround) {\n  const row = MATRIX[impact];\n  if (!row) throw new Error(`unknown impact: ${impact}`);\n  return row[String(Boolean(hasWorkaround))];\n}\n```\n\nFour lines of table beat a paragraph of prompt engineering, and you can unit-test it.\n\nFloating 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:\n\n```\n// quote.js\nexport function quote(items, discountPct = 0, taxPct = 0) {\n  const subtotal = items.reduce((s, i) => s + i.qty * i.unitMinor, 0);\n  const discount = Math.round((subtotal * discountPct) / 100);\n  const taxable  = subtotal - discount;\n  const tax      = Math.round((taxable * taxPct) / 100);\n  return { subtotal, discount, taxable, tax, total: taxable + tax };\n}\n\nquote([{ qty: 3, unitMinor: 25000 }], 10, 10);\n// → { subtotal: 75000, discount: 7500, taxable: 67500, tax: 6750, total: 74250 }\n```\n\nThe model never does arithmetic. It calls `quote` and quotes the result.\n\nThe 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.\n\nAny MCP client with local stdio support works:\n\n```\n{\n  \"mcpServers\": {\n    \"support-quote\": { \"command\": \"node\", \"args\": [\"/absolute/path/to/server.js\"] }\n  }\n}\n```\n\nThen, in the client:\n\n\"Triage today's tickets, quote ticket #12 for 3 seats at ₩25,000 with 10% off and 10% VAT, and draft a Korean reply.\"\n\nUnit-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.\n\nI 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+).\n\nLead-gen instead of support? The sibling kit scores and ranks inbound leads: [https://alborotar.github.io/mcp-automation-starter/](https://alborotar.github.io/mcp-automation-starter/)\n\nFree companion tool: CSV ⇄ JSON ⇄ SQL ⇄ Markdown converter that runs entirely in your browser: [https://alborotar.github.io/data-swiss-army/](https://alborotar.github.io/data-swiss-army/)", "url": "https://wpnews.pro/news/build-an-mcp-server-that-triages-support-tickets-and-drafts-quotes-no-api-key", "canonical_source": "https://dev.to/quietstacklab/build-an-mcp-server-that-triages-support-tickets-and-drafts-quotes-no-api-key-zero-dependencies-5g9m", "published_at": "2026-11-27 04:08:22+00:00", "updated_at": "2026-11-27 04:14:06.344561+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools", "large-language-models"], "entities": ["Model Context Protocol", "Node.js"], "also_reported_by": [], "takeaway": "Keep deterministic decisions like ticket priority and quote arithmetic in unit-tested code and let the LLM only call those tools, since a four-line priority matrix and integer minor-unit quote function are testable where prompt engineering is not.", "recommendation": {"advice": "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.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/build-an-mcp-server-that-triages-support-tickets-and-drafts-quotes-no-api-key", "markdown": "https://wpnews.pro/news/build-an-mcp-server-that-triages-support-tickets-and-drafts-quotes-no-api-key.md", "text": "https://wpnews.pro/news/build-an-mcp-server-that-triages-support-tickets-and-drafts-quotes-no-api-key.txt", "jsonld": "https://wpnews.pro/news/build-an-mcp-server-that-triages-support-tickets-and-drafts-quotes-no-api-key.jsonld"}}