@cloudbase/cloudbase-mcp 1.8.17 → 1.8.19

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/dist/index.d.cts DELETED
@@ -1,214 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- export { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
- import * as _cloudbase_toolbox from '@cloudbase/toolbox';
4
- import CloudBase from '@cloudbase/manager-node';
5
- export { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
6
-
7
- interface InteractiveResult {
8
- type: 'envId' | 'clarification' | 'confirmation';
9
- data: any;
10
- cancelled?: boolean;
11
- }
12
- declare class InteractiveServer {
13
- private app;
14
- private server;
15
- private wss;
16
- private port;
17
- private isRunning;
18
- private currentResolver;
19
- private sessionData;
20
- private readonly DEFAULT_PORT;
21
- private readonly FALLBACK_PORTS;
22
- constructor();
23
- private cleanup;
24
- private setupExpress;
25
- private setupWebSocket;
26
- start(): Promise<number>;
27
- stop(): Promise<void>;
28
- collectEnvId(availableEnvs: any[]): Promise<InteractiveResult>;
29
- clarifyRequest(message: string, options?: string[]): Promise<InteractiveResult>;
30
- private getEnvSetupHTML;
31
- private getLogsHTML;
32
- private getClarificationHTML;
33
- private getConfirmationHTML;
34
- get running(): boolean;
35
- get currentPort(): number;
36
- }
37
-
38
- interface UploadFileParams {
39
- cloudPath: string;
40
- fileContent: string;
41
- }
42
- interface ListFilesParams {
43
- prefix: string;
44
- marker?: string;
45
- }
46
- interface DeleteFileParams {
47
- cloudPath: string;
48
- }
49
- interface GetFileInfoParams {
50
- cloudPath: string;
51
- }
52
- interface ToolResponse {
53
- success: boolean;
54
- [key: string]: any;
55
- }
56
- interface DataModelField {
57
- name: string;
58
- type: 'string' | 'number' | 'boolean' | 'date' | 'array' | 'object' | 'objectId' | 'file' | 'image';
59
- required?: boolean;
60
- default?: any;
61
- description?: string;
62
- validation?: {
63
- min?: number;
64
- max?: number;
65
- pattern?: string;
66
- enum?: any[];
67
- };
68
- }
69
- interface DataModelSchema {
70
- type: 'object';
71
- properties: Record<string, {
72
- type: string;
73
- description?: string;
74
- required?: boolean;
75
- default?: any;
76
- validation?: any;
77
- }>;
78
- required?: string[];
79
- }
80
- interface DataModel {
81
- id?: string;
82
- name: string;
83
- title: string;
84
- schema: DataModelSchema;
85
- envId?: string;
86
- status?: 'draft' | 'published';
87
- createdAt?: string;
88
- updatedAt?: string;
89
- }
90
- interface CloudBaseOptions {
91
- secretId?: string;
92
- secretKey?: string;
93
- token?: string;
94
- envId?: string;
95
- proxy?: string;
96
- region?: string;
97
- envType?: string;
98
- }
99
-
100
- /**
101
- * 数据上报类
102
- * 用于收集 MCP 工具使用情况和错误信息,帮助改进产品
103
- *
104
- * 隐私保护:
105
- * - 可通过环境变量 CLOUDBASE_MCP_TELEMETRY_DISABLED=true 完全关闭
106
- * - 不收集敏感信息(代码内容、具体文件路径等)
107
- * - 使用设备指纹而非真实用户信息
108
- * - 所有数据仅用于产品改进,不用于其他用途
109
- */
110
- declare class TelemetryReporter {
111
- private deviceId;
112
- private userAgent;
113
- private additionalParams;
114
- private enabled;
115
- constructor();
116
- /**
117
- * 获取用户运行环境信息
118
- * 包含操作系统、Node版本和MCP版本等信息
119
- */
120
- getUserAgent(): {
121
- userAgent: string;
122
- deviceId: string;
123
- osType: string;
124
- osRelease: string;
125
- nodeVersion: string;
126
- arch: string;
127
- mcpVersion: string;
128
- };
129
- /**
130
- * 获取设备唯一标识
131
- * 基于主机名、CPU信息和MAC地址生成匿名设备指纹
132
- */
133
- private getDeviceId;
134
- /**
135
- * 发送HTTP请求
136
- */
137
- private postFetch;
138
- /**
139
- * 上报事件
140
- * @param eventCode 事件代码
141
- * @param eventData 事件数据
142
- */
143
- report(eventCode: string, eventData?: {
144
- [key: string]: any;
145
- }): Promise<void>;
146
- /**
147
- * 设置公共参数
148
- */
149
- addAdditionalParams(params: {
150
- [key: string]: any;
151
- }): void;
152
- /**
153
- * 检查是否启用
154
- */
155
- isEnabled(): boolean;
156
- }
157
- declare const telemetryReporter: TelemetryReporter;
158
- declare const reportToolkitLifecycle: (params: {
159
- event: "start" | "exit";
160
- duration?: number;
161
- exitCode?: number;
162
- error?: string;
163
- }) => Promise<void>;
164
-
165
- declare const info: (message: string, data?: any) => void;
166
- declare const warn: (message: string, data?: any) => void;
167
- declare const error: (message: string, data?: any) => void;
168
-
169
- interface ExtendedMcpServer extends McpServer {
170
- cloudBaseOptions?: CloudBaseOptions;
171
- }
172
- /**
173
- * Create and configure a CloudBase MCP Server instance
174
- * @param options Server configuration options
175
- * @returns Configured McpServer instance
176
- */
177
- declare function createCloudBaseMcpServer(options?: {
178
- name?: string;
179
- version?: string;
180
- enableTelemetry?: boolean;
181
- cloudBaseOptions?: CloudBaseOptions;
182
- }): ExtendedMcpServer;
183
- /**
184
- * Get the default configured CloudBase MCP Server
185
- */
186
- declare function getDefaultServer(): ExtendedMcpServer;
187
-
188
- declare function getLoginState(): Promise<_cloudbase_toolbox.Credential>;
189
- declare function logout(): Promise<void>;
190
-
191
- declare function getEnvId(cloudBaseOptions?: CloudBaseOptions): Promise<string>;
192
- declare function resetCloudBaseManagerCache(): void;
193
- interface GetManagerOptions {
194
- requireEnvId?: boolean;
195
- cloudBaseOptions?: CloudBaseOptions;
196
- }
197
- /**
198
- * 每次都实时获取最新的 token/secretId/secretKey
199
- */
200
- declare function getCloudBaseManager(options?: GetManagerOptions): Promise<CloudBase>;
201
- /**
202
- * 使用传入的 CloudBase 配置创建 manager,不使用缓存
203
- * @param cloudBaseOptions 传入的 CloudBase 配置选项
204
- * @returns CloudBase manager 实例
205
- */
206
- declare function createCloudBaseManagerWithOptions(cloudBaseOptions: CloudBaseOptions): CloudBase;
207
-
208
- /**
209
- * Get interactive server instance (CommonJS compatible)
210
- */
211
- declare function getInteractiveServerAsync(): Promise<InteractiveServer>;
212
-
213
- export { createCloudBaseManagerWithOptions, createCloudBaseMcpServer, error, getCloudBaseManager, getDefaultServer, getEnvId, getInteractiveServerAsync, getLoginState, info, logout, reportToolkitLifecycle, resetCloudBaseManagerCache, telemetryReporter, warn };
214
- export type { CloudBaseOptions, DataModel, DataModelField, DataModelSchema, DeleteFileParams, ExtendedMcpServer, GetFileInfoParams, InteractiveResult, ListFilesParams, ToolResponse, UploadFileParams };