@opsee/mcp-server 0.1.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 (136) hide show
  1. package/bin/opsee-mcp.js +21 -0
  2. package/gen/api/v1/account_pb.d.ts +393 -0
  3. package/gen/api/v1/account_pb.js +111 -0
  4. package/gen/api/v1/activity_log_pb.d.ts +297 -0
  5. package/gen/api/v1/activity_log_pb.js +89 -0
  6. package/gen/api/v1/ai_run_status_pb.d.ts +237 -0
  7. package/gen/api/v1/ai_run_status_pb.js +89 -0
  8. package/gen/api/v1/ai_unit_category_pb.d.ts +237 -0
  9. package/gen/api/v1/ai_unit_category_pb.js +89 -0
  10. package/gen/api/v1/ai_unit_stage_pb.d.ts +347 -0
  11. package/gen/api/v1/ai_unit_stage_pb.js +117 -0
  12. package/gen/api/v1/ai_unit_status_pb.d.ts +237 -0
  13. package/gen/api/v1/ai_unit_status_pb.js +89 -0
  14. package/gen/api/v1/ai_workflow_run_pb.d.ts +542 -0
  15. package/gen/api/v1/ai_workflow_run_pb.js +159 -0
  16. package/gen/api/v1/ai_workflow_unit_pb.d.ts +431 -0
  17. package/gen/api/v1/ai_workflow_unit_pb.js +103 -0
  18. package/gen/api/v1/attachment_pb.d.ts +297 -0
  19. package/gen/api/v1/attachment_pb.js +89 -0
  20. package/gen/api/v1/billing_pb.d.ts +1206 -0
  21. package/gen/api/v1/billing_pb.js +288 -0
  22. package/gen/api/v1/board_column_pb.d.ts +282 -0
  23. package/gen/api/v1/board_column_pb.js +89 -0
  24. package/gen/api/v1/board_pb.d.ts +296 -0
  25. package/gen/api/v1/board_pb.js +96 -0
  26. package/gen/api/v1/comment_pb.d.ts +277 -0
  27. package/gen/api/v1/comment_pb.js +89 -0
  28. package/gen/api/v1/company_pb.d.ts +452 -0
  29. package/gen/api/v1/company_pb.js +110 -0
  30. package/gen/api/v1/component_pb.d.ts +267 -0
  31. package/gen/api/v1/component_pb.js +89 -0
  32. package/gen/api/v1/contact_pb.d.ts +58 -0
  33. package/gen/api/v1/contact_pb.js +28 -0
  34. package/gen/api/v1/country_pb.d.ts +257 -0
  35. package/gen/api/v1/country_pb.js +89 -0
  36. package/gen/api/v1/credit_transaction_pb.d.ts +277 -0
  37. package/gen/api/v1/credit_transaction_pb.js +89 -0
  38. package/gen/api/v1/cycle_pb.d.ts +281 -0
  39. package/gen/api/v1/cycle_pb.js +87 -0
  40. package/gen/api/v1/deployment_pb.d.ts +277 -0
  41. package/gen/api/v1/deployment_pb.js +89 -0
  42. package/gen/api/v1/doc_page_pb.d.ts +505 -0
  43. package/gen/api/v1/doc_page_pb.js +138 -0
  44. package/gen/api/v1/doc_page_version_pb.d.ts +287 -0
  45. package/gen/api/v1/doc_page_version_pb.js +89 -0
  46. package/gen/api/v1/doc_space_pb.d.ts +297 -0
  47. package/gen/api/v1/doc_space_pb.js +89 -0
  48. package/gen/api/v1/document_link_pb.d.ts +174 -0
  49. package/gen/api/v1/document_link_pb.js +61 -0
  50. package/gen/api/v1/document_pb.d.ts +548 -0
  51. package/gen/api/v1/document_pb.js +152 -0
  52. package/gen/api/v1/environment_pb.d.ts +277 -0
  53. package/gen/api/v1/environment_pb.js +89 -0
  54. package/gen/api/v1/filter_pb.d.ts +66 -0
  55. package/gen/api/v1/filter_pb.js +26 -0
  56. package/gen/api/v1/label_pb.d.ts +267 -0
  57. package/gen/api/v1/label_pb.js +89 -0
  58. package/gen/api/v1/models_pb.d.ts +3137 -0
  59. package/gen/api/v1/models_pb.js +357 -0
  60. package/gen/api/v1/notification_pb.d.ts +317 -0
  61. package/gen/api/v1/notification_pb.js +89 -0
  62. package/gen/api/v1/orchestrator_pb.d.ts +1813 -0
  63. package/gen/api/v1/orchestrator_pb.js +353 -0
  64. package/gen/api/v1/pagination_pb.d.ts +92 -0
  65. package/gen/api/v1/pagination_pb.js +33 -0
  66. package/gen/api/v1/permission_pb.d.ts +222 -0
  67. package/gen/api/v1/permission_pb.js +89 -0
  68. package/gen/api/v1/preference_pb.d.ts +109 -0
  69. package/gen/api/v1/preference_pb.js +42 -0
  70. package/gen/api/v1/project_membership_pb.d.ts +321 -0
  71. package/gen/api/v1/project_membership_pb.js +103 -0
  72. package/gen/api/v1/project_pb.d.ts +473 -0
  73. package/gen/api/v1/project_pb.js +145 -0
  74. package/gen/api/v1/reporting_pb.d.ts +1481 -0
  75. package/gen/api/v1/reporting_pb.js +373 -0
  76. package/gen/api/v1/role_pb.d.ts +252 -0
  77. package/gen/api/v1/role_pb.js +101 -0
  78. package/gen/api/v1/subscription_pb.d.ts +307 -0
  79. package/gen/api/v1/subscription_pb.js +89 -0
  80. package/gen/api/v1/swagger_pb.d.ts +11 -0
  81. package/gen/api/v1/swagger_pb.js +13 -0
  82. package/gen/api/v1/task_component_pb.d.ts +242 -0
  83. package/gen/api/v1/task_component_pb.js +89 -0
  84. package/gen/api/v1/task_contributor_pb.d.ts +252 -0
  85. package/gen/api/v1/task_contributor_pb.js +89 -0
  86. package/gen/api/v1/task_doc_page_pb.d.ts +186 -0
  87. package/gen/api/v1/task_doc_page_pb.js +73 -0
  88. package/gen/api/v1/task_document_pb.d.ts +186 -0
  89. package/gen/api/v1/task_document_pb.js +73 -0
  90. package/gen/api/v1/task_label_pb.d.ts +242 -0
  91. package/gen/api/v1/task_label_pb.js +89 -0
  92. package/gen/api/v1/task_pb.d.ts +780 -0
  93. package/gen/api/v1/task_pb.js +173 -0
  94. package/gen/api/v1/task_priority_pb.d.ts +267 -0
  95. package/gen/api/v1/task_priority_pb.js +89 -0
  96. package/gen/api/v1/task_repository_pb.d.ts +242 -0
  97. package/gen/api/v1/task_repository_pb.js +89 -0
  98. package/gen/api/v1/task_type_pb.d.ts +277 -0
  99. package/gen/api/v1/task_type_pb.js +89 -0
  100. package/gen/api/v1/test_run_pb.d.ts +277 -0
  101. package/gen/api/v1/test_run_pb.js +89 -0
  102. package/gen/api/v1/user_pb.d.ts +366 -0
  103. package/gen/api/v1/user_pb.js +117 -0
  104. package/gen/api/v1/vcs_connection_pb.d.ts +964 -0
  105. package/gen/api/v1/vcs_connection_pb.js +228 -0
  106. package/gen/api/v1/vcs_integration_pb.d.ts +479 -0
  107. package/gen/api/v1/vcs_integration_pb.js +125 -0
  108. package/gen/api/v1/vcs_pb.d.ts +36 -0
  109. package/gen/api/v1/vcs_pb.js +24 -0
  110. package/gen/api/v1/view_pb.d.ts +337 -0
  111. package/gen/api/v1/view_pb.js +102 -0
  112. package/gen/google/api/annotations_pb.d.ts +34 -0
  113. package/gen/google/api/annotations_pb.js +36 -0
  114. package/gen/google/api/http_pb.d.ts +477 -0
  115. package/gen/google/api/http_pb.js +47 -0
  116. package/gen/protoc-gen-openapiv2/options/annotations_pb.d.ts +63 -0
  117. package/gen/protoc-gen-openapiv2/options/annotations_pb.js +69 -0
  118. package/gen/protoc-gen-openapiv2/options/openapiv2_pb.d.ts +1497 -0
  119. package/gen/protoc-gen-openapiv2/options/openapiv2_pb.js +232 -0
  120. package/gen/validate/validate_pb.d.ts +1953 -0
  121. package/gen/validate/validate_pb.js +223 -0
  122. package/package.json +37 -0
  123. package/src/auth/credentials.ts +65 -0
  124. package/src/auth/login.ts +96 -0
  125. package/src/auth/manager.ts +49 -0
  126. package/src/client/api.ts +91 -0
  127. package/src/index.ts +13 -0
  128. package/src/server.ts +26 -0
  129. package/src/tools/cycles.ts +77 -0
  130. package/src/tools/docs.ts +148 -0
  131. package/src/tools/projects.ts +40 -0
  132. package/src/tools/repositories.ts +41 -0
  133. package/src/tools/task-metadata.ts +96 -0
  134. package/src/tools/tasks.ts +228 -0
  135. package/src/tools/user.ts +33 -0
  136. package/src/utils/format.ts +141 -0
@@ -0,0 +1,141 @@
1
+ import type { Task, Project, Cycle, DocPage, DocSpace } from "../../gen/api/v1/models_pb.js";
2
+
3
+ export function formatProject(p: Project): string {
4
+ const lines = [
5
+ `${p.name} (${p.shortName})`,
6
+ ` Slug: ${p.slug}`,
7
+ ];
8
+ if (p.description) lines.push(` Description: ${p.description}`);
9
+ lines.push(` Active: ${p.isActive ? "Yes" : "No"}`);
10
+ lines.push(` ID: ${p.id}`);
11
+ return lines.join("\n");
12
+ }
13
+
14
+ export function formatProjectList(projects: Project[]): string {
15
+ if (projects.length === 0) return "No projects found.";
16
+ const header = `Found ${projects.length} project(s):\n`;
17
+ return (
18
+ header +
19
+ projects.map((p, i) => `${i + 1}. ${formatProject(p)}`).join("\n\n")
20
+ );
21
+ }
22
+
23
+ export function formatTask(t: Task): string {
24
+ const lines = [`[${t.identifier}] ${t.title}`];
25
+
26
+ const status = t.boardColumn?.name || "Unknown";
27
+ const priority = t.taskPriority?.name || "None";
28
+ const type = t.taskType?.name || "Unknown";
29
+ lines.push(` Status: ${status} | Priority: ${priority} | Type: ${type}`);
30
+
31
+ const assignee = t.assignedUser?.fullName || "Unassigned";
32
+ const cycle = t.cycle?.name || "None";
33
+ lines.push(` Assignee: ${assignee} | Cycle: ${cycle}`);
34
+
35
+ if (t.description) {
36
+ const desc =
37
+ t.description.length > 200
38
+ ? t.description.substring(0, 200) + "..."
39
+ : t.description;
40
+ lines.push(` Description: ${desc}`);
41
+ }
42
+
43
+ if (t.dueDate) {
44
+ lines.push(` Due: ${new Date(Number(t.dueDate.seconds) * 1000).toISOString().split("T")[0]}`);
45
+ }
46
+
47
+ lines.push(` ID: ${t.id}`);
48
+ return lines.join("\n");
49
+ }
50
+
51
+ export function formatTaskList(tasks: Task[], projectName?: string): string {
52
+ if (tasks.length === 0) return "No tasks found.";
53
+ const header = projectName
54
+ ? `Found ${tasks.length} task(s) in project "${projectName}":\n`
55
+ : `Found ${tasks.length} task(s):\n`;
56
+ return (
57
+ header + tasks.map((t, i) => `${i + 1}. ${formatTask(t)}`).join("\n\n")
58
+ );
59
+ }
60
+
61
+ export function formatCycle(c: Cycle): string {
62
+ const lines = [`${c.name}`];
63
+ if (c.description) lines.push(` Description: ${c.description}`);
64
+ if (c.goal) lines.push(` Goal: ${c.goal}`);
65
+ lines.push(` Start: ${c.startDate} | End: ${c.endDate}`);
66
+ lines.push(` Active: ${c.isActive ? "Yes" : "No"}`);
67
+ lines.push(` ID: ${c.id}`);
68
+ return lines.join("\n");
69
+ }
70
+
71
+ export function formatCycleList(cycles: Cycle[]): string {
72
+ if (cycles.length === 0) return "No cycles found.";
73
+ const header = `Found ${cycles.length} cycle(s):\n`;
74
+ return (
75
+ header + cycles.map((c, i) => `${i + 1}. ${formatCycle(c)}`).join("\n\n")
76
+ );
77
+ }
78
+
79
+ export function formatDocSpace(s: DocSpace): string {
80
+ const lines = [`${s.title}`];
81
+ if (s.description) lines.push(` Description: ${s.description}`);
82
+ lines.push(` Slug: ${s.slug}`);
83
+ lines.push(` Default: ${s.isDefault ? "Yes" : "No"}`);
84
+ lines.push(` ID: ${s.id}`);
85
+ return lines.join("\n");
86
+ }
87
+
88
+ export function formatDocSpaceList(spaces: DocSpace[]): string {
89
+ if (spaces.length === 0) return "No doc spaces found.";
90
+ const header = `Found ${spaces.length} doc space(s):\n`;
91
+ return (
92
+ header +
93
+ spaces.map((s, i) => `${i + 1}. ${formatDocSpace(s)}`).join("\n\n")
94
+ );
95
+ }
96
+
97
+ export function formatDocPage(p: DocPage): string {
98
+ const lines = [`${p.title}`];
99
+ lines.push(` Slug: ${p.slug}`);
100
+ if (p.currentContent) {
101
+ const content =
102
+ p.currentContent.length > 500
103
+ ? p.currentContent.substring(0, 500) + "..."
104
+ : p.currentContent;
105
+ lines.push(` Content: ${content}`);
106
+ }
107
+ lines.push(` Version: ${p.currentVersionNumber}`);
108
+ if (p.createdByUser) lines.push(` Author: ${p.createdByUser.fullName}`);
109
+ lines.push(` ID: ${p.id}`);
110
+ return lines.join("\n");
111
+ }
112
+
113
+ export function formatDocPageList(pages: DocPage[]): string {
114
+ if (pages.length === 0) return "No doc pages found.";
115
+ const header = `Found ${pages.length} doc page(s):\n`;
116
+ return (
117
+ header +
118
+ pages
119
+ .map(
120
+ (p, i) =>
121
+ `${i + 1}. ${p.title} (slug: ${p.slug}, ID: ${p.id})`
122
+ )
123
+ .join("\n")
124
+ );
125
+ }
126
+
127
+ export function formatError(error: unknown): string {
128
+ if (error instanceof Error) {
129
+ if (error.message.includes("401") || error.message.includes("Unauthenticated")) {
130
+ return "Not authenticated. Run `npx opsee-mcp login` to connect your Opsee account.";
131
+ }
132
+ if (error.message.includes("not found") || error.message.includes("404")) {
133
+ return `Not found. ${error.message}`;
134
+ }
135
+ if (error.message.includes("ECONNREFUSED") || error.message.includes("ENOTFOUND")) {
136
+ return "Could not reach Opsee API. Check your connection and OPSEE_API_URL.";
137
+ }
138
+ return error.message;
139
+ }
140
+ return String(error);
141
+ }