@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.
- package/bin/opsee-mcp.js +21 -0
- package/gen/api/v1/account_pb.d.ts +393 -0
- package/gen/api/v1/account_pb.js +111 -0
- package/gen/api/v1/activity_log_pb.d.ts +297 -0
- package/gen/api/v1/activity_log_pb.js +89 -0
- package/gen/api/v1/ai_run_status_pb.d.ts +237 -0
- package/gen/api/v1/ai_run_status_pb.js +89 -0
- package/gen/api/v1/ai_unit_category_pb.d.ts +237 -0
- package/gen/api/v1/ai_unit_category_pb.js +89 -0
- package/gen/api/v1/ai_unit_stage_pb.d.ts +347 -0
- package/gen/api/v1/ai_unit_stage_pb.js +117 -0
- package/gen/api/v1/ai_unit_status_pb.d.ts +237 -0
- package/gen/api/v1/ai_unit_status_pb.js +89 -0
- package/gen/api/v1/ai_workflow_run_pb.d.ts +542 -0
- package/gen/api/v1/ai_workflow_run_pb.js +159 -0
- package/gen/api/v1/ai_workflow_unit_pb.d.ts +431 -0
- package/gen/api/v1/ai_workflow_unit_pb.js +103 -0
- package/gen/api/v1/attachment_pb.d.ts +297 -0
- package/gen/api/v1/attachment_pb.js +89 -0
- package/gen/api/v1/billing_pb.d.ts +1206 -0
- package/gen/api/v1/billing_pb.js +288 -0
- package/gen/api/v1/board_column_pb.d.ts +282 -0
- package/gen/api/v1/board_column_pb.js +89 -0
- package/gen/api/v1/board_pb.d.ts +296 -0
- package/gen/api/v1/board_pb.js +96 -0
- package/gen/api/v1/comment_pb.d.ts +277 -0
- package/gen/api/v1/comment_pb.js +89 -0
- package/gen/api/v1/company_pb.d.ts +452 -0
- package/gen/api/v1/company_pb.js +110 -0
- package/gen/api/v1/component_pb.d.ts +267 -0
- package/gen/api/v1/component_pb.js +89 -0
- package/gen/api/v1/contact_pb.d.ts +58 -0
- package/gen/api/v1/contact_pb.js +28 -0
- package/gen/api/v1/country_pb.d.ts +257 -0
- package/gen/api/v1/country_pb.js +89 -0
- package/gen/api/v1/credit_transaction_pb.d.ts +277 -0
- package/gen/api/v1/credit_transaction_pb.js +89 -0
- package/gen/api/v1/cycle_pb.d.ts +281 -0
- package/gen/api/v1/cycle_pb.js +87 -0
- package/gen/api/v1/deployment_pb.d.ts +277 -0
- package/gen/api/v1/deployment_pb.js +89 -0
- package/gen/api/v1/doc_page_pb.d.ts +505 -0
- package/gen/api/v1/doc_page_pb.js +138 -0
- package/gen/api/v1/doc_page_version_pb.d.ts +287 -0
- package/gen/api/v1/doc_page_version_pb.js +89 -0
- package/gen/api/v1/doc_space_pb.d.ts +297 -0
- package/gen/api/v1/doc_space_pb.js +89 -0
- package/gen/api/v1/document_link_pb.d.ts +174 -0
- package/gen/api/v1/document_link_pb.js +61 -0
- package/gen/api/v1/document_pb.d.ts +548 -0
- package/gen/api/v1/document_pb.js +152 -0
- package/gen/api/v1/environment_pb.d.ts +277 -0
- package/gen/api/v1/environment_pb.js +89 -0
- package/gen/api/v1/filter_pb.d.ts +66 -0
- package/gen/api/v1/filter_pb.js +26 -0
- package/gen/api/v1/label_pb.d.ts +267 -0
- package/gen/api/v1/label_pb.js +89 -0
- package/gen/api/v1/models_pb.d.ts +3137 -0
- package/gen/api/v1/models_pb.js +357 -0
- package/gen/api/v1/notification_pb.d.ts +317 -0
- package/gen/api/v1/notification_pb.js +89 -0
- package/gen/api/v1/orchestrator_pb.d.ts +1813 -0
- package/gen/api/v1/orchestrator_pb.js +353 -0
- package/gen/api/v1/pagination_pb.d.ts +92 -0
- package/gen/api/v1/pagination_pb.js +33 -0
- package/gen/api/v1/permission_pb.d.ts +222 -0
- package/gen/api/v1/permission_pb.js +89 -0
- package/gen/api/v1/preference_pb.d.ts +109 -0
- package/gen/api/v1/preference_pb.js +42 -0
- package/gen/api/v1/project_membership_pb.d.ts +321 -0
- package/gen/api/v1/project_membership_pb.js +103 -0
- package/gen/api/v1/project_pb.d.ts +473 -0
- package/gen/api/v1/project_pb.js +145 -0
- package/gen/api/v1/reporting_pb.d.ts +1481 -0
- package/gen/api/v1/reporting_pb.js +373 -0
- package/gen/api/v1/role_pb.d.ts +252 -0
- package/gen/api/v1/role_pb.js +101 -0
- package/gen/api/v1/subscription_pb.d.ts +307 -0
- package/gen/api/v1/subscription_pb.js +89 -0
- package/gen/api/v1/swagger_pb.d.ts +11 -0
- package/gen/api/v1/swagger_pb.js +13 -0
- package/gen/api/v1/task_component_pb.d.ts +242 -0
- package/gen/api/v1/task_component_pb.js +89 -0
- package/gen/api/v1/task_contributor_pb.d.ts +252 -0
- package/gen/api/v1/task_contributor_pb.js +89 -0
- package/gen/api/v1/task_doc_page_pb.d.ts +186 -0
- package/gen/api/v1/task_doc_page_pb.js +73 -0
- package/gen/api/v1/task_document_pb.d.ts +186 -0
- package/gen/api/v1/task_document_pb.js +73 -0
- package/gen/api/v1/task_label_pb.d.ts +242 -0
- package/gen/api/v1/task_label_pb.js +89 -0
- package/gen/api/v1/task_pb.d.ts +780 -0
- package/gen/api/v1/task_pb.js +173 -0
- package/gen/api/v1/task_priority_pb.d.ts +267 -0
- package/gen/api/v1/task_priority_pb.js +89 -0
- package/gen/api/v1/task_repository_pb.d.ts +242 -0
- package/gen/api/v1/task_repository_pb.js +89 -0
- package/gen/api/v1/task_type_pb.d.ts +277 -0
- package/gen/api/v1/task_type_pb.js +89 -0
- package/gen/api/v1/test_run_pb.d.ts +277 -0
- package/gen/api/v1/test_run_pb.js +89 -0
- package/gen/api/v1/user_pb.d.ts +366 -0
- package/gen/api/v1/user_pb.js +117 -0
- package/gen/api/v1/vcs_connection_pb.d.ts +964 -0
- package/gen/api/v1/vcs_connection_pb.js +228 -0
- package/gen/api/v1/vcs_integration_pb.d.ts +479 -0
- package/gen/api/v1/vcs_integration_pb.js +125 -0
- package/gen/api/v1/vcs_pb.d.ts +36 -0
- package/gen/api/v1/vcs_pb.js +24 -0
- package/gen/api/v1/view_pb.d.ts +337 -0
- package/gen/api/v1/view_pb.js +102 -0
- package/gen/google/api/annotations_pb.d.ts +34 -0
- package/gen/google/api/annotations_pb.js +36 -0
- package/gen/google/api/http_pb.d.ts +477 -0
- package/gen/google/api/http_pb.js +47 -0
- package/gen/protoc-gen-openapiv2/options/annotations_pb.d.ts +63 -0
- package/gen/protoc-gen-openapiv2/options/annotations_pb.js +69 -0
- package/gen/protoc-gen-openapiv2/options/openapiv2_pb.d.ts +1497 -0
- package/gen/protoc-gen-openapiv2/options/openapiv2_pb.js +232 -0
- package/gen/validate/validate_pb.d.ts +1953 -0
- package/gen/validate/validate_pb.js +223 -0
- package/package.json +37 -0
- package/src/auth/credentials.ts +65 -0
- package/src/auth/login.ts +96 -0
- package/src/auth/manager.ts +49 -0
- package/src/client/api.ts +91 -0
- package/src/index.ts +13 -0
- package/src/server.ts +26 -0
- package/src/tools/cycles.ts +77 -0
- package/src/tools/docs.ts +148 -0
- package/src/tools/projects.ts +40 -0
- package/src/tools/repositories.ts +41 -0
- package/src/tools/task-metadata.ts +96 -0
- package/src/tools/tasks.ts +228 -0
- package/src/tools/user.ts +33 -0
- 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
|
+
}
|