{
  "markdown": "# CaseMargin MCP Server\n\nCaseMargin MCP server exposes support case reasoning tools — generate structured case briefs and check escalation readiness from any MCP-compatible AI client (Claude Desktop, Claude Code, Cursor, and others). It sits **above** helpdesk data layers: it doesn't read tickets from Zendesk or any ticketing system — you pass ticket content in, it returns structured analysis powered by the same AI that runs [casemargin.com](https://casemargin.com).\n\n## Tools\n\n### `generate_case_brief`\n\nGenerate a structured case brief from a support ticket thread. Returns an assessment, what has been tried, current status, and recommended next step.\n\n**Input:** `ticket_content` (string) — the full ticket thread: messages, internal notes, whatever you paste or pipe in. 10–50,000 characters.\n\n**Output (structured JSON):**\n\n```json\n{\n  \"quick_scan\": {\n    \"assessment\": \"…what this case is about and how serious it is…\",\n    \"next_step\": \"…the single action the receiving agent should take now…\",\n    \"status\": \"Waiting on customer\"\n  },\n  \"full_brief\": {\n    \"current_problem\": \"…symptoms, blockers, business impact…\",\n    \"actions_taken\": [\"action → outcome\", \"…\"],\n    \"key_context\": \"…customer plan, history, logs, error codes…\"\n  },\n  \"metadata\": {\n    \"input_length\": 4210,\n    \"brief_length\": 1250,\n    \"compression_ratio\": 0.3\n  }\n}\n```\n\n### `check_escalation_readiness`\n\nAnalyze whether a support ticket is ready to escalate to L2. Returns a readiness score (0–100), dimensional breakdown, predicted L2 questions, and missing items.\n\n**Input:** `ticket_content` (string) — the ticket notes to evaluate. 10–20,000 characters.\n\n**Output (structured JSON):**\n\n```json\n{\n  \"overall_score\": 62,\n  \"readiness\": \"borderline\",\n  \"dimensions\": {\n    \"problem_clarity\": { \"score\": 80, \"note\": \"…\" },\n    \"troubleshooting_evidence\": { \"score\": 55, \"note\": \"…\" },\n    \"business_impact\": { \"score\": 40, \"note\": \"…\" },\n    \"next_action\": { \"score\": 70, \"note\": \"…\" },\n    \"billing_defensibility\": { \"score\": 65, \"note\": \"…\" }\n  },\n  \"predicted_l2_questions\": [\"…\", \"…\"],\n  \"missing_items\": [\"…\", \"…\"]\n}\n```\n\n## Installation\n\nNothing to install ahead of time — `npx` fetches the package on first run. Add this to your `claude_desktop_config.json` and restart Claude Desktop:\n\n```json\n{\n  \"mcpServers\": {\n    \"casemargin\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"casemargin-mcp-server\"],\n      \"env\": {\n        \"CASEMARGIN_API_KEY\": \"your-api-key-here\"\n      }\n    }\n  }\n}\n```\n\nCursor and Claude Code take the same shape of config in their own files. The config lives at `~/Library/Application Support/Claude/` on macOS and `%APPDATA%\\Claude\\` on Windows. Quit and reopen the app rather than closing the window — the config is read at process start.\n\nThe API key is optional — without it, brief generation runs on the anonymous per-IP tier. Get a free key (8 briefs/month) at [casemargin.com/signup](https://casemargin.com/signup). The escalation readiness check is free and needs no key. Drop the whole `env` block to run keyless.\n\nAlso on the [MCP Registry](https://registry.modelcontextprotocol.io/v0.1/servers?search=com.casemargin) as `com.casemargin/casemargin-mcp-server`, and on [npm](https://www.npmjs.com/package/casemargin-mcp-server).\n\n### Running from source\n\nOnly needed if you're modifying the server:\n\n```bash\ngit clone https://github.com/Casemargin/casemargin-mcp-server.git\ncd casemargin-mcp-server\nnpm install\nnpm run build\n```\n\nThen point `command` at `node` and `args` at the absolute path of the built `dist/index.js`.\n\n## Example usage\n\n### \"What's happening with this ticket?\"\n\nPaste a ticket thread into your AI client and ask what's going on:\n\n> **You:** What's happening with this ticket?\n>\n> Customer reports VPN drops every ~30 min since Monday. Rebooted router, reinstalled client v4.2, issue persists. Firewall logs show DHCP lease renewing every 30 min. Customer is on the Premium SLA, CFO is affected. Told them we'd escalate if not fixed by Friday…\n\nClaude calls `generate_case_brief` and returns a structured brief:\n\n> **Quick scan** — Recurring VPN disconnects tied to a 30-minute DHCP lease renewal on a Premium SLA account with an executive affected; moderate-to-high urgency.\n> **Next step:** Extend the DHCP lease time on the affected scope and confirm whether the drops track lease renewals.\n> **Status:** Actively being worked.\n>\n> …plus the full breakdown of current problem, actions already taken (each with outcome), and key context.\n\n### \"Is this ticket ready to escalate?\"\n\n> **You:** Is this ticket ready to escalate to L2?\n>\n> *(pastes the same thread)*\n\nClaude calls `check_escalation_readiness` and returns the score with a breakdown:\n\n> **62/100 — borderline.** Problem clarity is strong (80), but troubleshooting evidence is thin (55) — no packet capture or client logs attached — and business impact is asserted, not quantified (40). Before escalating, L2 will ask: \"What do the VPN client logs show at the moment of the drop?\" and \"Does the issue follow the user across networks?\"\n\n## Security and privacy\n\nThe server makes network calls and reads environment variables, so supply-chain scanners flag both. [SECURITY.md](SECURITY.md) documents the full extent: one outbound origin, two environment variables, and no filesystem, subprocess, dynamic-code, install-script, or telemetry access at all.\n\nTwo things worth knowing up front. Only the `ticket_content` you pass to a tool leaves your machine — nothing else is collected, and raw ticket text is never stored server-side. And because the API key travels as a request header, the server **refuses to start** if `CASEMARGIN_API_URL` points at a non-`https` origin other than loopback, rather than silently sending your key in cleartext.\n\nReleases are published from GitHub Actions with npm provenance, so you can verify the tarball came from this repository:\n\n```bash\nnpm audit signatures\n```\n\n## About CaseMargin\n\nCaseMargin turns raw support tickets into structured case briefs so the next agent picks up cold in seconds, not minutes. The web app, Zendesk integration, and free Escalation Readiness Score tool live at [casemargin.com](https://casemargin.com).\n",
  "bytes": 6181,
  "sha": "316ecfd6ce09135fa0dee12bdd43c475fd2ef3dedc4df6237db082e056d25df8",
  "repo_slug": "casemargin/casemargin-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_com_casemargin_casemargin_mcp_server_2738d2fa/readme"
}