openxiangda-mcp 2.0.0-alpha.100

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/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # openxiangda-mcp
2
+
3
+ Local stdio MCP server for OpenXiangda 2.0. It exposes typed workspace,
4
+ contract, platform, deployment and environment resources plus the same
5
+ application services used by the thin CLI. Environment start/stop are explicit
6
+ durable tools; production is created only through promotion. Resource-level
7
+ platform writes and arbitrary shell are not part of this server.
8
+
9
+ The existing `openxiangda://workspace/context` resource and
10
+ `workspace_context` tool include `toolchain.studio`: the supported CLI result
11
+ schema, JSONL event commands and immutable template-binding protocol. This is
12
+ capability discovery on the same workspace server, not a Studio-specific MCP
13
+ or a second authorization path.
14
+
15
+ `build_app` runs the local check/build preview without sealing an AppPackage;
16
+ `deployment_plan` is an unsealed read-only preview. After explicit user
17
+ authorization, `deploy_app` uses the same automatic official-Dockerfile Buildx
18
+ path as `openxiangda deploy`. None of these tools accepts an image tag, digest,
19
+ repository, Docker configuration, or registry credential.
@@ -0,0 +1,57 @@
1
+ import { McpServer } from '@modelcontextprotocol/server';
2
+ import { OpenXiangdaApplicationServices } from 'openxiangda-devkit-core';
3
+ import { type AiCapability, type AiCapabilityCatalog } from 'openxiangda-contracts';
4
+ export interface ApplicationAiMcpExecutor {
5
+ executeRead(capability: AiCapability, input: Record<string, unknown>): Promise<unknown>;
6
+ createPreview(capability: AiCapability, input: Record<string, unknown>): Promise<unknown>;
7
+ confirmPreview(previewId: string): Promise<unknown>;
8
+ }
9
+ export interface ApplicationAiPlatformApi {
10
+ executeRead(capabilityCode: string, input: Record<string, unknown>): Promise<unknown>;
11
+ createPreview(capabilityCode: string, input: Record<string, unknown>): Promise<unknown>;
12
+ confirmPreview(previewId: string): Promise<unknown>;
13
+ }
14
+ export interface ApplicationAiMcpOptions {
15
+ catalog: AiCapabilityCatalog;
16
+ executor: ApplicationAiMcpExecutor;
17
+ serverName?: string;
18
+ serverVersion?: string;
19
+ }
20
+ export interface AggregatedApplicationAiMcpEntry {
21
+ catalog: AiCapabilityCatalog;
22
+ executor: ApplicationAiMcpExecutor;
23
+ }
24
+ export interface AggregatedApplicationAiMcpOptions {
25
+ /** Reload current-user catalogs on every tool invocation. */
26
+ loadApplications(): Promise<AggregatedApplicationAiMcpEntry[]>;
27
+ serverName?: string;
28
+ serverVersion?: string;
29
+ }
30
+ export declare const APPLICATION_AI_MCP_CATALOG_URI = "openxiangda://ai/catalog";
31
+ export declare const APPLICATION_AI_MCP_CONFIRM_TOOL = "openxiangda.ai.confirm";
32
+ export declare const AGGREGATED_AI_MCP_CATALOG_URI = "openxiangda://ai/catalog";
33
+ export declare const AGGREGATED_AI_MCP_TOOL_NAMES: readonly ["apps.search", "resources.describe", "records.query", "records.get", "records.create", "records.update", "records.delete", "actions.invoke", "mutations.confirm"];
34
+ /** Bind an application MCP facade to the platform-owned AI execution boundary. */
35
+ export declare function createApplicationAiPlatformExecutor(platformApi: ApplicationAiPlatformApi): ApplicationAiMcpExecutor;
36
+ /**
37
+ * Build one application-scoped MCP facade from the immutable AI Catalog.
38
+ * Identity, Data API authorization and preview storage remain owned by the
39
+ * host executor; this adapter only maps the catalog to MCP tools.
40
+ */
41
+ export declare function createApplicationAiMcpServer(options: ApplicationAiMcpOptions): McpServer;
42
+ /**
43
+ * Build the platform-level AI facade from the same per-application Catalogs.
44
+ * The aggregator only routes tools to the owning application executor; it
45
+ * never merges permissions or creates a second data/auth boundary.
46
+ */
47
+ export declare function createAggregatedAiMcpServer(options: AggregatedApplicationAiMcpOptions): McpServer;
48
+ export declare const MCP_RESOURCE_URIS: readonly ["openxiangda://workspace/context", "openxiangda://workspace/contracts", "openxiangda://workspace/appspec", "openxiangda://platform/capabilities", "openxiangda://deployments/latest", "openxiangda://environments", "openxiangda://docs/index"];
49
+ export declare const MCP_TOOL_NAMES: readonly ["workspace_context", "contract_describe", "appspec_context", "generate_contracts", "check_app", "run_tests", "build_app", "deployment_plan", "environment_status", "start_environment", "stop_environment", "deploy_app", "deployment_status", "deployment_logs", "cancel_deployment", "retry_deployment", "rollback_app"];
50
+ export declare function createOpenXiangdaMcpServer(options?: {
51
+ services?: OpenXiangdaApplicationServices;
52
+ root?: string;
53
+ }): McpServer;
54
+ export declare function runStdioServer(options?: {
55
+ root?: string;
56
+ }): Promise<McpServer>;
57
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,8BAA8B,CAAC;AAGzE,OAAO,EAEL,8BAA8B,EAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,wBAAwB;IACvC,WAAW,CACT,UAAU,EAAE,YAAY,EACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,aAAa,CACX,UAAU,EAAE,YAAY,EACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,CACT,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,aAAa,CACX,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,C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 import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
3
+ import { z } from 'zod/v4';
4
+ import { OPENXIANGDA_TOOLCHAIN_VERSION, OpenXiangdaApplicationServices, } from 'openxiangda-devkit-core';
5
+ import { assertAiCapabilityCatalog, } from 'openxiangda-contracts';
6
+ export const APPLICATION_AI_MCP_CATALOG_URI = 'openxiangda://ai/catalog';
7
+ export const APPLICATION_AI_MCP_CONFIRM_TOOL = 'openxiangda.ai.confirm';
8
+ export const AGGREGATED_AI_MCP_CATALOG_URI = 'openxiangda://ai/catalog';
9
+ export const AGGREGATED_AI_MCP_TOOL_NAMES = [
10
+ 'apps.search',
11
+ 'resources.describe',
12
+ 'records.query',
13
+ 'records.get',
14
+ 'records.create',
15
+ 'records.update',
16
+ 'records.delete',
17
+ 'actions.invoke',
18
+ 'mutations.confirm',
19
+ ];
20
+ /** Bind an application MCP facade to the platform-owned AI execution boundary. */
21
+ export function createApplicationAiPlatformExecutor(platformApi) {
22
+ return {
23
+ async executeRead(capability, input) {
24
+ if (capability.risk !== 'read') {
25
+ throw new Error('AI_READ_CAPABILITY_REQUIRED');
26
+ }
27
+ return await platformApi.executeRead(capability.code, input);
28
+ },
29
+ async createPreview(capability, input) {
30
+ if (capability.risk === 'read') {
31
+ throw new Error('AI_MUTATION_CAPABILITY_REQUIRED');
32
+ }
33
+ return await platformApi.createPreview(capability.code, input);
34
+ },
35
+ async confirmPreview(previewId) {
36
+ return await platformApi.confirmPreview(previewId);
37
+ },
38
+ };
39
+ }
40
+ /**
41
+ * Build one application-scoped MCP facade from the immutable AI Catalog.
42
+ * Identity, Data API authorization and preview storage remain owned by the
43
+ * host executor; this adapter only maps the catalog to MCP tools.
44
+ */
45
+ export function createApplicationAiMcpServer(options) {
46
+ assertAiCapabilityCatalog(options.catalog);
47
+ const server = new McpServer({
48
+ name: options.serverName || `${options.catalog.appCode}-ai`,
49
+ version: options.serverVersion || '1.0.0',
50
+ }, {
51
+ instructions: 'Use read tools for bounded queries. Mutation tools only create a preview; call openxiangda.ai.confirm with the returned previewId after the user explicitly confirms the summary.',
52
+ });
53
+ server.registerResource('ai-capability-catalog', APPLICATION_AI_MCP_CATALOG_URI, { title: `${options.catalog.appName} AI Catalog`, mimeType: 'application/json' }, async (resourceUri) => ({
54
+ contents: [
55
+ {
56
+ uri: resourceUri.href,
57
+ mimeType: 'application/json',
58
+ text: JSON.stringify(options.catalog, null, 2),
59
+ },
60
+ ],
61
+ }));
62
+ let hasMutation = false;
63
+ for (const capability of options.catalog.capabilities) {
64
+ const isRead = capability.risk === 'read';
65
+ const toolName = isRead ? capability.code : `${capability.code}.preview`;
66
+ hasMutation ||= !isRead;
67
+ server.registerTool(toolName, {
68
+ title: isRead ? capability.name : `${capability.name}预览`,
69
+ description: isRead
70
+ ? capability.description
71
+ : `${capability.description}。此工具只生成预览,不会修改数据。`,
72
+ inputSchema: fromJsonSchema(capability.inputSchema),
73
+ annotations: {
74
+ readOnlyHint: true,
75
+ destructiveHint: !isRead && capability.risk === 'destructive',
76
+ idempotentHint: isRead,
77
+ },
78
+ }, async (input) => {
79
+ const result = isRead
80
+ ? await options.executor.executeRead(capability, input)
81
+ : await options.executor.createPreview(capability, input);
82
+ return aiToolResult(result);
83
+ });
84
+ }
85
+ if (hasMutation) {
86
+ server.registerTool(APPLICATION_AI_MCP_CONFIRM_TOOL, {
87
+ title: '确认并执行 AI 预览',
88
+ description: '仅在用户明确确认预览摘要后调用。previewId 由应用预览工具返回,并由宿主重新校验当前用户、权限、版本和幂等性。',
89
+ inputSchema: z.object({ previewId: z.string().min(1) }),
90
+ annotations: {
91
+ readOnlyHint: false,
92
+ destructiveHint: true,
93
+ idempotentHint: false,
94
+ },
95
+ }, async (input) => aiToolResult(await options.executor.confirmPreview(input.previewId)));
96
+ }
97
+ return server;
98
+ }
99
+ /**
100
+ * Build the platform-level AI facade from the same per-application Catalogs.
101
+ * The aggregator only routes tools to the owning application executor; it
102
+ * never merges permissions or creates a second data/auth boundary.
103
+ */
104
+ export function createAggregatedAiMcpServer(options) {
105
+ if (typeof options.loadApplications !== 'function') {
106
+ throw new Error('AI_APPLICATION_LOADER_REQUIRED');
107
+ }
108
+ const loadApplications = async () => {
109
+ const entries = await options.loadApplications();
110
+ if (!Array.isArray(entries) || entries.length > 1000) {
111
+ throw new Error('AI_APPLICATION_SET_INVALID');
112
+ }
113
+ const appCodes = new Set();
114
+ const capabilityCodes = new Set();
115
+ for (const entry of entries) {
116
+ assertAiCapabilityCatalog(entry.catalog);
117
+ if (appCodes.has(entry.catalog.appCode)) {
118
+ throw new Error(`AI_APPLICATION_CODE_CONFLICT:${entry.catalog.appCode}`);
119
+ }
120
+ appCodes.add(entry.catalog.appCode);
121
+ for (const capability of entry.catalog.capabilities) {
122
+ if (capabilityCodes.has(capability.code)) {
123
+ throw new Error(`AI_CAPABILITY_CODE_CONFLICT:${capability.code}`);
124
+ }
125
+ capabilityCodes.add(capability.code);
126
+ }
127
+ }
128
+ return entries;
129
+ };
130
+ const server = new McpServer({
131
+ name: options.serverName || 'openxiangda-ai',
132
+ version: options.serverVersion || '1.0.0',
133
+ }, {
134
+ instructions: 'Search applications, describe resources, then use the fixed record or action tools. Mutation tools only create a preview. Ask for explicit user confirmation before mutations.confirm.',
135
+ });
136
+ server.registerResource('ai-capability-catalog', AGGREGATED_AI_MCP_CATALOG_URI, { title: 'OpenXiangda AI Catalog', mimeType: 'application/json' }, async (resourceUri) => {
137
+ const entries = await loadApplications();
138
+ return {
139
+ contents: [
140
+ {
141
+ uri: resourceUri.href,
142
+ mimeType: 'application/json',
143
+ text: JSON.stringify({
144
+ schemaVersion: 'openxiangda.ai-capability-set/v1',
145
+ applications: entries.map(entry => entry.catalog),
146
+ }, null, 2),
147
+ },
148
+ ],
149
+ };
150
+ });
151
+ const recordInput = z.record(z.string(), z.unknown());
152
+ const appResourceInput = {
153
+ appCode: z.string().min(1),
154
+ resourceCode: z.string().min(1),
155
+ };
156
+ const resolveGenerated = async (appCode, resourceCode, operation) => {
157
+ const applications = await loadApplications();
158
+ const application = applications.find(entry => entry.catalog.appCode === appCode);
159
+ const capability = application?.catalog.capabilities.find(item => item.kind === 'generatedCrud' &&
160
+ item.generatedFrom?.resourceCode === resourceCode &&
161
+ item.generatedFrom.operation === operation);
162
+ if (!application || !capability) {
163
+ throw new Error('AI_CAPABILITY_NOT_FOUND');
164
+ }
165
+ return { capability, executor: application.executor };
166
+ };
167
+ const preview = async (entry, input) => {
168
+ const result = await entry.executor.createPreview(entry.capability, input);
169
+ const previewId = String(result?.previewId || '').trim();
170
+ if (!previewId)
171
+ throw new Error('AI_PREVIEW_ID_REQUIRED');
172
+ return result;
173
+ };
174
+ server.registerTool(AGGREGATED_AI_MCP_TOOL_NAMES[0], {
175
+ title: '搜索应用 AI 能力',
176
+ description: '按应用名称、编码或能力说明搜索当前用户可见的应用。',
177
+ inputSchema: z.object({
178
+ query: z.string().optional(),
179
+ limit: z.number().int().min(1).max(20).optional(),
180
+ }),
181
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
182
+ }, async (input) => {
183
+ const entries = await loadApplications();
184
+ const query = String(input.query || '').trim().toLowerCase();
185
+ const applications = entries
186
+ .filter(entry => {
187
+ if (!query)
188
+ return true;
189
+ return [
190
+ entry.catalog.appCode,
191
+ entry.catalog.appName,
192
+ ...entry.catalog.capabilities.flatMap(capability => [
193
+ capability.name,
194
+ capability.description,
195
+ ]),
196
+ ].some(value => value.toLowerCase().includes(query));
197
+ })
198
+ .sort((left, right) => left.catalog.appCode.localeCompare(right.catalog.appCode))
199
+ .slice(0, input.limit || 20)
200
+ .map(entry => ({
201
+ appCode: entry.catalog.appCode,
202
+ appName: entry.catalog.appName,
203
+ capabilityCount: entry.catalog.capabilities.length,
204
+ }));
205
+ return aiToolResult({ applications });
206
+ });
207
+ server.registerTool(AGGREGATED_AI_MCP_TOOL_NAMES[1], {
208
+ title: '描述应用资源',
209
+ description: '读取一个应用资源对当前用户开放的 CRUD 与自定义动作。',
210
+ inputSchema: z.object(appResourceInput),
211
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
212
+ }, async (input) => {
213
+ const entries = await loadApplications();
214
+ const entry = entries.find(item => item.catalog.appCode === input.appCode);
215
+ if (!entry)
216
+ throw new Error('AI_APPLICATION_NOT_FOUND');
217
+ const resourceCapabilities = entry.catalog.capabilities.filter(capability => capability.resources.includes(input.resourceCode));
218
+ if (resourceCapabilities.length === 0)
219
+ throw new Error('AI_RESOURCE_NOT_FOUND');
220
+ return aiToolResult({
221
+ appCode: input.appCode,
222
+ resourceCode: input.resourceCode,
223
+ capabilities: resourceCapabilities,
224
+ });
225
+ });
226
+ server.registerTool(AGGREGATED_AI_MCP_TOOL_NAMES[2], {
227
+ title: '查询应用记录',
228
+ description: '按声明字段和当前用户数据权限查询最多 100 条记录。',
229
+ inputSchema: z.object({ ...appResourceInput, input: recordInput }),
230
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
231
+ }, async (input) => {
232
+ const entry = await resolveGenerated(input.appCode, input.resourceCode, 'query');
233
+ return aiToolResult(await entry.executor.executeRead(entry.capability, input.input));
234
+ });
235
+ server.registerTool(AGGREGATED_AI_MCP_TOOL_NAMES[3], {
236
+ title: '读取应用记录',
237
+ description: '按记录 ID 读取当前用户可见的详情。',
238
+ inputSchema: z.object({ ...appResourceInput, id: z.string().min(1) }),
239
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
240
+ }, async (input) => {
241
+ const entry = await resolveGenerated(input.appCode, input.resourceCode, 'get');
242
+ return aiToolResult(await entry.executor.executeRead(entry.capability, { id: input.id }));
243
+ });
244
+ for (const [toolIndex, operation] of [
245
+ [4, 'create'],
246
+ [5, 'update'],
247
+ [6, 'delete'],
248
+ ]) {
249
+ server.registerTool(AGGREGATED_AI_MCP_TOOL_NAMES[toolIndex], {
250
+ title: `${operation === 'create' ? '新增' : operation === 'update' ? '更新' : '删除'}应用记录预览`,
251
+ description: '只生成待确认预览,不会在此调用中修改业务数据。',
252
+ inputSchema: z.object({ ...appResourceInput, input: recordInput }),
253
+ annotations: {
254
+ readOnlyHint: true,
255
+ destructiveHint: operation === 'delete',
256
+ idempotentHint: false,
257
+ },
258
+ }, async (input) => {
259
+ const entry = await resolveGenerated(input.appCode, input.resourceCode, operation);
260
+ return aiToolResult(await preview(entry, input.input));
261
+ });
262
+ }
263
+ server.registerTool(AGGREGATED_AI_MCP_TOOL_NAMES[7], {
264
+ title: '调用应用业务动作',
265
+ description: '调用显式发布的自定义 AI 动作;写动作只返回预览。',
266
+ inputSchema: z.object({
267
+ appCode: z.string().min(1),
268
+ capabilityCode: z.string().min(1),
269
+ input: recordInput,
270
+ }),
271
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
272
+ }, async (input) => {
273
+ const applications = await loadApplications();
274
+ const application = applications.find(item => item.catalog.appCode === input.appCode);
275
+ const capability = application?.catalog.capabilities.find(item => item.code === input.capabilityCode);
276
+ if (!application ||
277
+ !capability ||
278
+ capability.kind !== 'customAction') {
279
+ throw new Error('AI_CUSTOM_CAPABILITY_NOT_FOUND');
280
+ }
281
+ const entry = { capability, executor: application.executor };
282
+ const result = capability.risk === 'read'
283
+ ? await application.executor.executeRead(capability, input.input)
284
+ : await preview(entry, input.input);
285
+ return aiToolResult(result);
286
+ });
287
+ server.registerTool(AGGREGATED_AI_MCP_TOOL_NAMES[8], {
288
+ title: '确认并执行 AI 预览',
289
+ description: '仅在用户明确确认预览摘要后调用。',
290
+ inputSchema: z.object({
291
+ appCode: z.string().min(1),
292
+ previewId: z.string().min(1),
293
+ }),
294
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
295
+ }, async (input) => {
296
+ const applications = await loadApplications();
297
+ const application = applications.find(item => item.catalog.appCode === input.appCode);
298
+ if (!application)
299
+ throw new Error('AI_APPLICATION_NOT_FOUND');
300
+ return aiToolResult(await application.executor.confirmPreview(input.previewId));
301
+ });
302
+ return server;
303
+ }
304
+ function aiToolResult(result) {
305
+ return {
306
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
307
+ structuredContent: (result || {}),
308
+ };
309
+ }
310
+ export const MCP_RESOURCE_URIS = [
311
+ 'openxiangda://workspace/context',
312
+ 'openxiangda://workspace/contracts',
313
+ 'openxiangda://workspace/appspec',
314
+ 'openxiangda://platform/capabilities',
315
+ 'openxiangda://deployments/latest',
316
+ 'openxiangda://environments',
317
+ 'openxiangda://docs/index',
318
+ ];
319
+ export const MCP_TOOL_NAMES = [
320
+ 'workspace_context',
321
+ 'contract_describe',
322
+ 'appspec_context',
323
+ 'generate_contracts',
324
+ 'check_app',
325
+ 'run_tests',
326
+ 'build_app',
327
+ 'deployment_plan',
328
+ 'environment_status',
329
+ 'start_environment',
330
+ 'stop_environment',
331
+ 'deploy_app',
332
+ 'deployment_status',
333
+ 'deployment_logs',
334
+ 'cancel_deployment',
335
+ 'retry_deployment',
336
+ 'rollback_app',
337
+ ];
338
+ export function createOpenXiangdaMcpServer(options = {}) {
339
+ const services = options.services || new OpenXiangdaApplicationServices();
340
+ const root = options.root;
341
+ const server = new McpServer({ name: 'openxiangda-v2', version: OPENXIANGDA_TOOLCHAIN_VERSION }, {
342
+ instructions: 'Read workspace_context first, then read the bounded appspec_context index when AppSpec is enabled or the task changes behavior, and select only the relevant stable ID for full content. AppSpec is advisory and never a release gate. Use check/test before deploy. Deploy, environment start/stop, cancel, retry and rollback only when the user explicitly requests that external change.',
343
+ });
344
+ registerJsonResource(server, 'workspace-context', MCP_RESOURCE_URIS[0], () => services.workspaceContext(root));
345
+ registerJsonResource(server, 'workspace-contracts', MCP_RESOURCE_URIS[1], () => services.contractDescribe(root));
346
+ registerJsonResource(server, 'workspace-appspec', MCP_RESOURCE_URIS[2], () => services.appSpecContext(root));
347
+ registerJsonResource(server, 'platform-capabilities', MCP_RESOURCE_URIS[3], () => services.platformCapabilities(root));
348
+ registerJsonResource(server, 'latest-deployments', MCP_RESOURCE_URIS[4], () => services.deploymentStatus(root));
349
+ registerJsonResource(server, 'environments', MCP_RESOURCE_URIS[5], () => services.environmentStatus(root));
350
+ registerJsonResource(server, 'docs-index', MCP_RESOURCE_URIS[6], async () => ({
351
+ schemaVersion: 2,
352
+ topics: [
353
+ 'getting-started',
354
+ 'appspec',
355
+ 'frontend',
356
+ 'backend',
357
+ 'data-authz',
358
+ 'delivery',
359
+ ],
360
+ }));
361
+ registerTool(server, 'workspace_context', 'Read the typed 2.0 workspace context.', true, z.object({}), () => services.workspaceContext(root));
362
+ registerTool(server, 'contract_describe', 'Describe compiled Data/AuthZ/Event/Workflow contracts and the typed copy-once admin navigation proposal.', true, z.object({}), () => services.contractDescribe(root));
363
+ registerTool(server, 'appspec_context', 'Read the optional bounded OpenXiangda 2.0 AppSpec index, or select one capability, active/history change, or ADR for related content. This is advisory and never a release gate.', true, z.object({ selector: z.string().min(1).optional() }), input => services.appSpecContext(root, input.selector));
364
+ registerTool(server, 'generate_contracts', 'Generate deterministic TypeScript contracts.', false, z.object({ check: z.boolean().optional() }), input => services.generate({
365
+ ...(root ? { root } : {}),
366
+ ...(input.check !== undefined ? { check: input.check } : {}),
367
+ }));
368
+ registerTool(server, 'check_app', 'Run deterministic whole-application checks.', true, z.object({}), () => services.check(root));
369
+ registerTool(server, 'run_tests', 'Run the application test suite.', true, z.object({}), () => services.test(root));
370
+ registerTool(server, 'build_app', 'Run the local application check and production builds without sealing or publishing an image.', false, z.object({}), () => services.buildPreview(root));
371
+ registerTool(server, 'deployment_plan', 'Read an unsealed deployment preview. deploy_app owns image build, push and package sealing.', true, z.object({ environment: z.literal('preproduction') }), input => services.deploymentPlan({ ...(root ? { root } : {}), environment: input.environment }));
372
+ registerTool(server, 'environment_status', 'Read provisioned environments, runtime state and active immutable version.', true, z.object({}), () => services.environmentStatus(root));
373
+ const environmentLifecycleSchema = z.object({
374
+ environment: z.enum(['preproduction', 'production']),
375
+ idempotencyKey: z.string().min(1).optional(),
376
+ });
377
+ registerTool(server, 'start_environment', 'Start an application environment from its active immutable version after explicit user authorization.', false, environmentLifecycleSchema, input => services.startEnvironment(root, input.environment, input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {}));
378
+ registerTool(server, 'stop_environment', 'Scale an application environment to zero while retaining data and configuration after explicit user authorization.', false, environmentLifecycleSchema, input => services.stopEnvironment(root, input.environment, input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {}));
379
+ registerTool(server, 'deploy_app', 'Build and push the official backend image, seal the application and create a durable DeploymentRun. Call only after explicit user authorization.', false, z.object({
380
+ environment: z.literal('preproduction'),
381
+ environmentId: z.string().optional(),
382
+ idempotencyKey: z.string().optional(),
383
+ }), input => services.deploy({
384
+ ...(root ? { root } : {}),
385
+ environment: input.environment,
386
+ ...(input.environmentId ? { environmentId: input.environmentId } : {}),
387
+ ...(input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {}),
388
+ }));
389
+ registerTool(server, 'deployment_status', 'Read one deployment or the latest deployments.', true, z.object({ deploymentId: z.string().optional() }), input => services.deploymentStatus(root, input.deploymentId));
390
+ registerTool(server, 'deployment_logs', 'Read deployment checkpoints and correlated diagnostics.', true, z.object({ deploymentId: z.string().min(1) }), input => services.deploymentLogs(root, input.deploymentId));
391
+ registerTool(server, 'cancel_deployment', 'Idempotently cancel a DeploymentRun before activation commits after explicit user authorization.', false, z.object({ deploymentId: z.string().min(1) }), input => services.cancel(root, input.deploymentId));
392
+ registerTool(server, 'retry_deployment', 'Retry a retryable DeploymentRun after explicit user authorization.', false, z.object({ deploymentId: z.string().min(1) }), input => services.retry(root, input.deploymentId));
393
+ registerTool(server, 'rollback_app', 'Create a rollback DeploymentRun for a historical AppVersion after explicit user authorization.', false, z.object({
394
+ environment: z.enum(['preproduction', 'production']),
395
+ appVersionId: z.string().min(1),
396
+ }), input => services.rollback(root, input.environment, input.appVersionId));
397
+ return server;
398
+ }
399
+ export async function runStdioServer(options = {}) {
400
+ const server = createOpenXiangdaMcpServer(options);
401
+ const transport = new StdioServerTransport();
402
+ await server.connect(transport);
403
+ return server;
404
+ }
405
+ function registerJsonResource(server, name, uri, read) {
406
+ server.registerResource(name, uri, { title: name, mimeType: 'application/json' }, async (resourceUri) => ({
407
+ contents: [
408
+ {
409
+ uri: resourceUri.href,
410
+ mimeType: 'application/json',
411
+ text: JSON.stringify(await read(), null, 2),
412
+ },
413
+ ],
414
+ }));
415
+ }
416
+ function registerTool(server, name, description, readOnly, inputSchema, execute) {
417
+ server.registerTool(name, {
418
+ title: name,
419
+ description,
420
+ inputSchema,
421
+ annotations: {
422
+ readOnlyHint: readOnly,
423
+ destructiveHint: name === 'rollback_app',
424
+ idempotentHint: [
425
+ 'deploy_app',
426
+ 'start_environment',
427
+ 'stop_environment',
428
+ 'cancel_deployment',
429
+ 'retry_deployment',
430
+ 'rollback_app',
431
+ ].includes(name),
432
+ },
433
+ }, async (input) => {
434
+ const result = await execute(input);
435
+ return {
436
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
437
+ structuredContent: result,
438
+ };
439
+ });
440
+ }
441
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,GAG1B,MAAM,uBAAuB,CAAC;AA6C/B,MAAM,CAAC,MAAM,8BAA8B,GAAG,0BAA0B,CAAC;AACzE,MAAM,CAAC,MAAM,+BAA+B,GAAG,wBAAwB,CAAC;AACxE,MAAM,CAAC,MAAM,6BAA6B,GAAG,0BAA0B,CAAC;AACxE,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,aAAa;IACb,oBAAoB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Ac,EAAE;gBACd,YAAY;gBACZ,mBAAmB;gBACnB,kBAAkB;gBAClB,mBAAmB;gBACnB,kBAAkB;gBAClB,cAAc;aACf,CAAC,QAAQ,CAAC,IAAI,CAAC;SACjB;KACF,EACD,KAAK,EAAC,KAAK,EAAC,EAAE;QACZ,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;YAC3E,iBAAiB,EAAE,MAAiC;SACrD,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "openxiangda-mcp",
3
+ "version": "2.0.0-alpha.100",
4
+ "description": "Structured AI entrypoint for OpenXiangda 2.0 application development.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist/",
16
+ "README.md"
17
+ ],
18
+ "dependencies": {
19
+ "@modelcontextprotocol/server": "2.0.0",
20
+ "openxiangda-contracts": "2.0.0-alpha.80",
21
+ "openxiangda-devkit-core": "2.0.0-alpha.100",
22
+ "zod": "4.4.3"
23
+ },
24
+ "devDependencies": {
25
+ "@modelcontextprotocol/client": "2.0.0",
26
+ "tsx": "4.23.12",
27
+ "typescript": "5.9.3"
28
+ },
29
+ "engines": {
30
+ "node": ">=20"
31
+ },
32
+ "license": "MIT",
33
+ "scripts": {
34
+ "build": "tsc -p tsconfig.json",
35
+ "build:release": "node ../../scripts/prune-package-dist.mjs && pnpm build",
36
+ "check": "tsc -p tsconfig.json --noEmit",
37
+ "test": "tsx --test test/*.test.ts"
38
+ }
39
+ }