diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..92ac816 --- /dev/null +++ b/.npmignore @@ -0,0 +1,48 @@ +# Source files +src/ +*.ts +!*.d.ts + +# Development files +.gitignore +tsconfig.json +.vscode/ +.idea/ + +# Test files +test/ +*.test.js +*.spec.js + +# Build artifacts +*.log +node_modules/ +.npm/ + +# OS files +.DS_Store +Thumbs.db + +# Editor files +*.swp +*.swo +*~ + +# Documentation source +docs/ + +# Scripts (except built ones) +scripts/ + +# Setup guides (keep README) +SETUP_GUIDE.md +SETUP_GUIDE_SERVER.md + +# Git +.git/ +.gitattributes + +# Other +.env +.env.local +.env.*.local diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..59c280a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,44 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.2.0] - 2025-06-04 + +### Added +- Complete implementation of all Bitbucket MCP tools +- Support for both Bitbucket Cloud and Server +- Core PR lifecycle tools: + - `create_pull_request` - Create new pull requests + - `update_pull_request` - Update PR details + - `merge_pull_request` - Merge pull requests + - `list_branches` - List repository branches + - `delete_branch` - Delete branches +- Enhanced `add_comment` with inline comment support +- Code review tools: + - `get_pull_request_diff` - Get PR diff/changes + - `approve_pull_request` - Approve PRs + - `unapprove_pull_request` - Remove approval + - `request_changes` - Request changes on PRs + - `remove_requested_changes` - Remove change requests +- npm package configuration for easy installation via npx + +### Fixed +- Author filter for Bitbucket Server (uses `role.1=AUTHOR` and `username.1=email`) +- Branch deletion handling for 204 No Content responses + +### Changed +- Package name to `@nexus2520/bitbucket-mcp-server` for npm publishing + +## [0.1.0] - 2025-06-03 + +### Added +- Initial implementation with basic tools: + - `get_pull_request` - Get PR details + - `list_pull_requests` - List PRs with filters +- Support for Bitbucket Cloud with app passwords +- Support for Bitbucket Server with HTTP access tokens +- Authentication setup script +- Comprehensive documentation diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..078946e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Parth Dogra + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index daf9941..473be78 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # Bitbucket MCP Server -An MCP (Model Context Protocol) server that provides tools for interacting with the Bitbucket API. +[![npm version](https://badge.fury.io/js/@nexus2520%2Fbitbucket-mcp-server.svg)](https://www.npmjs.com/package/@nexus2520/bitbucket-mcp-server) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + +An MCP (Model Context Protocol) server that provides tools for interacting with the Bitbucket API, supporting both Bitbucket Cloud and Bitbucket Server. ## Features @@ -24,6 +27,50 @@ An MCP (Model Context Protocol) server that provides tools for interacting with ## Installation +### Using npx (Recommended) + +The easiest way to use this MCP server is directly with npx: + +```json +{ + "mcpServers": { + "bitbucket": { + "command": "npx", + "args": [ + "-y", + "@nexus2520/bitbucket-mcp-server" + ], + "env": { + "BITBUCKET_USERNAME": "your-username", + "BITBUCKET_APP_PASSWORD": "your-app-password" + } + } + } +} +``` + +For Bitbucket Server: +```json +{ + "mcpServers": { + "bitbucket": { + "command": "npx", + "args": [ + "-y", + "@nexus2520/bitbucket-mcp-server" + ], + "env": { + "BITBUCKET_USERNAME": "your.email@company.com", + "BITBUCKET_TOKEN": "your-http-access-token", + "BITBUCKET_BASE_URL": "https://bitbucket.yourcompany.com" + } + } + } +} +``` + +### From Source + 1. Clone or download this repository 2. Install dependencies: ```bash diff --git a/package.json b/package.json index f4ed57e..f32258e 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,47 @@ { - "name": "bitbucket-mcp-server", + "name": "@nexus2520/bitbucket-mcp-server", "version": "0.2.0", - "description": "MCP server for Bitbucket API integration", + "description": "MCP server for Bitbucket API integration - supports both Cloud and Server", "type": "module", "main": "./build/index.js", + "bin": { + "bitbucket-mcp-server": "./build/index.js" + }, + "files": [ + "build/**/*", + "README.md", + "LICENSE", + "CHANGELOG.md" + ], "scripts": { "build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"", "dev": "tsc --watch", - "start": "node build/index.js" + "start": "node build/index.js", + "prepublishOnly": "npm run build" }, - "keywords": ["mcp", "bitbucket", "api"], - "author": "", + "keywords": [ + "mcp", + "bitbucket", + "api", + "model-context-protocol", + "bitbucket-server", + "bitbucket-cloud", + "pull-request", + "code-review" + ], + "author": "Parth Dogra", "license": "MIT", + "repository": { + "type": "git", + "url": "https://git.pratiknarola.com/Pdogra/bitbucket-mcp-server" + }, + "bugs": { + "url": "https://git.pratiknarola.com/Pdogra/bitbucket-mcp-server/issues" + }, + "homepage": "https://git.pratiknarola.com/Pdogra/bitbucket-mcp-server#readme", + "engines": { + "node": ">=16.0.0" + }, "dependencies": { "@modelcontextprotocol/sdk": "^1.12.1", "axios": "^1.9.0"