@telos.ready/mcp 1.7.0 → 1.9.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 +119 -1
  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
@@ -625,6 +627,122 @@ server.tool("raise-ticket", "Creates a new ticket and returns information that m
625
627
  };
626
628
  }
627
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: Get Skill
653
+ server.tool("get-skill", "Retrieves a skill workflow by code or name. Skills are reusable capabilities that AI agents can execute during workflow execution. Parameter accepts either the short skill code or full skill name.", {
654
+ applicationSlug: z
655
+ .string()
656
+ .describe('The application slug for the application context, which is a unique identifier string used to reference specific applications. The application slug is the ticket prefix, such as "TEL" or "XXX".'),
657
+ skillCodeOrName: z
658
+ .string()
659
+ .describe('The skill code or full skill name to retrieve.'),
660
+ }, async ({ applicationSlug, skillCodeOrName }) => {
661
+ try {
662
+ const result = await telosClient.post("/mcp/get-skill", {
663
+ applicationSlug,
664
+ skillCodeOrName,
665
+ });
666
+ if (result.success) {
667
+ return {
668
+ content: [{ type: "text", text: result.result }],
669
+ };
670
+ }
671
+ else {
672
+ return {
673
+ content: [{ type: "text", text: `Error: ${result.error}` }],
674
+ };
675
+ }
676
+ }
677
+ catch (error) {
678
+ return {
679
+ content: [
680
+ {
681
+ type: "text",
682
+ text: `Error getting skill ${skillCodeOrName} for application ${applicationSlug}: ${error.message}`,
683
+ },
684
+ ],
685
+ };
686
+ }
687
+ });
688
+ // Tool 16: Attach Screenshot to Ticket
689
+ 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).", {
690
+ ticketReference: z
691
+ .string()
692
+ .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".'),
693
+ filename: z
694
+ .string()
695
+ .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."),
696
+ }, async ({ ticketReference, filename }) => {
697
+ try {
698
+ // Validate that the file exists
699
+ if (!fs.existsSync(filename)) {
700
+ return {
701
+ content: [
702
+ {
703
+ type: "text",
704
+ text: `Error: File not found at path: ${filename}`,
705
+ },
706
+ ],
707
+ };
708
+ }
709
+ // Read the file from the local filesystem
710
+ const fileBuffer = fs.readFileSync(filename);
711
+ // Encode file content as base64
712
+ const base64Content = fileBuffer.toString("base64");
713
+ // Get the filename without path for display
714
+ const displayFilename = path.basename(filename);
715
+ // Detect content type from file extension
716
+ const contentType = getMimeType(filename);
717
+ // Send to MCPController
718
+ const result = await telosClient.post("/mcp/attach-screenshot", {
719
+ ticketReference,
720
+ base64Content,
721
+ filename: displayFilename,
722
+ contentType,
723
+ });
724
+ if (result.success) {
725
+ return {
726
+ content: [{ type: "text", text: result.result }],
727
+ };
728
+ }
729
+ else {
730
+ return {
731
+ content: [{ type: "text", text: `Error: ${result.error}` }],
732
+ };
733
+ }
734
+ }
735
+ catch (error) {
736
+ return {
737
+ content: [
738
+ {
739
+ type: "text",
740
+ text: `Error attaching screenshot to ticket ${ticketReference}: ${error.message}`,
741
+ },
742
+ ],
743
+ };
744
+ }
745
+ });
628
746
  async function main() {
629
747
  try {
630
748
  // Initialize transport first
@@ -637,7 +755,7 @@ async function main() {
637
755
  await server.connect(transport);
638
756
  // Log success message
639
757
  console.error("✅ Telos MCP Server running on stdio");
640
- 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");
758
+ 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, get-skill, attach-screenshot");
641
759
  // Test connection in background without blocking or exiting
642
760
  // This is non-critical and should not cause the server to exit
643
761
  setImmediate(async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telos.ready/mcp",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Telos MCP server for managing tickets and project tasks",
5
5
  "main": "build/index.js",
6
6
  "type": "module",