@telos.ready/mcp 1.6.0 → 1.8.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.
Files changed (2) hide show
  1. package/build/index.js +154 -2
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -3,6 +3,8 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { z } from "zod";
5
5
  import axios from "axios";
6
+ import * as fs from "fs";
7
+ import * as path from "path";
6
8
  // Configuration
7
9
  const DEFAULT_TELOS_BASE_URL = "https://go.telosready.com";
8
10
  // Create server instance
@@ -478,7 +480,7 @@ server.tool("get-resource-list", "Gets a list of resources for an application. R
478
480
  }
479
481
  });
480
482
  // Tool 12: Get Resource Details
481
- server.tool("get-resource-details", "Gets detailed information about a specific resource by name and group. Resource names can be identified by using get-resource-list. Special resources include: Application Map, Style Guide, Tech Patterns, Database Schema", {
483
+ server.tool("get-resource-details", "Gets detailed information about a specific resource by name and group. Resource names can be identified by using get-resource-list. Special resources include: Application Map, Style Guide, Tech Patterns, Database Schema, User Guide", {
482
484
  applicationSlug: z
483
485
  .string()
484
486
  .describe('The application slug for the application you want to get resource details for, which is a unique identifier string used to reference specific applications. The application slug is the ticket prefix, such as "TEL" or "XXX".'),
@@ -555,6 +557,156 @@ server.tool("answer-question", "Answers a question that was previously asked wit
555
557
  };
556
558
  }
557
559
  });
560
+ // Tool 14: Raise Ticket
561
+ server.tool("raise-ticket", "Creates a new ticket and returns information that may be useful when implementing the ticket. Tickets represent a unit-of-work that is being done for an application. After the ticket has been raised, comments can be added to the ticket using the add-ticket-comment tool.", {
562
+ applicationSlug: z
563
+ .string()
564
+ .describe('The application slug, such as "TEL".'),
565
+ title: z
566
+ .string()
567
+ .describe("The title of the ticket to create."),
568
+ description: z
569
+ .string()
570
+ .describe("The description of the ticket to create."),
571
+ parentTicketReference: z
572
+ .string()
573
+ .optional()
574
+ .describe('Optional parent ticket reference - if provided, the new ticket will be linked to the parent ticket as a child ticket. Format: TEL123'),
575
+ priority: z
576
+ .string()
577
+ .optional()
578
+ .describe("The priority of the ticket. Options: Urgent, High, Medium, Low, None. Defaults to Medium."),
579
+ credits: z
580
+ .string()
581
+ .optional()
582
+ .describe("The credits for the ticket. Set to 0 unless requested otherwise."),
583
+ stageName: z
584
+ .string()
585
+ .optional()
586
+ .describe("Optional name of the stage to assign the ticket to. Must match an active stage."),
587
+ workflowName: z
588
+ .string()
589
+ .optional()
590
+ .describe("Optional name of a workflow to execute when the ticket is created."),
591
+ ticketType: z
592
+ .string()
593
+ .optional()
594
+ .describe("The type of ticket. Options: SUPPORTREQUEST, DEVELOPMENT, BACKLOG, RECOMMENDATION, KNOWLEDGE. Defaults to DEVELOPMENT or inherits from parent."),
595
+ }, async ({ applicationSlug, title, description, parentTicketReference, priority, credits, stageName, workflowName, ticketType, }) => {
596
+ try {
597
+ const result = await telosClient.post("/mcp/raise-ticket", {
598
+ applicationSlug,
599
+ title,
600
+ description,
601
+ parentTicketReference,
602
+ priority,
603
+ credits,
604
+ stageName,
605
+ workflowName,
606
+ ticketType,
607
+ });
608
+ if (result.success) {
609
+ return {
610
+ content: [{ type: "text", text: result.result }],
611
+ };
612
+ }
613
+ else {
614
+ return {
615
+ content: [{ type: "text", text: `Error: ${result.error}` }],
616
+ };
617
+ }
618
+ }
619
+ catch (error) {
620
+ return {
621
+ content: [
622
+ {
623
+ type: "text",
624
+ text: `Error creating ticket in application ${applicationSlug}: ${error.message}`,
625
+ },
626
+ ],
627
+ };
628
+ }
629
+ });
630
+ // Helper function to get MIME type from file extension
631
+ function getMimeType(filename) {
632
+ const ext = path.extname(filename).toLowerCase();
633
+ const mimeTypes = {
634
+ ".png": "image/png",
635
+ ".jpg": "image/jpeg",
636
+ ".jpeg": "image/jpeg",
637
+ ".gif": "image/gif",
638
+ ".webp": "image/webp",
639
+ ".bmp": "image/bmp",
640
+ ".svg": "image/svg+xml",
641
+ ".pdf": "application/pdf",
642
+ ".txt": "text/plain",
643
+ ".html": "text/html",
644
+ ".css": "text/css",
645
+ ".js": "application/javascript",
646
+ ".json": "application/json",
647
+ ".xml": "application/xml",
648
+ ".zip": "application/zip",
649
+ };
650
+ return mimeTypes[ext] || "application/octet-stream";
651
+ }
652
+ // Tool 15: Attach Screenshot to Ticket
653
+ server.tool("attach-screenshot", "Attaches a screenshot or image file from the local filesystem to a ticket. The tool reads the file from the provided path, encodes it, and uploads it as an attachment to the specified ticket. Supports common image formats (PNG, JPG, GIF, WebP).", {
654
+ ticketReference: z
655
+ .string()
656
+ .describe('The ticket reference for the ticket to attach the screenshot to, which is an uppercase alphabetical code followed by a number, such as "TEL037".'),
657
+ filename: z
658
+ .string()
659
+ .describe("The path to the screenshot file on the local filesystem. This should be an absolute path or a path relative to the current working directory."),
660
+ }, async ({ ticketReference, filename }) => {
661
+ try {
662
+ // Validate that the file exists
663
+ if (!fs.existsSync(filename)) {
664
+ return {
665
+ content: [
666
+ {
667
+ type: "text",
668
+ text: `Error: File not found at path: ${filename}`,
669
+ },
670
+ ],
671
+ };
672
+ }
673
+ // Read the file from the local filesystem
674
+ const fileBuffer = fs.readFileSync(filename);
675
+ // Encode file content as base64
676
+ const base64Content = fileBuffer.toString("base64");
677
+ // Get the filename without path for display
678
+ const displayFilename = path.basename(filename);
679
+ // Detect content type from file extension
680
+ const contentType = getMimeType(filename);
681
+ // Send to MCPController
682
+ const result = await telosClient.post("/mcp/attach-screenshot", {
683
+ ticketReference,
684
+ base64Content,
685
+ filename: displayFilename,
686
+ contentType,
687
+ });
688
+ if (result.success) {
689
+ return {
690
+ content: [{ type: "text", text: result.result }],
691
+ };
692
+ }
693
+ else {
694
+ return {
695
+ content: [{ type: "text", text: `Error: ${result.error}` }],
696
+ };
697
+ }
698
+ }
699
+ catch (error) {
700
+ return {
701
+ content: [
702
+ {
703
+ type: "text",
704
+ text: `Error attaching screenshot to ticket ${ticketReference}: ${error.message}`,
705
+ },
706
+ ],
707
+ };
708
+ }
709
+ });
558
710
  async function main() {
559
711
  try {
560
712
  // Initialize transport first
@@ -567,7 +719,7 @@ async function main() {
567
719
  await server.connect(transport);
568
720
  // Log success message
569
721
  console.error("✅ Telos MCP Server running on stdio");
570
- console.error("Available tools: ask-question, search-documentation, add-ticket-comment, add-documentation, get-ticket-details, start-ticket, get-next-task, get-git-branch-for-ticket, mark-ticket-as-blocked, update-action-item, get-resource-list, get-resource-details, answer-question");
722
+ console.error("Available tools: ask-question, search-documentation, add-ticket-comment, add-documentation, get-ticket-details, start-ticket, get-next-task, get-git-branch-for-ticket, mark-ticket-as-blocked, update-action-item, get-resource-list, get-resource-details, answer-question, raise-ticket, attach-screenshot");
571
723
  // Test connection in background without blocking or exiting
572
724
  // This is non-critical and should not cause the server to exit
573
725
  setImmediate(async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telos.ready/mcp",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Telos MCP server for managing tickets and project tasks",
5
5
  "main": "build/index.js",
6
6
  "type": "module",