@tugudush/bitbucket-mcp 2.0.1 → 3.0.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 +120 -0
- package/README.md +153 -52
- package/build/api.d.ts +7 -1
- package/build/api.d.ts.map +1 -1
- package/build/api.js +68 -1
- package/build/api.js.map +1 -1
- package/build/handlers/commit.d.ts +27 -0
- package/build/handlers/commit.d.ts.map +1 -0
- package/build/handlers/commit.js +118 -0
- package/build/handlers/commit.js.map +1 -0
- package/build/handlers/diff.d.ts +27 -0
- package/build/handlers/diff.d.ts.map +1 -0
- package/build/handlers/diff.js +110 -0
- package/build/handlers/diff.js.map +1 -0
- package/build/handlers/index.d.ts +6 -3
- package/build/handlers/index.d.ts.map +1 -1
- package/build/handlers/index.js +36 -6
- package/build/handlers/index.js.map +1 -1
- package/build/handlers/pipeline.d.ts +27 -0
- package/build/handlers/pipeline.d.ts.map +1 -0
- package/build/handlers/pipeline.js +164 -0
- package/build/handlers/pipeline.js.map +1 -0
- package/build/handlers/pullrequest.d.ts +8 -0
- package/build/handlers/pullrequest.d.ts.map +1 -1
- package/build/handlers/pullrequest.js +60 -1
- package/build/handlers/pullrequest.js.map +1 -1
- package/build/handlers/repository.d.ts +12 -0
- package/build/handlers/repository.d.ts.map +1 -1
- package/build/handlers/repository.js +69 -10
- package/build/handlers/repository.js.map +1 -1
- package/build/handlers/workspace.d.ts +4 -0
- package/build/handlers/workspace.d.ts.map +1 -1
- package/build/handlers/workspace.js +26 -1
- package/build/handlers/workspace.js.map +1 -1
- package/build/index-new.d.ts +3 -0
- package/build/index-new.d.ts.map +1 -0
- package/build/index-new.js +43 -0
- package/build/index-new.js.map +1 -0
- package/build/index-old.d.ts +3 -0
- package/build/index-old.d.ts.map +1 -0
- package/build/index-old.js +1028 -0
- package/build/index-old.js.map +1 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/schemas.d.ts +309 -0
- package/build/schemas.d.ts.map +1 -1
- package/build/schemas.js +182 -0
- package/build/schemas.js.map +1 -1
- package/build/tools.d.ts.map +1 -1
- package/build/tools.js +91 -1
- package/build/tools.js.map +1 -1
- package/build/types.d.ts +163 -0
- package/build/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,126 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.0.0] - 2026-02-08
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Commit handler module**: New `src/handlers/commit.ts` with dedicated handlers for commit operations
|
|
13
|
+
- `bb_get_commit` — Get detailed commit information (hash, message, author, date, parents)
|
|
14
|
+
- `bb_get_commit_statuses` — Retrieve CI/CD build statuses for a specific commit with status icons
|
|
15
|
+
- `bb_get_merge_base` — Find the common ancestor between two commits or branches
|
|
16
|
+
- `bb_get_file_history` — View commit history for a specific file with author and size metadata
|
|
17
|
+
|
|
18
|
+
- **Pipeline handler module**: New `src/handlers/pipeline.ts` with full CI/CD pipeline support
|
|
19
|
+
- `bb_list_pipelines` — List pipeline runs for a repository sorted by most recent
|
|
20
|
+
- `bb_get_pipeline` — Get detailed info for a specific pipeline run (status, branch, commit, trigger, duration)
|
|
21
|
+
- `bb_get_pipeline_steps` — List steps/stages of a pipeline with execution details
|
|
22
|
+
- `bb_get_pipeline_step_log` — Retrieve build log output for a pipeline step (truncated to 50K chars for large logs)
|
|
23
|
+
- Helper utilities for UUID normalization, pipeline state formatting, and human-readable duration display
|
|
24
|
+
|
|
25
|
+
- **Pull request enhancements**: Extended `src/handlers/pullrequest.ts` with new tools
|
|
26
|
+
- `bb_get_pr_commits` — List commits belonging to a pull request
|
|
27
|
+
- `bb_get_pr_statuses` — Get CI/CD build statuses for a pull request
|
|
28
|
+
- `bb_get_pull_request_comment` — Fetch a single PR comment by ID
|
|
29
|
+
- `bb_get_comment_thread` — Retrieve comment thread with all nested replies
|
|
30
|
+
|
|
31
|
+
- **Repository handler enhancements**: Extended `src/handlers/repository.ts` with detail tools
|
|
32
|
+
- `bb_get_tag` — Get detailed tag information including target commit
|
|
33
|
+
- `bb_get_branch` — Get detailed branch information with merge strategies
|
|
34
|
+
|
|
35
|
+
- **Workspace and user tools**: Extended `src/handlers/workspace.ts` with user-facing tools
|
|
36
|
+
- `bb_get_user` — Get information about a specific Bitbucket user
|
|
37
|
+
- `bb_get_current_user` — Get details of the currently authenticated user
|
|
38
|
+
- `bb_list_user_pull_requests` — List pull requests for a specific user across repositories
|
|
39
|
+
|
|
40
|
+
- **Comprehensive TypeScript interfaces** in `src/types.ts` for strong typing
|
|
41
|
+
- `BitbucketCommitDetailed` — Detailed commit with parents and repository info
|
|
42
|
+
- `BitbucketCommitStatus` — CI/CD build status with state enum (`SUCCESSFUL`, `FAILED`, `INPROGRESS`, `STOPPED`)
|
|
43
|
+
- `BitbucketTag` — Tag ref with target commit details
|
|
44
|
+
- `BitbucketBranchDetailed` — Branch with merge strategies and default merge strategy
|
|
45
|
+
- `BitbucketMergeBase` — Merge base result interface
|
|
46
|
+
- `BitbucketFileHistoryEntry` — File history with commit and size metadata
|
|
47
|
+
- `BitbucketPipeline` — Pipeline run with state, target, trigger, and duration
|
|
48
|
+
- `BitbucketPipelineStep` — Pipeline step with script commands and image info
|
|
49
|
+
- `BitbucketPRTask` — PR task with state and creator
|
|
50
|
+
- `BitbucketSrcListingResponse` — Typed source listing response
|
|
51
|
+
|
|
52
|
+
- **New Zod schemas** in `src/schemas.ts` for all new tools with descriptive field documentation
|
|
53
|
+
|
|
54
|
+
- **Comprehensive test suite**: 4 test scripts for real-world validation
|
|
55
|
+
- `test_pr_445.js` — Full feature testing across 8 categories using real PR #445
|
|
56
|
+
- `test_pr_445_advanced.js` — Advanced testing for commit, diff, and tag tools with correct parameter names
|
|
57
|
+
- `test_pr_445_final.js` — Complete coverage with dynamic ID extraction
|
|
58
|
+
- `test_pr_408_comments.js` — PR comment thread verification with nested replies and inline comments
|
|
59
|
+
- Test results documented in `docs/TEST_RESULTS_PR_445.md`
|
|
60
|
+
|
|
61
|
+
- **Expanded API test coverage** in `src/__tests__/api.test.ts` with significantly more test cases
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
|
|
65
|
+
- **Handler registry**: Updated `src/handlers/index.ts` with 38 total registered tools (up from previous count)
|
|
66
|
+
- Tools organized by domain: repository, pull request, diff, commit, issue, workspace/user, search, pipeline
|
|
67
|
+
- **Tool definitions**: Updated `src/tools.ts` with definitions for all new tools
|
|
68
|
+
- **Documentation**: Updated `README.md`, `.github/copilot-instructions.md`, and `docs/reviews/codebase-review.md` to reflect new architecture and tools
|
|
69
|
+
- **Tool count**: Expanded from ~24 tools to **38 tools** total, with 31 verified via automated tests (100% pass rate on testable tools)
|
|
70
|
+
|
|
71
|
+
## [2.0.1] - 2026-01-26
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
- **Update instructions**: Added instructions for updating to the latest version in README
|
|
75
|
+
|
|
76
|
+
## [2.0.0] - 2026-01-26
|
|
77
|
+
|
|
78
|
+
### Added
|
|
79
|
+
- **PR comment retrieval**: New `bb_get_pull_request_comment` tool to fetch a single PR comment by ID
|
|
80
|
+
- Implemented `handleGetPullRequestComment` handler with `GetPullRequestCommentSchema` validation
|
|
81
|
+
- Enhanced `BitbucketComment` interface with `updated_on` and `deleted` fields
|
|
82
|
+
- **Comment threads**: New `bb_get_comment_thread` tool to retrieve comment threads with all nested replies
|
|
83
|
+
- Implemented `handleGetCommentThread` handler with `GetCommentThreadSchema` validation
|
|
84
|
+
- **Git reference resolution**: Implemented `resolveRefToCommitSha` function for uniform git reference resolution
|
|
85
|
+
- Enables robust handling of branches, tags, and commit SHAs when browsing repositories
|
|
86
|
+
- **Test suite**: Added `test_all_tools.js` — discovery-based test script with sequential workspace → repo → PR → issue testing
|
|
87
|
+
|
|
88
|
+
### Changed
|
|
89
|
+
- **Documentation**: Updated README and `.github/copilot-instructions.md` with PR comment and comment thread tool documentation
|
|
90
|
+
|
|
91
|
+
## [1.5.1] - 2025-12-20
|
|
92
|
+
|
|
93
|
+
### Added
|
|
94
|
+
- **Cursor IDE support**: Added Cursor configuration examples in README for MCP integration
|
|
95
|
+
|
|
96
|
+
### Changed
|
|
97
|
+
- **Version**: Bumped version to 1.5.1 in package.json and related files
|
|
98
|
+
|
|
99
|
+
## [1.5.0] - 2025-12-20
|
|
100
|
+
|
|
101
|
+
### Added
|
|
102
|
+
- **Modular handler architecture**: Major refactoring — replaced large switch statement in `tools.ts` with handler registry pattern
|
|
103
|
+
- New `src/handlers/` directory with domain-specific handler modules:
|
|
104
|
+
- `repository.ts` — Repository, branch, tag, file, and browsing operations
|
|
105
|
+
- `pullrequest.ts` — Pull request listing, details, comments, and activity
|
|
106
|
+
- `issue.ts` — Issue listing and detail retrieval
|
|
107
|
+
- `workspace.ts` — Workspace discovery and user operations
|
|
108
|
+
- `search.ts` — Repository and code search operations
|
|
109
|
+
- `diff.ts` — Diff and diffstat operations (already existed, now modularized)
|
|
110
|
+
- `src/handlers/index.ts` — Central handler registry mapping tool names to handlers
|
|
111
|
+
- `src/handlers/types.ts` — Shared `ToolHandler` and `ToolResponse` interfaces
|
|
112
|
+
- Reduced `tools.ts` from ~800 lines to a clean lookup pattern
|
|
113
|
+
- **API test suite**: Added `src/__tests__/api.test.ts` with comprehensive API layer tests
|
|
114
|
+
- **Development guide**: Created `DEVELOPMENT.md` with detailed development and authentication documentation
|
|
115
|
+
- **Publishing guide**: Created `docs/publishing.md` with comprehensive NPM and GitHub releases workflow
|
|
116
|
+
- **Codebase review**: Added `docs/reviews/codebase-review.md` with architecture analysis
|
|
117
|
+
|
|
118
|
+
### Changed
|
|
119
|
+
- **Authentication**: Streamlined authentication process, removed legacy app password support
|
|
120
|
+
- Simplified to API token (`BITBUCKET_API_TOKEN` + `BITBUCKET_EMAIL`) only
|
|
121
|
+
- Removed deprecated app password configuration from code and documentation
|
|
122
|
+
- **README**: Streamlined authentication section and enhanced integration instructions
|
|
123
|
+
|
|
124
|
+
### Removed
|
|
125
|
+
- **Legacy files**: Removed `src/index-new.ts` and `src/index-old.ts` (consolidated into modular architecture)
|
|
126
|
+
- **App password auth**: Removed legacy app password authentication support from config and API layer
|
|
127
|
+
|
|
8
128
|
## [1.4.13] - 2025-08-23
|
|
9
129
|
|
|
10
130
|
### Changed
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A **read-only** Model Context Protocol (MCP) server that provides secure access to Bitbucket repositories, pull requests, issues, and more. Integrates seamlessly with VS Code GitHub Copilot, Cursor, and Claude Desktop.
|
|
4
4
|
|
|
5
|
+
**🎯 38 tools available** | **✅ 100% tested** (31/38 tools verified) | **🏗️ Modular architecture**
|
|
6
|
+
|
|
5
7
|
## Requirements
|
|
6
8
|
|
|
7
9
|
- **Code Search**: Enable at https://bitbucket.org/search for `bb_search_code` functionality
|
|
@@ -158,31 +160,61 @@ If you built from source:
|
|
|
158
160
|
|
|
159
161
|
## Features
|
|
160
162
|
|
|
161
|
-
|
|
163
|
+
### 🗂️ Repository Management (8 tools)
|
|
162
164
|
- `bb_list_workspaces` - Discover accessible workspaces
|
|
165
|
+
- `bb_get_workspace` - Get workspace details
|
|
163
166
|
- `bb_list_repositories` - List repositories across workspaces
|
|
164
167
|
- `bb_get_repository` - Get repository details
|
|
168
|
+
- `bb_search_repositories` - Find repositories by name/description
|
|
165
169
|
- `bb_browse_repository` - Explore directory structure (supports branches with slashes like `feature/SSP-1024`)
|
|
166
170
|
- `bb_get_file_content` - Read files with pagination (1-10,000 lines)
|
|
171
|
+
- `bb_get_file_history` - Get commit history for specific files
|
|
167
172
|
|
|
168
|
-
|
|
169
|
-
- `bb_get_pull_requests
|
|
173
|
+
### 🔀 Pull Requests (11 tools)
|
|
174
|
+
- `bb_get_pull_requests` - List all pull requests
|
|
175
|
+
- `bb_get_pull_request` - Get detailed PR information
|
|
170
176
|
- `bb_get_pull_request_comments` - List all comments on a PR
|
|
171
177
|
- `bb_get_pull_request_comment` - Get a single comment by ID
|
|
172
178
|
- `bb_get_comment_thread` - Get a comment thread with all nested replies
|
|
173
179
|
- `bb_get_pull_request_activity` - Track reviews, approvals, state changes
|
|
174
|
-
- `
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
- `
|
|
178
|
-
|
|
179
|
-
|
|
180
|
+
- `bb_get_pull_request_diff` - Get unified diff for a PR
|
|
181
|
+
- `bb_get_pull_request_diffstat` - Get per-file change statistics
|
|
182
|
+
- `bb_get_pr_commits` - List commits in a PR
|
|
183
|
+
- `bb_get_pr_statuses` - Get CI/CD build statuses for a PR
|
|
184
|
+
- `bb_list_user_pull_requests` - List all PRs for a user across repositories
|
|
185
|
+
|
|
186
|
+
### 🌿 Branches & Commits (8 tools)
|
|
187
|
+
- `bb_get_branches` - List all branches
|
|
188
|
+
- `bb_get_branch` - Get detailed branch information
|
|
189
|
+
- `bb_get_commits` - List commit history
|
|
190
|
+
- `bb_get_commit` - Get detailed commit information
|
|
191
|
+
- `bb_get_commit_statuses` - Get CI/CD build statuses for a commit
|
|
192
|
+
- `bb_get_merge_base` - Find common ancestor between branches
|
|
193
|
+
- `bb_get_tags` - List repository tags
|
|
194
|
+
- `bb_get_tag` - Get detailed tag information
|
|
195
|
+
|
|
196
|
+
### 🔍 Diff & Comparison (2 tools)
|
|
197
|
+
- `bb_get_diff` - Get unified diff between commits
|
|
198
|
+
- `bb_get_diffstat` - Get per-file change statistics between commits
|
|
199
|
+
|
|
200
|
+
### � CI/CD Pipelines (4 tools)
|
|
201
|
+
- `bb_list_pipelines` - List pipeline runs
|
|
202
|
+
- `bb_get_pipeline` - Get detailed pipeline information
|
|
203
|
+
- `bb_get_pipeline_steps` - List pipeline steps/stages
|
|
204
|
+
- `bb_get_pipeline_step_log` - Get build logs for pipeline steps
|
|
205
|
+
|
|
206
|
+
### �🐛 Issues (2 tools)
|
|
207
|
+
- `bb_get_issues` - List repository issues
|
|
208
|
+
- `bb_get_issue` - Get detailed issue information
|
|
209
|
+
|
|
210
|
+
### 🔍 Search & Discovery (1 tool)
|
|
180
211
|
- `bb_search_code` - Advanced code search with language filtering
|
|
181
|
-
- `bb_search_repositories` - Find repositories
|
|
182
212
|
|
|
183
|
-
|
|
184
|
-
- `bb_get_user
|
|
185
|
-
- `
|
|
213
|
+
### 👤 User Information (2 tools)
|
|
214
|
+
- `bb_get_user` - Get user information
|
|
215
|
+
- `bb_get_current_user` - Get authenticated user information
|
|
216
|
+
|
|
217
|
+
**Total: 38 tools across 8 categories**
|
|
186
218
|
|
|
187
219
|
## Usage Examples
|
|
188
220
|
|
|
@@ -190,11 +222,13 @@ If you built from source:
|
|
|
190
222
|
- "List all my accessible workspaces"
|
|
191
223
|
- "Browse the root directory of myworkspace/myrepo"
|
|
192
224
|
- "Browse the tests directory in feature/deployment-fixes branch"
|
|
225
|
+
- "Search for repositories containing 'keycloak' in myworkspace"
|
|
193
226
|
|
|
194
|
-
**
|
|
227
|
+
**File Operations:**
|
|
195
228
|
- "Read lines 100-200 of src/app.py from myworkspace/myrepo"
|
|
196
229
|
- "Get the first 50 lines of README.md"
|
|
197
|
-
- "Show me the package.json file
|
|
230
|
+
- "Show me the package.json file from develop branch"
|
|
231
|
+
- "Get the commit history for src/components/Header.tsx"
|
|
198
232
|
|
|
199
233
|
**Code Search:**
|
|
200
234
|
- "Search for 'authentication' code in myworkspace/myrepo"
|
|
@@ -202,69 +236,133 @@ If you built from source:
|
|
|
202
236
|
- "Search for TypeScript interfaces in myworkspace/myrepo"
|
|
203
237
|
- "Look for 'TODO' comments in myworkspace/myrepo"
|
|
204
238
|
|
|
205
|
-
**Pull Requests &
|
|
206
|
-
- "List repositories in myworkspace"
|
|
239
|
+
**Pull Requests & Comments:**
|
|
207
240
|
- "Show open pull requests for myworkspace/myrepo"
|
|
241
|
+
- "Get details for PR #445 in myworkspace/myrepo"
|
|
242
|
+
- "List all comments on PR #408"
|
|
208
243
|
- "Get comment #744553155 from PR #408 in myworkspace/myrepo"
|
|
209
244
|
- "Get the comment thread for comment #744553155 on PR #408"
|
|
210
|
-
- "
|
|
245
|
+
- "Show me the diff for PR #445"
|
|
246
|
+
- "Get build statuses for PR #445"
|
|
247
|
+
|
|
248
|
+
**Branches & Commits:**
|
|
249
|
+
- "List all branches in myworkspace/myrepo"
|
|
250
|
+
- "Get details for the develop branch"
|
|
211
251
|
- "Show recent commits on main branch of myworkspace/myrepo"
|
|
252
|
+
- "Get commit details for 0fe347db"
|
|
253
|
+
- "Find the merge base between develop and main"
|
|
254
|
+
- "Show the diff between commits abc123 and def456"
|
|
255
|
+
|
|
256
|
+
**Tags & Releases:**
|
|
257
|
+
- "List all tags in myworkspace/myrepo"
|
|
258
|
+
- "Get details for tag stable-v1.0.2.0"
|
|
212
259
|
|
|
213
260
|
## Development
|
|
214
261
|
|
|
262
|
+
### Build & Test Commands
|
|
263
|
+
```bash
|
|
264
|
+
npm run build # TypeScript compilation
|
|
265
|
+
npm run watch # Development mode with auto-rebuild
|
|
266
|
+
npm run ltf # Lint → Typecheck → Format (recommended before commits)
|
|
267
|
+
npm run ltfb # Lint → Typecheck → Format → Build (full pipeline)
|
|
268
|
+
node build/index.js # Test server startup
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Testing
|
|
215
272
|
```bash
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
node
|
|
273
|
+
# Run comprehensive test suite
|
|
274
|
+
node test_pr_445.js # Main test suite (8 tool categories)
|
|
275
|
+
node test_pr_445_advanced.js # Advanced features
|
|
276
|
+
node test_pr_445_final.js # Complete coverage
|
|
277
|
+
node test_pr_408_comments.js # Comment thread verification
|
|
219
278
|
```
|
|
220
279
|
|
|
221
|
-
**
|
|
280
|
+
**Test Coverage:** 31 out of 38 tools verified (100% success rate on testable tools)
|
|
281
|
+
- See [`docs/TEST_RESULTS_PR_445.md`](docs/TEST_RESULTS_PR_445.md) for detailed results
|
|
282
|
+
- Uses real production PRs for validation
|
|
283
|
+
- Tests workspace discovery, repositories, PRs, branches, commits, files, comments
|
|
284
|
+
|
|
285
|
+
### VS Code Integration
|
|
222
286
|
- Install GitHub Copilot extensions
|
|
223
287
|
- Use provided `.vscode/` configuration
|
|
224
288
|
- Open Copilot Chat with `Ctrl+Alt+I`
|
|
225
289
|
- Try: `using bitbucket, list repositories in myworkspace`
|
|
226
290
|
|
|
291
|
+
### Architecture
|
|
292
|
+
Modular design with handler registry pattern:
|
|
293
|
+
- `src/handlers/` - Domain-specific tool handlers (repository, pullrequest, commit, diff, workspace, search, issue, pipeline)
|
|
294
|
+
- `src/tools.ts` - Tool definitions and handler routing
|
|
295
|
+
- `src/schemas.ts` - Zod validation schemas with API constants
|
|
296
|
+
- `src/types.ts` - TypeScript interfaces for Bitbucket API
|
|
297
|
+
- `src/api.ts` - Request handling with retry logic
|
|
298
|
+
- `src/config.ts` - Configuration management
|
|
299
|
+
- `src/errors.ts` - Custom error classes
|
|
300
|
+
|
|
301
|
+
See [`.github/copilot-instructions.md`](.github/copilot-instructions.md) for detailed development guidelines.
|
|
302
|
+
|
|
227
303
|
## Security & Limitations
|
|
228
304
|
|
|
229
|
-
- ✅ **Read-only by design**: No write/delete/modify operations possible
|
|
305
|
+
- ✅ **Read-only by design**: No write/delete/modify operations possible at any level
|
|
306
|
+
- ✅ **Runtime protection**: `makeRequest()` blocks non-GET requests
|
|
230
307
|
- ✅ **Safe for production**: No destructive actions supported
|
|
231
|
-
- ✅ **Authenticated access**: Uses API tokens
|
|
308
|
+
- ✅ **Authenticated access**: Uses API tokens for private repositories
|
|
309
|
+
- ✅ **Type-safe**: Zod validation and TypeScript interfaces throughout
|
|
232
310
|
- ✅ **Branch support**: Handles branch names with special characters (e.g., `feature/SSP-1024`)
|
|
233
311
|
- ✅ **Dynamic commit resolution**: Automatically resolves branch names to commit SHAs for subdirectory browsing
|
|
234
|
-
-
|
|
235
|
-
- ⚠️ **
|
|
236
|
-
- ⚠️ **
|
|
312
|
+
- ✅ **Error handling**: Context-aware error messages with helpful suggestions
|
|
313
|
+
- ⚠️ **Rate limiting**: Subject to Bitbucket API limits (no custom throttling)
|
|
314
|
+
- ⚠️ **Code search**: Requires enablement in Bitbucket account settings at https://bitbucket.org/search
|
|
315
|
+
- ⚠️ **File size limits**: Large files handled with pagination (up to 10,000 lines per request)
|
|
237
316
|
|
|
238
317
|
## Development Status
|
|
239
318
|
|
|
240
|
-
|
|
319
|
+
✅ **Production Ready** - Comprehensive test coverage with 31/38 tools verified (100% success on testable tools)
|
|
320
|
+
|
|
321
|
+
**Recent Updates (2026-02):**
|
|
322
|
+
- ✅ Modular handler registry architecture
|
|
323
|
+
- ✅ Comprehensive test suite with real-world validation
|
|
324
|
+
- ✅ 38 tools covering all major Bitbucket operations
|
|
325
|
+
- ✅ Type-safe with Zod validation and TypeScript interfaces
|
|
326
|
+
- ✅ Full comment thread support (inline comments with nested replies)
|
|
327
|
+
|
|
328
|
+
We welcome contributions and feedback!
|
|
241
329
|
|
|
242
330
|
## API Coverage
|
|
243
331
|
|
|
244
|
-
The server implements tools
|
|
245
|
-
|
|
246
|
-
- **
|
|
247
|
-
- **
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
- **
|
|
254
|
-
- **
|
|
255
|
-
- **Search API**
|
|
256
|
-
- **Users API**
|
|
257
|
-
- **
|
|
258
|
-
|
|
259
|
-
|
|
332
|
+
The server implements **38 tools** covering all major Bitbucket Cloud API v2.0 endpoints (read-only):
|
|
333
|
+
|
|
334
|
+
- **Workspaces API** - Workspace discovery and information
|
|
335
|
+
- **Repositories API** - Repository listing, details, browsing, and search
|
|
336
|
+
- **Source API** - File content access with pagination, file history
|
|
337
|
+
- **Pull Requests API** - PR management, comments, threads, activity, diffs, commits, statuses
|
|
338
|
+
- **Branches API** - Branch listing, details, and comparison
|
|
339
|
+
- **Commits API** - Commit history, details, and statuses
|
|
340
|
+
- **Tags API** - Tag listing and details
|
|
341
|
+
- **Diff API** - Unified diffs and diffstats between commits
|
|
342
|
+
- **Issues API** - Issue listing and details
|
|
343
|
+
- **Search API** - Code search with language filtering and match highlighting
|
|
344
|
+
- **Users API** - User and authenticated user information
|
|
345
|
+
- **Pipelines API** - CI/CD pipeline information (read-only)
|
|
346
|
+
|
|
347
|
+
**Test Coverage:** See [`docs/TEST_RESULTS_PR_445.md`](docs/TEST_RESULTS_PR_445.md) for verification details.
|
|
260
348
|
|
|
261
349
|
## Contributing
|
|
262
350
|
|
|
351
|
+
Contributions are welcome! Please follow these guidelines:
|
|
352
|
+
|
|
263
353
|
1. Fork the repository
|
|
264
354
|
2. Create a feature branch
|
|
265
|
-
3. Make your changes
|
|
266
|
-
|
|
267
|
-
|
|
355
|
+
3. Make your changes:
|
|
356
|
+
- Maintain read-only design principles
|
|
357
|
+
- Follow the handler registry pattern (see `src/handlers/`)
|
|
358
|
+
- Add TypeScript interfaces and Zod schemas
|
|
359
|
+
- Use typed `makeRequest<T>()` calls
|
|
360
|
+
- Format responses as readable text
|
|
361
|
+
4. Add tests if applicable (see test suite patterns)
|
|
362
|
+
5. Run `npm run ltfb` before committing
|
|
363
|
+
6. Submit a pull request
|
|
364
|
+
|
|
365
|
+
See [`.github/copilot-instructions.md`](.github/copilot-instructions.md) for detailed development guidelines.
|
|
268
366
|
|
|
269
367
|
## Support
|
|
270
368
|
|
|
@@ -286,10 +384,13 @@ You can also run `npm fund` in your project to see all funding information.
|
|
|
286
384
|
|
|
287
385
|
Future enhancements (all read-only):
|
|
288
386
|
|
|
387
|
+
- ✅ ~~38 comprehensive tools~~ **COMPLETE**
|
|
388
|
+
- ✅ ~~Comment threads with nested replies~~ **COMPLETE**
|
|
389
|
+
- ✅ ~~Comprehensive test suite~~ **COMPLETE**
|
|
390
|
+
- ✅ ~~Modular handler architecture~~ **COMPLETE**
|
|
289
391
|
- Repository statistics and analytics
|
|
290
392
|
- Enhanced search capabilities with more filter options
|
|
291
|
-
- Webhook information retrieval
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
- Advanced code search filters and sorting
|
|
393
|
+
- Webhook information retrieval (read-only)
|
|
394
|
+
- Extended pipeline details and logs
|
|
395
|
+
- Repository comparison and analytics tools
|
|
396
|
+
- Advanced code search with AI-powered insights
|
package/build/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Config } from './config.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Bitbucket API configuration and request handling
|
|
4
4
|
*/
|
|
5
|
-
export declare const VERSION = "
|
|
5
|
+
export declare const VERSION = "3.0.0";
|
|
6
6
|
export declare const BITBUCKET_API_BASE = "https://api.bitbucket.org/2.0";
|
|
7
7
|
/**
|
|
8
8
|
* Build authentication headers based on available credentials
|
|
@@ -24,6 +24,12 @@ export declare function buildRequestHeaders(accept?: string, config?: Config): R
|
|
|
24
24
|
* Includes timeout and retry logic for improved reliability
|
|
25
25
|
*/
|
|
26
26
|
export declare function makeRequest<T = unknown>(url: string, options?: RequestInit): Promise<T>;
|
|
27
|
+
/**
|
|
28
|
+
* Make an authenticated request that returns raw text (not JSON).
|
|
29
|
+
* Used for diff endpoints that return text/plain content.
|
|
30
|
+
* Follows redirects automatically (PR diff endpoints return 302).
|
|
31
|
+
*/
|
|
32
|
+
export declare function makeTextRequest(url: string, options?: RequestInit): Promise<string>;
|
|
27
33
|
/**
|
|
28
34
|
* Build URL for Bitbucket API endpoints
|
|
29
35
|
*/
|
package/build/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,aAAa,CAAC;AAIjD;;GAEG;AAGH,eAAO,MAAM,OAAO,UAAU,CAAC;AAQ/B,eAAO,MAAM,kBAAkB,kCAAkC,CAAC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CAAC,CAAC,GAAG,OAAO,EAC3C,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,CAAC,CAAC,CAkGZ;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAwFjB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,eAAe,CAgBjB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAUR"}
|
package/build/api.js
CHANGED
|
@@ -5,7 +5,7 @@ import { API_CONSTANTS } from './schemas.js';
|
|
|
5
5
|
* Bitbucket API configuration and request handling
|
|
6
6
|
*/
|
|
7
7
|
// Package version - kept in sync with package.json
|
|
8
|
-
export const VERSION = '
|
|
8
|
+
export const VERSION = '3.0.0';
|
|
9
9
|
// Get config dynamically to handle environment changes
|
|
10
10
|
function getConfig() {
|
|
11
11
|
return loadConfig();
|
|
@@ -131,6 +131,73 @@ export async function makeRequest(url, options = {}) {
|
|
|
131
131
|
throw (lastError ||
|
|
132
132
|
new Error(`Request failed after ${API_CONSTANTS.RETRY_ATTEMPTS} attempts`));
|
|
133
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Make an authenticated request that returns raw text (not JSON).
|
|
136
|
+
* Used for diff endpoints that return text/plain content.
|
|
137
|
+
* Follows redirects automatically (PR diff endpoints return 302).
|
|
138
|
+
*/
|
|
139
|
+
export async function makeTextRequest(url, options = {}) {
|
|
140
|
+
// Enforce read-only behavior
|
|
141
|
+
const requestedMethod = (options.method || 'GET').toString().toUpperCase();
|
|
142
|
+
if (requestedMethod !== 'GET') {
|
|
143
|
+
throw new Error(`Only GET requests are allowed. Attempted: ${requestedMethod} ${url}`);
|
|
144
|
+
}
|
|
145
|
+
const config = getConfig();
|
|
146
|
+
const headers = {
|
|
147
|
+
...buildRequestHeaders('text/plain', config),
|
|
148
|
+
...(options.headers || {}),
|
|
149
|
+
};
|
|
150
|
+
const timeout = config.BITBUCKET_REQUEST_TIMEOUT;
|
|
151
|
+
let lastError = null;
|
|
152
|
+
for (let attempt = 1; attempt <= API_CONSTANTS.RETRY_ATTEMPTS; attempt++) {
|
|
153
|
+
const controller = new AbortController();
|
|
154
|
+
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
155
|
+
try {
|
|
156
|
+
const response = await fetch(url, {
|
|
157
|
+
...options,
|
|
158
|
+
method: 'GET',
|
|
159
|
+
headers,
|
|
160
|
+
signal: controller.signal,
|
|
161
|
+
redirect: 'follow', // Follow 302 redirects from PR diff endpoints
|
|
162
|
+
});
|
|
163
|
+
clearTimeout(timeoutId);
|
|
164
|
+
if (!response.ok) {
|
|
165
|
+
const errorText = await response.text();
|
|
166
|
+
let errorData;
|
|
167
|
+
try {
|
|
168
|
+
errorData = JSON.parse(errorText);
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
errorData = { message: errorText };
|
|
172
|
+
}
|
|
173
|
+
if (isRetryableError(response.status) &&
|
|
174
|
+
attempt < API_CONSTANTS.RETRY_ATTEMPTS) {
|
|
175
|
+
const backoffMs = Math.pow(2, attempt - 1) * 1000;
|
|
176
|
+
await sleep(backoffMs);
|
|
177
|
+
lastError = createApiError(response.status, response.statusText, errorData, url);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
throw createApiError(response.status, response.statusText, errorData, url);
|
|
181
|
+
}
|
|
182
|
+
return await response.text();
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
clearTimeout(timeoutId);
|
|
186
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
187
|
+
lastError = new Error(`Request timeout after ${timeout}ms: ${url}`);
|
|
188
|
+
if (attempt < API_CONSTANTS.RETRY_ATTEMPTS) {
|
|
189
|
+
const backoffMs = Math.pow(2, attempt - 1) * 1000;
|
|
190
|
+
await sleep(backoffMs);
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
throw lastError;
|
|
194
|
+
}
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
throw (lastError ||
|
|
199
|
+
new Error(`Request failed after ${API_CONSTANTS.RETRY_ATTEMPTS} attempts`));
|
|
200
|
+
}
|
|
134
201
|
/**
|
|
135
202
|
* Build URL for Bitbucket API endpoints
|
|
136
203
|
*/
|
package/build/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;GAEG;AAEH,mDAAmD;AACnD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,uDAAuD;AACvD,SAAS,SAAS;IAChB,OAAO,UAAU,EAAE,CAAC;AACtB,CAAC;AAED,yBAAyB;AACzB,MAAM,CAAC,MAAM,kBAAkB,GAAG,+BAA+B,CAAC;AAElE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAe;IAC9C,MAAM,GAAG,GAAG,MAAM,IAAI,SAAS,EAAE,CAAC;IAClC,MAAM,OAAO,GAA2B,EAAE,CAAC;IAE3C,IAAI,GAAG,CAAC,mBAAmB,IAAI,GAAG,CAAC,eAAe,EAAE,CAAC;QACnD,0CAA0C;QAC1C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CACtB,GAAG,GAAG,CAAC,eAAe,IAAI,GAA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EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,GAAW,EACX,MAA+B;IAE/B,MAAM,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,WAAW,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;IAEzC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAChD,OAAO,GAAG,GAAG,GAAG,SAAS,GAAG,WAAW,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commit-related tool handlers
|
|
3
|
+
*
|
|
4
|
+
* Implements:
|
|
5
|
+
* - bb_get_commit — Get detailed commit info
|
|
6
|
+
* - bb_get_commit_statuses — CI/CD build statuses for a commit
|
|
7
|
+
* - bb_get_merge_base — Common ancestor between two refs
|
|
8
|
+
* - bb_get_file_history — Commits that modified a file
|
|
9
|
+
*/
|
|
10
|
+
import { ToolResponse } from './types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Get detailed information about a specific commit
|
|
13
|
+
*/
|
|
14
|
+
export declare function handleGetCommit(args: unknown): Promise<ToolResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Get CI/CD build statuses for a specific commit
|
|
17
|
+
*/
|
|
18
|
+
export declare function handleGetCommitStatuses(args: unknown): Promise<ToolResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Get the common ancestor (merge-base) between two commits or branches
|
|
21
|
+
*/
|
|
22
|
+
export declare function handleGetMergeBase(args: unknown): Promise<ToolResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Get the commit history for a specific file
|
|
25
|
+
*/
|
|
26
|
+
export declare function handleGetFileHistory(args: unknown): Promise<ToolResponse>;
|
|
27
|
+
//# sourceMappingURL=commit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/handlers/commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,OAAO,EAAkB,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1D;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAmB1E;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,YAAY,CAAC,CAmDvB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAgB7E;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,YAAY,CAAC,CA8CvB"}
|