@daghis/teamcity-mcp 1.12.1 → 1.13.1

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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.13.1](https://github.com/Daghis/teamcity-mcp/compare/teamcity-mcp-v1.13.0...teamcity-mcp-v1.13.1) (2025-12-22)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * tune codecov PR comment behavior ([#329](https://github.com/Daghis/teamcity-mcp/issues/329)) ([a790ab1](https://github.com/Daghis/teamcity-mcp/commit/a790ab18cf08a755f930ed73639c958c7b096b55))
9
+
10
+ ## [1.13.0](https://github.com/Daghis/teamcity-mcp/compare/teamcity-mcp-v1.12.1...teamcity-mcp-v1.13.0) (2025-12-22)
11
+
12
+
13
+ ### Features
14
+
15
+ * add CLI argument support for Windows workaround ([#320](https://github.com/Daghis/teamcity-mcp/issues/320)) ([#326](https://github.com/Daghis/teamcity-mcp/issues/326)) ([cc05a4d](https://github.com/Daghis/teamcity-mcp/commit/cc05a4dd19c1d7e1f547cdd35bb910035141909d))
16
+
3
17
  ## [1.12.1](https://github.com/Daghis/teamcity-mcp/compare/teamcity-mcp-v1.12.0...teamcity-mcp-v1.12.1) (2025-12-22)
4
18
 
5
19
 
package/README.md CHANGED
@@ -85,10 +85,40 @@ npx -y @daghis/teamcity-mcp
85
85
  - `claude mcp add [-s user] teamcity -- npx -y @daghis/teamcity-mcp`
86
86
  - With env vars (if not using .env):
87
87
  - `claude mcp add [-s user] teamcity -- env TEAMCITY_URL="https://teamcity.example.com" TEAMCITY_TOKEN="tc_<your_token>" MCP_MODE=dev npx -y @daghis/teamcity-mcp`
88
+ - With CLI arguments (recommended for Windows):
89
+ - `claude mcp add [-s user] teamcity -- npx -y @daghis/teamcity-mcp --url "https://teamcity.example.com" --token "tc_<your_token>" --mode dev`
88
90
  - Context usage (Opus 4.1, estimates):
89
91
  - Dev (default): ~14k tokens for MCP tools
90
92
  - Full (`MCP_MODE=full`): ~26k tokens for MCP tools
91
93
 
94
+ ### Windows Users
95
+
96
+ On Windows, Claude Code's MCP configuration [may not properly merge environment variables](https://github.com/anthropics/claude-code/issues/1254). Use CLI arguments as a workaround:
97
+
98
+ ```json
99
+ {
100
+ "mcpServers": {
101
+ "teamcity": {
102
+ "command": "npx",
103
+ "args": ["-y", "@daghis/teamcity-mcp", "--url", "https://teamcity.example.com", "--token", "YOUR_TOKEN"]
104
+ }
105
+ }
106
+ }
107
+ ```
108
+
109
+ Or use a config file for better security (token not visible in process list):
110
+
111
+ ```json
112
+ {
113
+ "mcpServers": {
114
+ "teamcity": {
115
+ "command": "npx",
116
+ "args": ["-y", "@daghis/teamcity-mcp", "--config", "C:\\path\\to\\teamcity.env"]
117
+ }
118
+ }
119
+ }
120
+ ```
121
+
92
122
  ## Configuration
93
123
 
94
124
  Environment is validated centrally with Zod. Supported variables and defaults:
package/dist/index.js CHANGED
@@ -741,6 +741,185 @@ async function startServerLifecycle(server, transport) {
741
741
  });
742
742
  }
743
743
 
744
+ // src/utils/cli-args.ts
745
+ var import_fs = require("fs");
746
+ var import_path = require("path");
747
+ function parseCliArgs(argv) {
748
+ const result = {
749
+ help: false,
750
+ version: false
751
+ };
752
+ for (let i = 0; i < argv.length; i++) {
753
+ const arg = argv[i];
754
+ if (arg === void 0) continue;
755
+ if (arg === "--help" || arg === "-h") {
756
+ result.help = true;
757
+ continue;
758
+ }
759
+ if (arg === "--version" || arg === "-v") {
760
+ result.version = true;
761
+ continue;
762
+ }
763
+ if (arg.startsWith("--url=")) {
764
+ result.url = arg.slice("--url=".length);
765
+ continue;
766
+ }
767
+ if (arg.startsWith("--token=")) {
768
+ result.token = arg.slice("--token=".length);
769
+ continue;
770
+ }
771
+ if (arg.startsWith("--mode=")) {
772
+ const mode = arg.slice("--mode=".length);
773
+ if (mode === "dev" || mode === "full") {
774
+ result.mode = mode;
775
+ } else if (mode.length > 0) {
776
+ process.stderr.write(
777
+ `Warning: Invalid mode '${mode}'. Valid values are 'dev' or 'full'.
778
+ `
779
+ );
780
+ }
781
+ continue;
782
+ }
783
+ if (arg.startsWith("--config=")) {
784
+ result.config = arg.slice("--config=".length);
785
+ continue;
786
+ }
787
+ const nextArg = argv[i + 1];
788
+ if (nextArg !== void 0 && !nextArg.startsWith("-")) {
789
+ if (arg === "--url") {
790
+ result.url = nextArg;
791
+ i++;
792
+ continue;
793
+ }
794
+ if (arg === "--token") {
795
+ result.token = nextArg;
796
+ i++;
797
+ continue;
798
+ }
799
+ if (arg === "--mode") {
800
+ if (nextArg === "dev" || nextArg === "full") {
801
+ result.mode = nextArg;
802
+ } else {
803
+ process.stderr.write(
804
+ `Warning: Invalid mode '${nextArg}'. Valid values are 'dev' or 'full'.
805
+ `
806
+ );
807
+ }
808
+ i++;
809
+ continue;
810
+ }
811
+ if (arg === "--config") {
812
+ result.config = nextArg;
813
+ i++;
814
+ continue;
815
+ }
816
+ }
817
+ }
818
+ return result;
819
+ }
820
+ function getVersion() {
821
+ try {
822
+ const possiblePaths = [
823
+ (0, import_path.join)(__dirname, "../package.json"),
824
+ // bundled: dist/ -> package.json
825
+ (0, import_path.join)(__dirname, "../../package.json")
826
+ // source: src/utils/ -> package.json
827
+ ];
828
+ for (const packagePath of possiblePaths) {
829
+ try {
830
+ const packageJson = JSON.parse((0, import_fs.readFileSync)(packagePath, "utf-8"));
831
+ if (packageJson.version) {
832
+ return packageJson.version;
833
+ }
834
+ } catch {
835
+ }
836
+ }
837
+ return "unknown";
838
+ } catch {
839
+ return "unknown";
840
+ }
841
+ }
842
+ function getHelpText() {
843
+ const version = getVersion();
844
+ return `teamcity-mcp v${version}
845
+ Model Context Protocol server for TeamCity CI/CD integration
846
+
847
+ USAGE:
848
+ teamcity-mcp [OPTIONS]
849
+
850
+ OPTIONS:
851
+ --url <url> TeamCity server URL (e.g., https://tc.example.com)
852
+ --token <token> TeamCity API token for authentication
853
+ --mode <dev|full> Tool exposure mode: dev (limited) or full (all tools)
854
+ --config <path> Path to .env format configuration file
855
+
856
+ -h, --help Show this help message
857
+ -v, --version Show version number
858
+
859
+ CONFIGURATION PRECEDENCE (highest to lowest):
860
+ 1. CLI arguments (--url, --token, --mode)
861
+ 2. Config file (--config)
862
+ 3. Environment variables (TEAMCITY_URL, TEAMCITY_TOKEN, MCP_MODE)
863
+ 4. .env file in current directory
864
+
865
+ SECURITY WARNING:
866
+ Avoid using --token on the command line when possible. The token value
867
+ is visible in process lists and may be logged in shell history. For
868
+ production use, prefer environment variables or a config file with
869
+ restricted permissions (chmod 600).
870
+
871
+ EXAMPLES:
872
+ # Using CLI arguments
873
+ teamcity-mcp --url https://tc.example.com --token tc_abc123
874
+
875
+ # Using a config file
876
+ teamcity-mcp --config /path/to/teamcity.env
877
+
878
+ # Override config file with CLI arg
879
+ teamcity-mcp --config prod.env --mode dev
880
+
881
+ CONFIG FILE FORMAT (.env):
882
+ TEAMCITY_URL=https://tc.example.com
883
+ TEAMCITY_TOKEN=tc_abc123
884
+ MCP_MODE=dev
885
+
886
+ For more information, visit: https://github.com/Daghis/teamcity-mcp
887
+ `;
888
+ }
889
+
890
+ // src/utils/env-file.ts
891
+ var import_dotenv2 = require("dotenv");
892
+ var import_fs2 = require("fs");
893
+ function loadEnvFile(filepath) {
894
+ try {
895
+ const content = (0, import_fs2.readFileSync)(filepath, "utf-8");
896
+ const values = (0, import_dotenv2.parse)(content);
897
+ return {
898
+ success: true,
899
+ values
900
+ };
901
+ } catch (err) {
902
+ const error3 = err instanceof Error ? err : new Error(String(err));
903
+ const errno = err;
904
+ if (errno.code === "ENOENT") {
905
+ return {
906
+ success: false,
907
+ error: `Config file not found: ${filepath}`
908
+ };
909
+ }
910
+ if (errno.code === "EACCES") {
911
+ return {
912
+ success: false,
913
+ error: `Permission denied reading config file: ${filepath}`
914
+ };
915
+ }
916
+ return {
917
+ success: false,
918
+ error: `Failed to read config file: ${error3.message}`
919
+ };
920
+ }
921
+ }
922
+
744
923
  // src/server.ts
745
924
  var import_server = require("@modelcontextprotocol/sdk/server/index.js");
746
925
  var import_types = require("@modelcontextprotocol/sdk/types.js");
@@ -1016,7 +1195,7 @@ function debug2(message, meta) {
1016
1195
  // package.json
1017
1196
  var package_default = {
1018
1197
  name: "@daghis/teamcity-mcp",
1019
- version: "1.12.1",
1198
+ version: "1.13.1",
1020
1199
  description: "Model Control Protocol server for TeamCity CI/CD integration with AI coding assistants",
1021
1200
  mcpName: "io.github.Daghis/teamcity",
1022
1201
  main: "dist/index.js",
@@ -43389,7 +43568,39 @@ function createSimpleServer() {
43389
43568
  }
43390
43569
 
43391
43570
  // src/index.ts
43571
+ var cliArgs = parseCliArgs(process.argv.slice(2));
43572
+ if (cliArgs.help) {
43573
+ process.stderr.write(getHelpText());
43574
+ process.exit(0);
43575
+ }
43576
+ if (cliArgs.version) {
43577
+ process.stderr.write(`teamcity-mcp v${getVersion()}
43578
+ `);
43579
+ process.exit(0);
43580
+ }
43581
+ if (cliArgs.config) {
43582
+ const configResult = loadEnvFile(cliArgs.config);
43583
+ if (!configResult.success) {
43584
+ process.stderr.write(`Error: ${configResult.error}
43585
+ `);
43586
+ process.exit(1);
43587
+ }
43588
+ if (configResult.values) {
43589
+ for (const [key, value] of Object.entries(configResult.values)) {
43590
+ process.env[key] ||= value;
43591
+ }
43592
+ }
43593
+ }
43392
43594
  dotenv2.config({ quiet: true });
43595
+ if (cliArgs.url) {
43596
+ process.env["TEAMCITY_URL"] = cliArgs.url;
43597
+ }
43598
+ if (cliArgs.token) {
43599
+ process.env["TEAMCITY_TOKEN"] = cliArgs.token;
43600
+ }
43601
+ if (cliArgs.mode) {
43602
+ process.env["MCP_MODE"] = cliArgs.mode;
43603
+ }
43393
43604
  var activeServer = null;
43394
43605
  var lifecyclePromise = null;
43395
43606
  var shuttingDown = false;
@@ -43428,7 +43639,7 @@ async function main() {
43428
43639
  process.stderr.write(`${e.message}
43429
43640
  `);
43430
43641
  process.stderr.write(
43431
- "Please set TEAMCITY_URL and TEAMCITY_TOKEN in your environment or .env file.\n"
43642
+ "Please configure TEAMCITY_URL and TEAMCITY_TOKEN via:\n - CLI arguments: --url <url> --token <token>\n - Config file: --config <path>\n - Environment variables\n - .env file\nRun with --help for more information.\n"
43432
43643
  );
43433
43644
  process.exit(1);
43434
43645
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daghis/teamcity-mcp",
3
- "version": "1.12.1",
3
+ "version": "1.13.1",
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",
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": "1.12.1",
10
+ "version": "1.13.1",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "registryBaseUrl": "https://registry.npmjs.org",
15
15
  "identifier": "@daghis/teamcity-mcp",
16
- "version": "1.12.1",
16
+ "version": "1.13.1",
17
17
  "runtimeHint": "npx",
18
18
  "runtimeArguments": [
19
19
  {