feat: Add Bitbucket Issue Tracker Integration with Environment Controls #146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 WHY - Context and Motivation
This PR enables AI assistants to interact with Bitbucket's issue tracking system through the MCP protocol. Users can now manage issues, comments, and track work directly through conversational interfaces without switching to the Bitbucket web UI. Additionally, it introduces granular control over which tool domains are exposed, allowing users to optimize for security, cost, and functionality by enabling only what they need.
📦 WHAT - What was Changed
This PR adds 11 files with comprehensive issue tracking functionality:
Core Implementation (3,211 lines added):
src/services/vendor.atlassian.issues.service.ts- Service layer with full CRUD operationssrc/services/vendor.atlassian.issues.types.ts- Type definitions and Zod schemassrc/controllers/atlassian.issues.controller.ts- Business logic and validationsrc/tools/atlassian.issues.tool.ts- MCP tool definitionssrc/controllers/atlassian.issues.formatter.ts- Markdown formatting for rich outputTesting (1,177 test cases):
src/services/vendor.atlassian.issues.test.ts- Integration tests for service layersrc/controllers/atlassian.issues.controller.test.ts- Controller test coverageConfiguration:
src/index.ts- Tool domain registration with environment-based controlREADME.md- Documentation for issue tracking tools and configurationpackage-lock.json- Dependency updates🔧 HOW - The Changes Were Made
Issue Management Architecture
graph TB MCP[MCP Client/AI Assistant] --> Tools[Issue Tools] Tools --> Controller[Issues Controller] Controller --> Service[Atlassian Issues Service] Service --> API[Bitbucket API] Controller --> Formatter[Markdown Formatter] Formatter --> Output[Rich Text Output] Service --> Types[Zod Schemas] Types --> Validation[Runtime Validation]Key Technical Decisions:
Full CRUD Operations: Implemented
bb_ls_issues,bb_get_issue,bb_create_issue,bb_update_issue,bb_delete_issuefor complete issue lifecycle managementComment Management: Added
bb_ls_issue_commentsandbb_add_issue_commentfor threaded discussionsAdvanced Filtering:
Environment-Based Tool Control:
TOOLS_*_ENABLEDenvironment variables for each tool domainError Handling:
Rich Formatting:
Tool Domain Controls
Users can now control which MCP tools are available:
This allows optimization for:
✅ Testing
Test Coverage:
💭 Open Questions
Should issue tracking tools be enabled by default, or remain opt-in? Current implementation defaults to disabled for security/cost optimization.
Should we add batch operations for issues (e.g., bulk update, bulk delete) or keep operations atomic?
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]