@lincolnminto/zendesk-mcp-server 2.20.0 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -194,6 +194,10 @@ Add to your `.vscode/mcp.json`:
194
194
 
195
195
  </details>
196
196
 
197
+ > Using the stdio API-token escape hatch instead of OAuth? Add `ZENDESK_EMAIL` /
198
+ > `ZENDESK_API_TOKEN` via `env` in the config above — worked examples per client:
199
+ > [docs/api-token-stdio.md#mcp-client-configuration](docs/api-token-stdio.md#mcp-client-configuration).
200
+
197
201
  Something not working? See [Troubleshooting](docs/troubleshooting.md).
198
202
 
199
203
  ## Quick start: remote (HTTP)
package/dist/index.js CHANGED
@@ -3178,6 +3178,46 @@ const createSearchTools = (ctx) => {
3178
3178
  }];
3179
3179
  };
3180
3180
  //#endregion
3181
+ //#region src/tools/ticket-relations.ts
3182
+ const formatTicketRelations = (ticket) => {
3183
+ const source = ticket.via?.source;
3184
+ const followUpOf = source?.rel === "follow_up" ? source.from : void 0;
3185
+ const followups = ticket.followup_ids ?? [];
3186
+ const lines = [
3187
+ followUpOf?.ticket_id ? `- **Follow-up of**: #${followUpOf.ticket_id}${followUpOf.subject ? ` (${followUpOf.subject})` : ""} — the closed ticket this one continues` : "",
3188
+ followups.length > 0 ? `- **Follow-ups**: ${followups.map((id) => `#${id}`).join(", ")} — tickets created from this one after it closed` : "",
3189
+ ticket.problem_id ? `- **Problem**: #${ticket.problem_id} — the problem ticket this incident is linked to` : "",
3190
+ ticket.type === "problem" ? `- **Incidents**: this is a problem ticket; list the incidents linked to it with get_linked_incidents (problem_id: ${ticket.id})` : ""
3191
+ ].filter(Boolean);
3192
+ return [`# Relationships of ticket #${ticket.id}`, ...lines.length > 0 ? lines : ["No related tickets: not a follow-up, no follow-ups created from it, not linked to a problem."]].join("\n");
3193
+ };
3194
+ const createTicketRelationTools = (ctx) => {
3195
+ const { subdomain, getToken } = ctx;
3196
+ return [{
3197
+ name: "get_ticket_relations",
3198
+ namespace: "tickets",
3199
+ readOnly: true,
3200
+ title: "Get Zendesk Ticket Relations",
3201
+ description: "List the tickets a Zendesk ticket is linked to (the closed ticket it is a follow-up of, the follow-ups created from it, and for an incident its problem ticket) as ticket ids, one line per relationship present. A closed ticket cannot be reopened, so when the customer replies to one Zendesk opens a new follow-up ticket instead and a single issue ends up split across tickets; use this to walk that chain in either direction, then read each ticket with get_ticket. Follow-ups are listed on the original only once it is closed (Zendesk hides them before), and the source ticket subject is shown when Zendesk provides it. For a problem ticket it points to get_linked_incidents, which lists the incidents linked to it; a ticket with none of these relationships returns a line saying so. Merges and side-conversation child tickets are not covered. Read-only: one ticket fetch, nothing is changed; an unknown ticket id returns a not-found error.",
3202
+ inputSchema: z.object({ ticket_id: z.number().int().describe("Ticket ID — the numeric id of the ticket whose related tickets to list. Obtain it from search_tickets, list_tickets, or a previous get_ticket_relations result to follow the chain.") }),
3203
+ annotations: {
3204
+ readOnlyHint: true,
3205
+ destructiveHint: false,
3206
+ idempotentHint: true,
3207
+ openWorldHint: true
3208
+ },
3209
+ handler: async (params) => {
3210
+ const { ticket_id } = params;
3211
+ const token = await getToken();
3212
+ const { ticket } = await zendeskGet(subdomain, token, `/tickets/${ticket_id}`);
3213
+ return { content: [{
3214
+ type: "text",
3215
+ text: formatTicketRelations(ticket)
3216
+ }] };
3217
+ }
3218
+ }];
3219
+ };
3220
+ //#endregion
3181
3221
  //#region src/tools/tickets.ts
3182
3222
  const MAX_ATTACHMENT_MB = Number.parseFloat((MAX_ATTACHMENT_BYTES / 1048576).toFixed(2));
3183
3223
  const formatReference = (attachment) => `**${attachment.file_name}** (id ${attachment.id}, ${attachment.content_type}, ${attachment.size} bytes) — ${attachment.content_url}`;
@@ -4245,6 +4285,7 @@ const createUserTools = (ctx) => {
4245
4285
  //#region src/tools/index.ts
4246
4286
  const createAllTools = (ctx) => [
4247
4287
  ...createTicketTools(ctx),
4288
+ ...createTicketRelationTools(ctx),
4248
4289
  ...createSearchTools(ctx),
4249
4290
  ...createHelpCenterTools(ctx),
4250
4291
  ...createUserTools(ctx)
@@ -4522,6 +4563,10 @@ const TOOL_MODULES = [
4522
4563
  file: "tickets.ts",
4523
4564
  factory: "createTicketTools"
4524
4565
  },
4566
+ {
4567
+ file: "ticket-relations.ts",
4568
+ factory: "createTicketRelationTools"
4569
+ },
4525
4570
  {
4526
4571
  file: "search.ts",
4527
4572
  factory: "createSearchTools"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lincolnminto/zendesk-mcp-server",
3
- "version": "2.20.0",
3
+ "version": "2.23.0",
4
4
  "mcpName": "io.github.lincolnminto/zendesk-mcp-server",
5
5
  "description": "Deep Zendesk MCP server for your AI assistant: search, draft, update and translate Help Center articles and manage Support tickets end to end — comments, triage and image attachments.",
6
6
  "type": "module",