@atlassian-dc-mcp/bitbucket 0.16.0 → 0.17.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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.17.0](https://github.com/b1ff/atlassian-dc-mcp/compare/v0.16.0...v0.17.0) (2026-04-23)
7
+
8
+
9
+ ### Features
10
+
11
+ * add interactive setup CLI with secure credential storage ([f317903](https://github.com/b1ff/atlassian-dc-mcp/commit/f317903a9975b66442f54e520a5a1656a69d1a1b))
12
+
13
+
14
+
15
+
16
+
6
17
  # [0.16.0](https://github.com/b1ff/atlassian-dc-mcp/compare/v0.15.0...v0.16.0) (2026-04-14)
7
18
 
8
19
 
package/README.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  This package provides a Machine Comprehension Protocol (MCP) server for interacting with Atlassian Bitbucket Data Center edition.
4
4
 
5
+ ## Interactive Setup
6
+
7
+ The easiest way to configure this server is the built-in `setup` subcommand:
8
+
9
+ ```bash
10
+ npx @atlassian-dc-mcp/bitbucket setup
11
+ ```
12
+
13
+ It prompts for host, API base path, default page size, and API token, then stores them in the most secure place available:
14
+
15
+ - **macOS** — token in the login Keychain (service `atlassian-dc-mcp`, account `bitbucket-token`); host / base path / page size in `~/.atlassian-dc-mcp/bitbucket.env` (mode `0600`).
16
+ - **Linux** — everything in `~/.atlassian-dc-mcp/bitbucket.env` with POSIX mode `0600` (read/write for your user only).
17
+ - **Windows** — everything in `%USERPROFILE%\.atlassian-dc-mcp\bitbucket.env`. Node passes the mode bits but Windows ignores them, so the file inherits the ACL of your user profile directory (typically readable only by your user, SYSTEM, and Administrators).
18
+
19
+ After setup, you can launch the server without any environment variables:
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "atlassian-bitbucket-dc": {
25
+ "command": "npx",
26
+ "args": ["-y", "@atlassian-dc-mcp/bitbucket"]
27
+ }
28
+ }
29
+ }
30
+ ```
31
+
32
+ Environment variables still override stored values — see [Configuration sources](#configuration-sources) below.
33
+
5
34
  ## Claude Desktop Configuration
6
35
 
7
36
  To use this MCP connector with Claude Desktop, add the following to your Claude Desktop configuration:
@@ -94,7 +123,7 @@ Alternatively, you can use `BITBUCKET_API_BASE_PATH` instead of `BITBUCKET_HOST`
94
123
  BITBUCKET_DEFAULT_PAGE_SIZE=25
95
124
  ```
96
125
 
97
- Direct environment variables override values loaded from `ATLASSIAN_DC_MCP_CONFIG_FILE`.
126
+ See [Configuration sources](#configuration-sources) for the full precedence chain.
98
127
 
99
128
  To create a personal access token:
100
129
  - In Bitbucket, select your profile picture at the bottom left
@@ -103,6 +132,19 @@ Alternatively, you can use `BITBUCKET_API_BASE_PATH` instead of `BITBUCKET_HOST`
103
132
  - Set appropriate permissions for the token
104
133
  - Copy the token and store it securely (you won't be able to see it again)
105
134
 
135
+ ## Configuration sources
136
+
137
+ Each key is resolved by walking these sources in priority order and taking the first non-empty value:
138
+
139
+ | Priority | Source | Reads | Written by `setup` |
140
+ |---------:|--------|-------|--------------------|
141
+ | 100 | `process.env` (`BITBUCKET_HOST`, `BITBUCKET_API_BASE_PATH`, `BITBUCKET_API_TOKEN`, `BITBUCKET_DEFAULT_PAGE_SIZE`) | all keys | — |
142
+ | 80 | env file — `ATLASSIAN_DC_MCP_CONFIG_FILE` (absolute path) or `./.env` | all keys | — |
143
+ | 60 | home file — `~/.atlassian-dc-mcp/bitbucket.env` on macOS/Linux, `%USERPROFILE%\.atlassian-dc-mcp\bitbucket.env` on Windows (mode `0600` on POSIX; Windows inherits the user-profile ACL) | all keys | host, apiBasePath, defaultPageSize (always); token (non-darwin or keychain fallback) |
144
+ | 40 | macOS Keychain — service `atlassian-dc-mcp`, account `bitbucket-token` | token only | token (darwin only) |
145
+
146
+ `setup` always writes non-secret fields to the home file and tries the keychain first for the token. If a higher-priority source shadows the value being saved, `setup` prints a warning so you can unset the env var.
147
+
106
148
  ## Usage
107
149
 
108
150
  Or for development with auto-reload:
package/bin/run.js CHANGED
@@ -1,2 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import '../build/index.js';
2
+ const sub = process.argv[2];
3
+ if (sub === 'setup') {
4
+ await import('../build/setup.js');
5
+ } else {
6
+ await import('../build/index.js');
7
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=setup.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/setup.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ describe('bitbucket setup shim', () => {
4
+ it('calls runSetup with BITBUCKET_PRODUCT', () => {
5
+ const setupSource = fs.readFileSync(path.join(process.cwd(), 'src', 'setup.ts'), 'utf8');
6
+ expect(setupSource).toMatch(/runSetup\(\s*BITBUCKET_PRODUCT\s*\)/);
7
+ expect(setupSource).toMatch(/from\s+['"]@atlassian-dc-mcp\/common['"]/);
8
+ expect(setupSource).toMatch(/import\s+\{\s*BITBUCKET_PRODUCT\s*\}\s+from\s+['"]\.\/config\.js['"]/);
9
+ });
10
+ });
11
+ //# sourceMappingURL=setup.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.test.js","sourceRoot":"","sources":["../../src/__tests__/setup.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;QACzF,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAC;QACnE,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC;QACxE,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,sEAAsE,CAAC,CAAC;IACtG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/build/config.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { type ProductDefinition } from '@atlassian-dc-mcp/common';
2
+ export declare const BITBUCKET_PRODUCT: ProductDefinition;
1
3
  export declare function getBitbucketRuntimeConfig(): import("@atlassian-dc-mcp/common").ProductRuntimeConfig;
2
4
  export declare function getDefaultPageSize(): number;
3
5
  export declare function getMissingConfig(): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,wBAAgB,yBAAyB,4DAExC;AAED,wBAAgB,kBAAkB,WAEjC;AAED,wBAAgB,gBAAgB,aAE/B"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAElC,eAAO,MAAM,iBAAiB,EAAE,iBAS/B,CAAC;AAEF,wBAAgB,yBAAyB,4DAExC;AAED,wBAAgB,kBAAkB,WAEjC;AAED,wBAAgB,gBAAgB,aAE/B"}
package/build/config.js CHANGED
@@ -1,11 +1,21 @@
1
- import { getProductRuntimeConfig, validateProductRuntimeConfig } from '@atlassian-dc-mcp/common';
1
+ import { getProductRuntimeConfig, validateProductRuntimeConfig, } from '@atlassian-dc-mcp/common';
2
+ export const BITBUCKET_PRODUCT = {
3
+ id: 'bitbucket',
4
+ envVars: {
5
+ host: 'BITBUCKET_HOST',
6
+ apiBasePath: 'BITBUCKET_API_BASE_PATH',
7
+ token: 'BITBUCKET_API_TOKEN',
8
+ defaultPageSize: 'BITBUCKET_DEFAULT_PAGE_SIZE',
9
+ },
10
+ defaultApiBasePath: '/rest/api/1.0',
11
+ };
2
12
  export function getBitbucketRuntimeConfig() {
3
- return getProductRuntimeConfig('bitbucket');
13
+ return getProductRuntimeConfig(BITBUCKET_PRODUCT);
4
14
  }
5
15
  export function getDefaultPageSize() {
6
16
  return getBitbucketRuntimeConfig().defaultPageSize;
7
17
  }
8
18
  export function getMissingConfig() {
9
- return validateProductRuntimeConfig('bitbucket');
19
+ return validateProductRuntimeConfig(BITBUCKET_PRODUCT);
10
20
  }
11
21
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAEjG,MAAM,UAAU,yBAAyB;IACvC,OAAO,uBAAuB,CAAC,WAAW,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,yBAAyB,EAAE,CAAC,eAAe,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,4BAA4B,CAAC,WAAW,CAAC,CAAC;AACnD,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,4BAA4B,GAE7B,MAAM,0BAA0B,CAAC;AAElC,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD,EAAE,EAAE,WAAW;IACf,OAAO,EAAE;QACP,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,yBAAyB;QACtC,KAAK,EAAE,qBAAqB;QAC5B,eAAe,EAAE,6BAA6B;KAC/C;IACD,kBAAkB,EAAE,eAAe;CACpC,CAAC;AAEF,MAAM,UAAU,yBAAyB;IACvC,OAAO,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,yBAAyB,EAAE,CAAC,eAAe,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,4BAA4B,CAAC,iBAAiB,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":""}
package/build/setup.js ADDED
@@ -0,0 +1,4 @@
1
+ import { runSetup } from '@atlassian-dc-mcp/common';
2
+ import { BITBUCKET_PRODUCT } from './config.js';
3
+ await runSetup(BITBUCKET_PRODUCT);
4
+ //# sourceMappingURL=setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,QAAQ,CAAC,iBAAiB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlassian-dc-mcp/bitbucket",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "main": "build/index.js",
5
5
  "type": "module",
6
6
  "bin": "./bin/run.js",
@@ -31,7 +31,7 @@
31
31
  "test": "jest"
32
32
  },
33
33
  "dependencies": {
34
- "@atlassian-dc-mcp/common": "^0.16.0",
34
+ "@atlassian-dc-mcp/common": "^0.17.0",
35
35
  "@modelcontextprotocol/sdk": "^1.27.1",
36
36
  "dotenv": "^16.4.7",
37
37
  "zod": "^3.24.2"
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "eb8394fc8317b2d986b03de9853edf47aa77566a"
51
+ "gitHead": "3f2e386c4f08b0ff6781dde37ce6e54f6dcb8d51"
52
52
  }
@@ -0,0 +1,11 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ describe('bitbucket setup shim', () => {
5
+ it('calls runSetup with BITBUCKET_PRODUCT', () => {
6
+ const setupSource = fs.readFileSync(path.join(process.cwd(), 'src', 'setup.ts'), 'utf8');
7
+ expect(setupSource).toMatch(/runSetup\(\s*BITBUCKET_PRODUCT\s*\)/);
8
+ expect(setupSource).toMatch(/from\s+['"]@atlassian-dc-mcp\/common['"]/);
9
+ expect(setupSource).toMatch(/import\s+\{\s*BITBUCKET_PRODUCT\s*\}\s+from\s+['"]\.\/config\.js['"]/);
10
+ });
11
+ });
package/src/config.ts CHANGED
@@ -1,7 +1,22 @@
1
- import { getProductRuntimeConfig, validateProductRuntimeConfig } from '@atlassian-dc-mcp/common';
1
+ import {
2
+ getProductRuntimeConfig,
3
+ validateProductRuntimeConfig,
4
+ type ProductDefinition,
5
+ } from '@atlassian-dc-mcp/common';
6
+
7
+ export const BITBUCKET_PRODUCT: ProductDefinition = {
8
+ id: 'bitbucket',
9
+ envVars: {
10
+ host: 'BITBUCKET_HOST',
11
+ apiBasePath: 'BITBUCKET_API_BASE_PATH',
12
+ token: 'BITBUCKET_API_TOKEN',
13
+ defaultPageSize: 'BITBUCKET_DEFAULT_PAGE_SIZE',
14
+ },
15
+ defaultApiBasePath: '/rest/api/1.0',
16
+ };
2
17
 
3
18
  export function getBitbucketRuntimeConfig() {
4
- return getProductRuntimeConfig('bitbucket');
19
+ return getProductRuntimeConfig(BITBUCKET_PRODUCT);
5
20
  }
6
21
 
7
22
  export function getDefaultPageSize() {
@@ -9,5 +24,5 @@ export function getDefaultPageSize() {
9
24
  }
10
25
 
11
26
  export function getMissingConfig() {
12
- return validateProductRuntimeConfig('bitbucket');
27
+ return validateProductRuntimeConfig(BITBUCKET_PRODUCT);
13
28
  }
package/src/setup.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { runSetup } from '@atlassian-dc-mcp/common';
2
+ import { BITBUCKET_PRODUCT } from './config.js';
3
+
4
+ await runSetup(BITBUCKET_PRODUCT);