@daghis/teamcity-mcp 2.7.0 → 2.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.8.0](https://github.com/Daghis/teamcity-mcp/compare/teamcity-mcp-v2.7.0...teamcity-mcp-v2.8.0) (2026-04-24)
4
+
5
+
6
+ ### Features
7
+
8
+ * **tools:** declare outputSchema for first batch of read tools ([#477](https://github.com/Daghis/teamcity-mcp/issues/477)) ([932fee9](https://github.com/Daghis/teamcity-mcp/commit/932fee9e09988555cda13b8f7282128de8a7e3f5))
9
+
3
10
  ## [2.7.0](https://github.com/Daghis/teamcity-mcp/compare/teamcity-mcp-v2.6.3...teamcity-mcp-v2.7.0) (2026-04-23)
4
11
 
5
12
 
package/dist/index.js CHANGED
@@ -1205,7 +1205,7 @@ function debug2(message, meta) {
1205
1205
  // package.json
1206
1206
  var package_default = {
1207
1207
  name: "@daghis/teamcity-mcp",
1208
- version: "2.7.0",
1208
+ version: "2.8.0",
1209
1209
  description: "Model Control Protocol server for TeamCity CI/CD integration with AI coding assistants",
1210
1210
  mcpName: "io.github.Daghis/teamcity",
1211
1211
  main: "dist/index.js",
@@ -1287,6 +1287,8 @@ var package_default = {
1287
1287
  "@types/node": "^25.0.2",
1288
1288
  "@typescript-eslint/eslint-plugin": "^8.58.0",
1289
1289
  "@typescript-eslint/parser": "^8.58.0",
1290
+ ajv: "^8.18.0",
1291
+ "ajv-formats": "^3.0.1",
1290
1292
  esbuild: "^0.28.0",
1291
1293
  eslint: "^10.1.0",
1292
1294
  "eslint-config-prettier": "^10.1.8",
@@ -4605,13 +4607,19 @@ async function runTool(toolName, schema, handler, rawArgs, context) {
4605
4607
  );
4606
4608
  if (err instanceof import_zod3.z.ZodError) {
4607
4609
  const formatted2 = formatError(err, { ...context, requestId: reqId });
4608
- return json(formatted2);
4610
+ const response2 = json(formatted2);
4611
+ response2.success = false;
4612
+ response2.error = msg;
4613
+ return response2;
4609
4614
  }
4610
4615
  const formatted = globalErrorHandler.handleToolError(err, toolName, {
4611
4616
  ...context,
4612
4617
  requestId: reqId
4613
4618
  });
4614
- return json(formatted);
4619
+ const response = json(formatted);
4620
+ response.success = false;
4621
+ response.error = msg;
4622
+ return response;
4615
4623
  }
4616
4624
  }
4617
4625
 
@@ -39052,6 +39060,163 @@ var downloadArtifactByUrl = async (adapter, request, encoding, options) => {
39052
39060
  };
39053
39061
  return buildArtifactPayload(artifact, "base64", options);
39054
39062
  };
39063
+ var paginationMetaSchema = {
39064
+ type: "object",
39065
+ description: "Pagination metadata describing which slice was returned.",
39066
+ additionalProperties: true,
39067
+ properties: {
39068
+ page: { type: "number" },
39069
+ pageSize: { type: "number" },
39070
+ mode: { type: "string", enum: ["all"] },
39071
+ fetched: { type: "number" }
39072
+ }
39073
+ };
39074
+ var buildObjectSchema = {
39075
+ type: "object",
39076
+ description: "TeamCity build representation.",
39077
+ additionalProperties: true,
39078
+ properties: {
39079
+ id: { type: ["number", "string"] },
39080
+ buildTypeId: { type: "string" },
39081
+ number: { type: "string" },
39082
+ state: { type: "string" },
39083
+ status: { type: "string" },
39084
+ statusText: { type: "string" },
39085
+ branchName: { type: "string" },
39086
+ href: { type: "string" },
39087
+ webUrl: { type: "string" }
39088
+ }
39089
+ };
39090
+ var projectObjectSchema = {
39091
+ type: "object",
39092
+ description: "TeamCity project representation.",
39093
+ additionalProperties: true,
39094
+ properties: {
39095
+ id: { type: "string" },
39096
+ name: { type: "string" },
39097
+ parentProjectId: { type: "string" },
39098
+ href: { type: "string" },
39099
+ webUrl: { type: "string" },
39100
+ archived: { type: "boolean" },
39101
+ description: { type: "string" }
39102
+ }
39103
+ };
39104
+ var buildTypeObjectSchema = {
39105
+ type: "object",
39106
+ description: "TeamCity build configuration (buildType) representation.",
39107
+ additionalProperties: true,
39108
+ properties: {
39109
+ id: { type: "string" },
39110
+ name: { type: "string" },
39111
+ projectId: { type: "string" },
39112
+ projectName: { type: "string" },
39113
+ href: { type: "string" },
39114
+ webUrl: { type: "string" },
39115
+ paused: { type: "boolean" },
39116
+ description: { type: "string" }
39117
+ }
39118
+ };
39119
+ var listOutputSchema = (itemSchema) => ({
39120
+ type: "object",
39121
+ additionalProperties: false,
39122
+ required: ["items", "pagination"],
39123
+ properties: {
39124
+ items: { type: "array", items: itemSchema },
39125
+ pagination: paginationMetaSchema
39126
+ }
39127
+ });
39128
+ var buildStatusOutputSchema = {
39129
+ type: "object",
39130
+ description: "Aggregated status for a queued, running, or finished build.",
39131
+ additionalProperties: true,
39132
+ required: ["buildId", "state", "percentageComplete"],
39133
+ properties: {
39134
+ buildId: { type: "string" },
39135
+ buildNumber: { type: "string" },
39136
+ buildTypeId: { type: "string" },
39137
+ state: { type: "string", enum: ["queued", "running", "finished", "failed", "canceled"] },
39138
+ status: { type: "string", enum: ["SUCCESS", "FAILURE", "ERROR", "UNKNOWN"] },
39139
+ statusText: { type: "string" },
39140
+ percentageComplete: { type: "number" },
39141
+ currentStageText: { type: "string" },
39142
+ branchName: { type: "string" },
39143
+ webUrl: { type: "string" },
39144
+ queuedDate: { type: "string" },
39145
+ startDate: { type: "string" },
39146
+ finishDate: { type: "string" },
39147
+ elapsedSeconds: { type: "number" },
39148
+ estimatedTotalSeconds: { type: "number" },
39149
+ estimatedStartTime: { type: "string" },
39150
+ queuePosition: { type: "number" },
39151
+ waitReason: { type: "string" },
39152
+ failureReason: { type: "string" },
39153
+ canceledBy: { type: "string" },
39154
+ canceledDate: { type: "string" },
39155
+ totalQueued: { type: "number" },
39156
+ canMoveToTop: { type: "boolean" },
39157
+ testSummary: {
39158
+ type: "object",
39159
+ additionalProperties: true,
39160
+ properties: {
39161
+ total: { type: "number" },
39162
+ passed: { type: "number" },
39163
+ failed: { type: "number" },
39164
+ ignored: { type: "number" },
39165
+ muted: { type: "number" },
39166
+ newFailed: { type: "number" }
39167
+ }
39168
+ },
39169
+ problems: {
39170
+ type: "array",
39171
+ items: {
39172
+ type: "object",
39173
+ additionalProperties: true,
39174
+ properties: {
39175
+ type: { type: "string" },
39176
+ identity: { type: "string" },
39177
+ description: { type: "string" }
39178
+ }
39179
+ }
39180
+ }
39181
+ }
39182
+ };
39183
+ var buildResultsOutputSchema = {
39184
+ type: "object",
39185
+ description: "Rich build result bundle assembled by BuildResultsManager. The core build summary is always under `build`; optional sections (artifacts, statistics, changes, dependencies) are present when requested via the corresponding include* flags.",
39186
+ additionalProperties: true,
39187
+ required: ["build"],
39188
+ properties: {
39189
+ build: {
39190
+ type: "object",
39191
+ additionalProperties: true,
39192
+ properties: {
39193
+ id: { type: ["string", "number"] },
39194
+ number: { type: "string" },
39195
+ status: { type: "string" },
39196
+ state: { type: "string" },
39197
+ buildTypeId: { type: "string" },
39198
+ projectId: { type: "string" },
39199
+ branchName: { type: "string" },
39200
+ statusText: { type: "string" },
39201
+ webUrl: { type: "string" }
39202
+ }
39203
+ },
39204
+ artifacts: { type: "array", items: { type: "object", additionalProperties: true } },
39205
+ statistics: { type: "object", additionalProperties: true },
39206
+ changes: { type: "array", items: { type: "object", additionalProperties: true } },
39207
+ dependencies: { type: "array", items: { type: "object", additionalProperties: true } }
39208
+ }
39209
+ };
39210
+ var FIRST_BATCH_OUTPUT_SCHEMAS = {
39211
+ list_builds: listOutputSchema(buildObjectSchema),
39212
+ get_build: buildObjectSchema,
39213
+ get_build_status: buildStatusOutputSchema,
39214
+ get_build_results: buildResultsOutputSchema,
39215
+ list_projects: listOutputSchema(projectObjectSchema),
39216
+ get_project: projectObjectSchema,
39217
+ list_build_configs: listOutputSchema(buildTypeObjectSchema),
39218
+ get_build_config: buildTypeObjectSchema
39219
+ };
39055
39220
  function getMCPMode2() {
39056
39221
  return getMCPMode();
39057
39222
  }
@@ -39169,6 +39334,7 @@ var DEV_TOOLS = [
39169
39334
  openWorldHint: true
39170
39335
  },
39171
39336
  description: "List TeamCity projects (supports pagination)",
39337
+ outputSchema: FIRST_BATCH_OUTPUT_SCHEMAS.list_projects,
39172
39338
  inputSchema: {
39173
39339
  type: "object",
39174
39340
  properties: {
@@ -39242,6 +39408,7 @@ var DEV_TOOLS = [
39242
39408
  openWorldHint: true
39243
39409
  },
39244
39410
  description: "Get details of a specific project",
39411
+ outputSchema: FIRST_BATCH_OUTPUT_SCHEMAS.get_project,
39245
39412
  inputSchema: {
39246
39413
  type: "object",
39247
39414
  properties: {
@@ -39273,6 +39440,7 @@ var DEV_TOOLS = [
39273
39440
  openWorldHint: true
39274
39441
  },
39275
39442
  description: "List TeamCity builds (supports pagination)",
39443
+ outputSchema: FIRST_BATCH_OUTPUT_SCHEMAS.list_builds,
39276
39444
  inputSchema: {
39277
39445
  type: "object",
39278
39446
  properties: {
@@ -39367,6 +39535,7 @@ var DEV_TOOLS = [
39367
39535
  openWorldHint: true
39368
39536
  },
39369
39537
  description: "Get details of a specific build (works for both queued and running/finished builds)",
39538
+ outputSchema: FIRST_BATCH_OUTPUT_SCHEMAS.get_build,
39370
39539
  inputSchema: {
39371
39540
  type: "object",
39372
39541
  properties: {
@@ -39616,6 +39785,7 @@ var DEV_TOOLS = [
39616
39785
  openWorldHint: true
39617
39786
  },
39618
39787
  description: "Get build status with optional test/problem and queue context details",
39788
+ outputSchema: FIRST_BATCH_OUTPUT_SCHEMAS.get_build_status,
39619
39789
  inputSchema: {
39620
39790
  type: "object",
39621
39791
  properties: {
@@ -40073,6 +40243,7 @@ var DEV_TOOLS = [
40073
40243
  openWorldHint: true
40074
40244
  },
40075
40245
  description: "List build configurations (supports pagination)",
40246
+ outputSchema: FIRST_BATCH_OUTPUT_SCHEMAS.list_build_configs,
40076
40247
  inputSchema: {
40077
40248
  type: "object",
40078
40249
  properties: {
@@ -40146,6 +40317,7 @@ var DEV_TOOLS = [
40146
40317
  openWorldHint: true
40147
40318
  },
40148
40319
  description: "Get details of a build configuration",
40320
+ outputSchema: FIRST_BATCH_OUTPUT_SCHEMAS.get_build_config,
40149
40321
  inputSchema: {
40150
40322
  type: "object",
40151
40323
  properties: {
@@ -41139,6 +41311,7 @@ var DEV_TOOLS = [
41139
41311
  openWorldHint: true
41140
41312
  },
41141
41313
  description: "Get detailed results of a build including tests, artifacts, changes, and statistics",
41314
+ outputSchema: FIRST_BATCH_OUTPUT_SCHEMAS.get_build_results,
41142
41315
  inputSchema: {
41143
41316
  type: "object",
41144
41317
  properties: {
@@ -44720,6 +44893,18 @@ function getTool(name) {
44720
44893
  }
44721
44894
 
44722
44895
  // src/server.ts
44896
+ function parseStructuredContent(content) {
44897
+ const first = content[0];
44898
+ if (first?.type !== "text" || typeof first.text !== "string") return void 0;
44899
+ try {
44900
+ const parsed = JSON.parse(first.text);
44901
+ if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
44902
+ return parsed;
44903
+ }
44904
+ } catch {
44905
+ }
44906
+ return void 0;
44907
+ }
44723
44908
  function createSimpleServer() {
44724
44909
  const _config = getConfig();
44725
44910
  getAvailableTools();
@@ -44746,7 +44931,8 @@ function createSimpleServer() {
44746
44931
  name: tool.name,
44747
44932
  description: tool.description,
44748
44933
  inputSchema: tool.inputSchema,
44749
- annotations: tool.annotations
44934
+ annotations: tool.annotations,
44935
+ ...tool.outputSchema ? { outputSchema: tool.outputSchema } : {}
44750
44936
  }))
44751
44937
  };
44752
44938
  debug2("MCP response: tools/list", { count: response.tools.length, success: true });
@@ -44771,11 +44957,16 @@ function createSimpleServer() {
44771
44957
  }
44772
44958
  try {
44773
44959
  const result = await tool.handler(args ?? {});
44774
- const response = {
44775
- content: result.content ?? [
44776
- { type: "text", text: result.error ?? "Tool executed successfully" }
44777
- ]
44778
- };
44960
+ const content = result.content ?? [
44961
+ { type: "text", text: result.error ?? "Tool executed successfully" }
44962
+ ];
44963
+ const response = { content };
44964
+ if (tool.outputSchema && result.success !== false) {
44965
+ const structured = parseStructuredContent(content);
44966
+ if (structured !== void 0) {
44967
+ response.structuredContent = structured;
44968
+ }
44969
+ }
44779
44970
  const duration = Date.now() - started;
44780
44971
  const success = result?.success !== false;
44781
44972
  debug2("MCP response: tools/call", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daghis/teamcity-mcp",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "Model Control Protocol server for TeamCity CI/CD integration with AI coding assistants",
5
5
  "mcpName": "io.github.Daghis/teamcity",
6
6
  "main": "dist/index.js",
@@ -82,6 +82,8 @@
82
82
  "@types/node": "^25.0.2",
83
83
  "@typescript-eslint/eslint-plugin": "^8.58.0",
84
84
  "@typescript-eslint/parser": "^8.58.0",
85
+ "ajv": "^8.18.0",
86
+ "ajv-formats": "^3.0.1",
85
87
  "esbuild": "^0.28.0",
86
88
  "eslint": "^10.1.0",
87
89
  "eslint-config-prettier": "^10.1.8",
package/server.json CHANGED
@@ -7,13 +7,13 @@
7
7
  "source": "github"
8
8
  },
9
9
  "websiteUrl": "https://github.com/Daghis/teamcity-mcp",
10
- "version": "2.7.0",
10
+ "version": "2.8.0",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "registryBaseUrl": "https://registry.npmjs.org",
15
15
  "identifier": "@daghis/teamcity-mcp",
16
- "version": "2.7.0",
16
+ "version": "2.8.0",
17
17
  "runtimeHint": "npx",
18
18
  "runtimeArguments": [
19
19
  {