@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,223 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.2.3
|
|
2
|
+
// @generated from file validate/validate.proto (package validate, syntax proto2)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import { enumDesc, extDesc, fileDesc, messageDesc, tsEnum } from "@bufbuild/protobuf/codegenv1";
|
|
6
|
+
import { file_google_protobuf_descriptor, file_google_protobuf_duration, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Describes the file validate/validate.proto.
|
|
10
|
+
*/
|
|
11
|
+
export const file_validate_validate = /*@__PURE__*/
|
|
12
|
+
fileDesc("Chd2YWxpZGF0ZS92YWxpZGF0ZS5wcm90bxIIdmFsaWRhdGUimAcKCkZpZWxkUnVsZXMSJwoHbWVzc2FnZRgRIAEoCzIWLnZhbGlkYXRlLk1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dWlyZWQYASABKAgSKQoFY29uc3QYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEiYKAmx0GAMgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBInCgNsdGUYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEiYKAmd0GAUgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBInCgNndGUYBiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEg4KBmx0X25vdxgHIAEoCBIOCgZndF9ub3cYCCABKAgSKQoGd2l0aGluGAkgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uKkYKCktub3duUmVnZXgSCwoHVU5LTk9XThAAEhQKEEhUVFBfSEVBREVSX05BTUUQARIVChFIVFRQX0hFQURFUl9WQUxVRRACOjwKCGRpc2FibGVkEh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGK8IIAEoCFIIZGlzYWJsZWQ6OgoHaWdub3JlZBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxiwCCABKAhSB2lnbm9yZWQ6OgoIcmVxdWlyZWQSHS5nb29nbGUucHJvdG9idWYuT25lb2ZPcHRpb25zGK8IIAEoCFIIcmVxdWlyZWQ6SgoFcnVsZXMSHS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGK8IIAEoCzIULnZhbGlkYXRlLkZpZWxkUnVsZXNSBXJ1bGVzQpEBCgxjb20udmFsaWRhdGVCDVZhbGlkYXRlUHJvdG9QAVoyZ2l0aHViLmNvbS9lbnZveXByb3h5L3Byb3RvYy1nZW4tdmFsaWRhdGUvdmFsaWRhdGWiAgNWWFiqAghWYWxpZGF0ZcoCCFZhbGlkYXRl4gIUVmFsaWRhdGVcR1BCTWV0YWRhdGHqAghWYWxpZGF0ZQ", [file_google_protobuf_descriptor, file_google_protobuf_duration, file_google_protobuf_timestamp]);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Describes the message validate.FieldRules.
|
|
16
|
+
* Use `create(FieldRulesSchema)` to create a new message.
|
|
17
|
+
*/
|
|
18
|
+
export const FieldRulesSchema = /*@__PURE__*/
|
|
19
|
+
messageDesc(file_validate_validate, 0);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Describes the message validate.FloatRules.
|
|
23
|
+
* Use `create(FloatRulesSchema)` to create a new message.
|
|
24
|
+
*/
|
|
25
|
+
export const FloatRulesSchema = /*@__PURE__*/
|
|
26
|
+
messageDesc(file_validate_validate, 1);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Describes the message validate.DoubleRules.
|
|
30
|
+
* Use `create(DoubleRulesSchema)` to create a new message.
|
|
31
|
+
*/
|
|
32
|
+
export const DoubleRulesSchema = /*@__PURE__*/
|
|
33
|
+
messageDesc(file_validate_validate, 2);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Describes the message validate.Int32Rules.
|
|
37
|
+
* Use `create(Int32RulesSchema)` to create a new message.
|
|
38
|
+
*/
|
|
39
|
+
export const Int32RulesSchema = /*@__PURE__*/
|
|
40
|
+
messageDesc(file_validate_validate, 3);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Describes the message validate.Int64Rules.
|
|
44
|
+
* Use `create(Int64RulesSchema)` to create a new message.
|
|
45
|
+
*/
|
|
46
|
+
export const Int64RulesSchema = /*@__PURE__*/
|
|
47
|
+
messageDesc(file_validate_validate, 4);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Describes the message validate.UInt32Rules.
|
|
51
|
+
* Use `create(UInt32RulesSchema)` to create a new message.
|
|
52
|
+
*/
|
|
53
|
+
export const UInt32RulesSchema = /*@__PURE__*/
|
|
54
|
+
messageDesc(file_validate_validate, 5);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Describes the message validate.UInt64Rules.
|
|
58
|
+
* Use `create(UInt64RulesSchema)` to create a new message.
|
|
59
|
+
*/
|
|
60
|
+
export const UInt64RulesSchema = /*@__PURE__*/
|
|
61
|
+
messageDesc(file_validate_validate, 6);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Describes the message validate.SInt32Rules.
|
|
65
|
+
* Use `create(SInt32RulesSchema)` to create a new message.
|
|
66
|
+
*/
|
|
67
|
+
export const SInt32RulesSchema = /*@__PURE__*/
|
|
68
|
+
messageDesc(file_validate_validate, 7);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Describes the message validate.SInt64Rules.
|
|
72
|
+
* Use `create(SInt64RulesSchema)` to create a new message.
|
|
73
|
+
*/
|
|
74
|
+
export const SInt64RulesSchema = /*@__PURE__*/
|
|
75
|
+
messageDesc(file_validate_validate, 8);
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Describes the message validate.Fixed32Rules.
|
|
79
|
+
* Use `create(Fixed32RulesSchema)` to create a new message.
|
|
80
|
+
*/
|
|
81
|
+
export const Fixed32RulesSchema = /*@__PURE__*/
|
|
82
|
+
messageDesc(file_validate_validate, 9);
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Describes the message validate.Fixed64Rules.
|
|
86
|
+
* Use `create(Fixed64RulesSchema)` to create a new message.
|
|
87
|
+
*/
|
|
88
|
+
export const Fixed64RulesSchema = /*@__PURE__*/
|
|
89
|
+
messageDesc(file_validate_validate, 10);
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Describes the message validate.SFixed32Rules.
|
|
93
|
+
* Use `create(SFixed32RulesSchema)` to create a new message.
|
|
94
|
+
*/
|
|
95
|
+
export const SFixed32RulesSchema = /*@__PURE__*/
|
|
96
|
+
messageDesc(file_validate_validate, 11);
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Describes the message validate.SFixed64Rules.
|
|
100
|
+
* Use `create(SFixed64RulesSchema)` to create a new message.
|
|
101
|
+
*/
|
|
102
|
+
export const SFixed64RulesSchema = /*@__PURE__*/
|
|
103
|
+
messageDesc(file_validate_validate, 12);
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Describes the message validate.BoolRules.
|
|
107
|
+
* Use `create(BoolRulesSchema)` to create a new message.
|
|
108
|
+
*/
|
|
109
|
+
export const BoolRulesSchema = /*@__PURE__*/
|
|
110
|
+
messageDesc(file_validate_validate, 13);
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Describes the message validate.StringRules.
|
|
114
|
+
* Use `create(StringRulesSchema)` to create a new message.
|
|
115
|
+
*/
|
|
116
|
+
export const StringRulesSchema = /*@__PURE__*/
|
|
117
|
+
messageDesc(file_validate_validate, 14);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Describes the message validate.BytesRules.
|
|
121
|
+
* Use `create(BytesRulesSchema)` to create a new message.
|
|
122
|
+
*/
|
|
123
|
+
export const BytesRulesSchema = /*@__PURE__*/
|
|
124
|
+
messageDesc(file_validate_validate, 15);
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Describes the message validate.EnumRules.
|
|
128
|
+
* Use `create(EnumRulesSchema)` to create a new message.
|
|
129
|
+
*/
|
|
130
|
+
export const EnumRulesSchema = /*@__PURE__*/
|
|
131
|
+
messageDesc(file_validate_validate, 16);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Describes the message validate.MessageRules.
|
|
135
|
+
* Use `create(MessageRulesSchema)` to create a new message.
|
|
136
|
+
*/
|
|
137
|
+
export const MessageRulesSchema = /*@__PURE__*/
|
|
138
|
+
messageDesc(file_validate_validate, 17);
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Describes the message validate.RepeatedRules.
|
|
142
|
+
* Use `create(RepeatedRulesSchema)` to create a new message.
|
|
143
|
+
*/
|
|
144
|
+
export const RepeatedRulesSchema = /*@__PURE__*/
|
|
145
|
+
messageDesc(file_validate_validate, 18);
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Describes the message validate.MapRules.
|
|
149
|
+
* Use `create(MapRulesSchema)` to create a new message.
|
|
150
|
+
*/
|
|
151
|
+
export const MapRulesSchema = /*@__PURE__*/
|
|
152
|
+
messageDesc(file_validate_validate, 19);
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Describes the message validate.AnyRules.
|
|
156
|
+
* Use `create(AnyRulesSchema)` to create a new message.
|
|
157
|
+
*/
|
|
158
|
+
export const AnyRulesSchema = /*@__PURE__*/
|
|
159
|
+
messageDesc(file_validate_validate, 20);
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Describes the message validate.DurationRules.
|
|
163
|
+
* Use `create(DurationRulesSchema)` to create a new message.
|
|
164
|
+
*/
|
|
165
|
+
export const DurationRulesSchema = /*@__PURE__*/
|
|
166
|
+
messageDesc(file_validate_validate, 21);
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Describes the message validate.TimestampRules.
|
|
170
|
+
* Use `create(TimestampRulesSchema)` to create a new message.
|
|
171
|
+
*/
|
|
172
|
+
export const TimestampRulesSchema = /*@__PURE__*/
|
|
173
|
+
messageDesc(file_validate_validate, 22);
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Describes the enum validate.KnownRegex.
|
|
177
|
+
*/
|
|
178
|
+
export const KnownRegexSchema = /*@__PURE__*/
|
|
179
|
+
enumDesc(file_validate_validate, 0);
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* WellKnownRegex contain some well-known patterns.
|
|
183
|
+
*
|
|
184
|
+
* @generated from enum validate.KnownRegex
|
|
185
|
+
*/
|
|
186
|
+
export const KnownRegex = /*@__PURE__*/
|
|
187
|
+
tsEnum(KnownRegexSchema);
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Disabled nullifies any validation rules for this message, including any
|
|
191
|
+
* message fields associated with it that do support validation.
|
|
192
|
+
*
|
|
193
|
+
* @generated from extension: optional bool disabled = 1071;
|
|
194
|
+
*/
|
|
195
|
+
export const disabled = /*@__PURE__*/
|
|
196
|
+
extDesc(file_validate_validate, 0);
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Ignore skips generation of validation methods for this message.
|
|
200
|
+
*
|
|
201
|
+
* @generated from extension: optional bool ignored = 1072;
|
|
202
|
+
*/
|
|
203
|
+
export const ignored = /*@__PURE__*/
|
|
204
|
+
extDesc(file_validate_validate, 1);
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Required ensures that exactly one the field options in a oneof is set;
|
|
208
|
+
* validation fails if no fields in the oneof are set.
|
|
209
|
+
*
|
|
210
|
+
* @generated from extension: optional bool required = 1071;
|
|
211
|
+
*/
|
|
212
|
+
export const required = /*@__PURE__*/
|
|
213
|
+
extDesc(file_validate_validate, 2);
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Rules specify the validations to be performed on this field. By default,
|
|
217
|
+
* no validation is performed against a field.
|
|
218
|
+
*
|
|
219
|
+
* @generated from extension: optional validate.FieldRules rules = 1071;
|
|
220
|
+
*/
|
|
221
|
+
export const rules = /*@__PURE__*/
|
|
222
|
+
extDesc(file_validate_validate, 3);
|
|
223
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opsee/mcp-server",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Opsee MCP server — manage projects, tasks, docs, and cycles from AI coding environments",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"opsee-mcp": "./bin/opsee-mcp.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc --noEmit",
|
|
11
|
+
"start": "npx tsx src/index.ts",
|
|
12
|
+
"proto-local": "rm -rf ./gen && cd .. && buf build -o mcp/descriptor.bin && cd mcp && buf generate --include-imports descriptor.bin && rm descriptor.bin",
|
|
13
|
+
"proto": "rm -rf ./gen && curl -k 'https://general.storage.codilas.link/opsee/proto/descriptor.bin' --output ./descriptor.bin && buf generate --include-imports descriptor.bin && rm ./descriptor.bin",
|
|
14
|
+
"lint": "tsc --noEmit"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@bufbuild/protobuf": "^2.2.3",
|
|
18
|
+
"@connectrpc/connect": "^2.0.2",
|
|
19
|
+
"@connectrpc/connect-node": "^2.0.2",
|
|
20
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
21
|
+
"open": "^10.1.0",
|
|
22
|
+
"tsx": "^4.21.0",
|
|
23
|
+
"zod": "^4.3.6"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^22.13.0",
|
|
27
|
+
"typescript": "^5.7.0"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18.0.0"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"src",
|
|
34
|
+
"bin",
|
|
35
|
+
"gen"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join, dirname } from "node:path";
|
|
4
|
+
|
|
5
|
+
export interface Credentials {
|
|
6
|
+
token: string;
|
|
7
|
+
serverUrl: string;
|
|
8
|
+
userId: string;
|
|
9
|
+
companyId: string;
|
|
10
|
+
expiresAt: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function getCredentialsPath(): string {
|
|
14
|
+
if (process.env.OPSEE_CREDENTIALS_PATH) {
|
|
15
|
+
return process.env.OPSEE_CREDENTIALS_PATH;
|
|
16
|
+
}
|
|
17
|
+
return join(homedir(), ".opsee", "credentials.json");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function readCredentials(): Credentials | null {
|
|
21
|
+
// Environment variable token takes precedence (for CI/headless)
|
|
22
|
+
if (process.env.OPSEE_API_TOKEN) {
|
|
23
|
+
return {
|
|
24
|
+
token: process.env.OPSEE_API_TOKEN,
|
|
25
|
+
serverUrl: process.env.OPSEE_API_URL || "https://api.opsee.dev",
|
|
26
|
+
userId: "",
|
|
27
|
+
companyId: "",
|
|
28
|
+
expiresAt: "",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const path = getCredentialsPath();
|
|
33
|
+
if (!existsSync(path)) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
const data = JSON.parse(readFileSync(path, "utf-8"));
|
|
39
|
+
if (!data.token) return null;
|
|
40
|
+
return data as Credentials;
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function writeCredentials(credentials: Credentials): void {
|
|
47
|
+
const path = getCredentialsPath();
|
|
48
|
+
const dir = dirname(path);
|
|
49
|
+
|
|
50
|
+
if (!existsSync(dir)) {
|
|
51
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
writeFileSync(path, JSON.stringify(credentials, null, 2), {
|
|
55
|
+
mode: 0o600,
|
|
56
|
+
encoding: "utf-8",
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function clearCredentials(): void {
|
|
61
|
+
const path = getCredentialsPath();
|
|
62
|
+
if (existsSync(path)) {
|
|
63
|
+
writeFileSync(path, "{}", { mode: 0o600, encoding: "utf-8" });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { createServer as createHttpServer, type IncomingMessage, type ServerResponse } from "node:http";
|
|
2
|
+
import { writeCredentials, type Credentials } from "./credentials.js";
|
|
3
|
+
|
|
4
|
+
const SUCCESS_HTML = `<!DOCTYPE html>
|
|
5
|
+
<html>
|
|
6
|
+
<head><title>Opsee MCP - Connected</title></head>
|
|
7
|
+
<body style="font-family: system-ui; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #f8f9fa;">
|
|
8
|
+
<div style="text-align: center; padding: 2rem;">
|
|
9
|
+
<h1 style="color: #10b981;">Connected!</h1>
|
|
10
|
+
<p>Your Opsee account is now linked to the MCP server.</p>
|
|
11
|
+
<p style="color: #6b7280;">You can close this window.</p>
|
|
12
|
+
</div>
|
|
13
|
+
</body>
|
|
14
|
+
</html>`;
|
|
15
|
+
|
|
16
|
+
const ERROR_HTML = `<!DOCTYPE html>
|
|
17
|
+
<html>
|
|
18
|
+
<head><title>Opsee MCP - Error</title></head>
|
|
19
|
+
<body style="font-family: system-ui; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #f8f9fa;">
|
|
20
|
+
<div style="text-align: center; padding: 2rem;">
|
|
21
|
+
<h1 style="color: #ef4444;">Authentication Failed</h1>
|
|
22
|
+
<p>Could not connect your Opsee account. Please try again.</p>
|
|
23
|
+
</div>
|
|
24
|
+
</body>
|
|
25
|
+
</html>`;
|
|
26
|
+
|
|
27
|
+
export async function startLoginFlow(): Promise<void> {
|
|
28
|
+
const port = 9876;
|
|
29
|
+
const callbackUrl = `http://localhost:${port}/callback`;
|
|
30
|
+
const appUrl = process.env.OPSEE_APP_URL || "https://app.opsee.dev";
|
|
31
|
+
const loginUrl = `${appUrl}/auth/mcp?callback=${encodeURIComponent(callbackUrl)}`;
|
|
32
|
+
|
|
33
|
+
return new Promise<void>((resolve, reject) => {
|
|
34
|
+
const server = createHttpServer((req: IncomingMessage, res: ServerResponse) => {
|
|
35
|
+
const url = new URL(req.url || "/", `http://localhost:${port}`);
|
|
36
|
+
|
|
37
|
+
if (url.pathname === "/callback") {
|
|
38
|
+
const token = url.searchParams.get("token");
|
|
39
|
+
const userId = url.searchParams.get("userId") || "";
|
|
40
|
+
const companyId = url.searchParams.get("companyId") || "";
|
|
41
|
+
const expiresAt = url.searchParams.get("expiresAt") || "";
|
|
42
|
+
|
|
43
|
+
if (token) {
|
|
44
|
+
const credentials: Credentials = {
|
|
45
|
+
token,
|
|
46
|
+
serverUrl: process.env.OPSEE_API_URL || "https://api.opsee.dev",
|
|
47
|
+
userId,
|
|
48
|
+
companyId,
|
|
49
|
+
expiresAt,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
writeCredentials(credentials);
|
|
53
|
+
|
|
54
|
+
res.writeHead(200, { "Content-Type": "text/html" });
|
|
55
|
+
res.end(SUCCESS_HTML);
|
|
56
|
+
|
|
57
|
+
console.log("Successfully authenticated with Opsee!");
|
|
58
|
+
server.close();
|
|
59
|
+
resolve();
|
|
60
|
+
} else {
|
|
61
|
+
res.writeHead(400, { "Content-Type": "text/html" });
|
|
62
|
+
res.end(ERROR_HTML);
|
|
63
|
+
|
|
64
|
+
server.close();
|
|
65
|
+
reject(new Error("No token received in callback"));
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
res.writeHead(404);
|
|
69
|
+
res.end("Not found");
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
server.listen(port, () => {
|
|
74
|
+
console.log(`Opening browser for Opsee authentication...`);
|
|
75
|
+
console.log(`If your browser doesn't open, visit: ${loginUrl}`);
|
|
76
|
+
|
|
77
|
+
// Dynamic import for ESM-only package
|
|
78
|
+
import("open").then((mod) => mod.default(loginUrl)).catch(() => {
|
|
79
|
+
console.log(`Please open the following URL in your browser:\n${loginUrl}`);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
server.on("error", (err) => {
|
|
84
|
+
if ((err as NodeJS.ErrnoException).code === "EADDRINUSE") {
|
|
85
|
+
console.error(`Port ${port} is already in use. Please close other instances and try again.`);
|
|
86
|
+
}
|
|
87
|
+
reject(err);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Timeout after 5 minutes
|
|
91
|
+
setTimeout(() => {
|
|
92
|
+
server.close();
|
|
93
|
+
reject(new Error("Login timed out after 5 minutes"));
|
|
94
|
+
}, 5 * 60 * 1000);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { readCredentials, clearCredentials, type Credentials } from "./credentials.js";
|
|
2
|
+
|
|
3
|
+
export class AuthManager {
|
|
4
|
+
private credentials: Credentials | null = null;
|
|
5
|
+
|
|
6
|
+
getToken(): string | null {
|
|
7
|
+
this.credentials = readCredentials();
|
|
8
|
+
if (!this.credentials) return null;
|
|
9
|
+
|
|
10
|
+
if (this.isExpired()) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return this.credentials.token;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getServerUrl(): string {
|
|
18
|
+
return (
|
|
19
|
+
process.env.OPSEE_API_URL ||
|
|
20
|
+
this.credentials?.serverUrl ||
|
|
21
|
+
"https://api.opsee.dev"
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
getUserId(): string {
|
|
26
|
+
return this.credentials?.userId || "";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
getCompanyId(): string {
|
|
30
|
+
return this.credentials?.companyId || "";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
isAuthenticated(): boolean {
|
|
34
|
+
return this.getToken() !== null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private isExpired(): boolean {
|
|
38
|
+
if (!this.credentials?.expiresAt) return false;
|
|
39
|
+
const expiry = new Date(this.credentials.expiresAt);
|
|
40
|
+
return expiry.getTime() < Date.now();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
handleAuthError(): string {
|
|
44
|
+
clearCredentials();
|
|
45
|
+
return "Not authenticated. Run `npx opsee-mcp login` to connect your Opsee account.";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const authManager = new AuthManager();
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { createClient, type Interceptor, type Client } from "@connectrpc/connect";
|
|
2
|
+
import { createConnectTransport } from "@connectrpc/connect-node";
|
|
3
|
+
import { create } from "@bufbuild/protobuf";
|
|
4
|
+
import type { GenService } from "@bufbuild/protobuf/codegenv1";
|
|
5
|
+
import { authManager } from "../auth/manager.js";
|
|
6
|
+
import {
|
|
7
|
+
PaginationSchema,
|
|
8
|
+
type Pagination,
|
|
9
|
+
} from "../../gen/api/v1/pagination_pb.js";
|
|
10
|
+
import { OrderByEnum } from "../../gen/api/v1/pagination_pb.js";
|
|
11
|
+
import { ProjectService } from "../../gen/api/v1/project_pb.js";
|
|
12
|
+
import { TaskService } from "../../gen/api/v1/task_pb.js";
|
|
13
|
+
import { BoardService } from "../../gen/api/v1/board_pb.js";
|
|
14
|
+
import { BoardColumnService } from "../../gen/api/v1/board_column_pb.js";
|
|
15
|
+
import { CycleService } from "../../gen/api/v1/cycle_pb.js";
|
|
16
|
+
import { DocSpaceService } from "../../gen/api/v1/doc_space_pb.js";
|
|
17
|
+
import { DocPageService } from "../../gen/api/v1/doc_page_pb.js";
|
|
18
|
+
import { TaskTypeService } from "../../gen/api/v1/task_type_pb.js";
|
|
19
|
+
import { TaskPriorityService } from "../../gen/api/v1/task_priority_pb.js";
|
|
20
|
+
import { UserService } from "../../gen/api/v1/user_pb.js";
|
|
21
|
+
import { VCSIntegrationService } from "../../gen/api/v1/vcs_integration_pb.js";
|
|
22
|
+
|
|
23
|
+
const authInterceptor: Interceptor = (next) => async (req) => {
|
|
24
|
+
const token = authManager.getToken();
|
|
25
|
+
if (token) {
|
|
26
|
+
req.header.set("Authorization", `Bearer ${token}`);
|
|
27
|
+
}
|
|
28
|
+
return await next(req);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const paginationInterceptor: Interceptor = (next) => async (req) => {
|
|
32
|
+
const fields = req.method.input.fields;
|
|
33
|
+
const hasPagination = fields.find((f) => f.name === "pagination");
|
|
34
|
+
if (
|
|
35
|
+
hasPagination &&
|
|
36
|
+
!(req.message as Record<string, unknown>)["pagination"]
|
|
37
|
+
) {
|
|
38
|
+
(req.message as Record<string, unknown>)["pagination"] =
|
|
39
|
+
overridePagination();
|
|
40
|
+
}
|
|
41
|
+
return await next(req);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export function overridePagination(): Pagination {
|
|
45
|
+
return create(PaginationSchema, {
|
|
46
|
+
orderBy: OrderByEnum.ASC,
|
|
47
|
+
overridePagination: true,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function defaultPagination(
|
|
52
|
+
page: number = 1,
|
|
53
|
+
pageSize: number = 50
|
|
54
|
+
): Pagination {
|
|
55
|
+
return create(PaginationSchema, {
|
|
56
|
+
page,
|
|
57
|
+
pageSize,
|
|
58
|
+
orderBy: OrderByEnum.ASC,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function createTransport() {
|
|
63
|
+
return createConnectTransport({
|
|
64
|
+
baseUrl: authManager.getServerUrl(),
|
|
65
|
+
httpVersion: "1.1",
|
|
66
|
+
interceptors: [authInterceptor, paginationInterceptor],
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
71
|
+
function makeClient<T extends GenService<any>>(service: T): Client<T> {
|
|
72
|
+
return createClient(service, createTransport());
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function getClients() {
|
|
76
|
+
return {
|
|
77
|
+
projects: makeClient(ProjectService),
|
|
78
|
+
tasks: makeClient(TaskService),
|
|
79
|
+
boards: makeClient(BoardService),
|
|
80
|
+
boardColumns: makeClient(BoardColumnService),
|
|
81
|
+
cycles: makeClient(CycleService),
|
|
82
|
+
docSpaces: makeClient(DocSpaceService),
|
|
83
|
+
docPages: makeClient(DocPageService),
|
|
84
|
+
taskTypes: makeClient(TaskTypeService),
|
|
85
|
+
taskPriorities: makeClient(TaskPriorityService),
|
|
86
|
+
users: makeClient(UserService),
|
|
87
|
+
vcsIntegrations: makeClient(VCSIntegrationService),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type ApiClients = ReturnType<typeof getClients>;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
2
|
+
import { createServer } from "./server.js";
|
|
3
|
+
|
|
4
|
+
async function main() {
|
|
5
|
+
const server = createServer();
|
|
6
|
+
const transport = new StdioServerTransport();
|
|
7
|
+
await server.connect(transport);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
main().catch((error) => {
|
|
11
|
+
console.error("Fatal error:", error);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
});
|
package/src/server.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { getClients } from "./client/api.js";
|
|
3
|
+
import { registerUserTools } from "./tools/user.js";
|
|
4
|
+
import { registerProjectTools } from "./tools/projects.js";
|
|
5
|
+
import { registerTaskTools } from "./tools/tasks.js";
|
|
6
|
+
import { registerTaskMetadataTools } from "./tools/task-metadata.js";
|
|
7
|
+
import { registerCycleTools } from "./tools/cycles.js";
|
|
8
|
+
import { registerDocTools } from "./tools/docs.js";
|
|
9
|
+
import { registerRepositoryTools } from "./tools/repositories.js";
|
|
10
|
+
|
|
11
|
+
export function createServer(): McpServer {
|
|
12
|
+
const server = new McpServer({
|
|
13
|
+
name: "opsee",
|
|
14
|
+
version: "0.1.0",
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
registerUserTools(server, getClients);
|
|
18
|
+
registerProjectTools(server, getClients);
|
|
19
|
+
registerTaskTools(server, getClients);
|
|
20
|
+
registerTaskMetadataTools(server, getClients);
|
|
21
|
+
registerCycleTools(server, getClients);
|
|
22
|
+
registerDocTools(server, getClients);
|
|
23
|
+
registerRepositoryTools(server, getClients);
|
|
24
|
+
|
|
25
|
+
return server;
|
|
26
|
+
}
|