{"_id":"@nbhson43/s-bitbucket-mcp-server","_rev":"4-879f4b1df71efcb3e48040e60ec205da","name":"@nbhson43/s-bitbucket-mcp-server","dist-tags":{"latest":"1.5.1"},"versions":{"0.0.0-stage":{"name":"@nbhson43/s-bitbucket-mcp-server","version":"0.0.0-stage","_id":"@nbhson43/s-bitbucket-mcp-server@0.0.0-stage","stub":true,"maintainers":[{"name":"nbhson43","email":"nbhson43@gmail.com"}],"dist":{"shasum":"9d43213daf7310e86bf7ac255613cadc81ab9328","tarball":"https://registry.npmjs.org/@nbhson43/s-bitbucket-mcp-server/-/s-bitbucket-mcp-server-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-CgVhQrvjNG4r8xTUjlZMkvMzMsuLV9t8CM/5Xr69RUANEPE5kRMoaFlg6pQH/veZMsofX5YO+Gsx+5V8eQZfZA==","signatures":[{"sig":"MEQCIAHdTa0/XUFiU6ICHZVdnpzCPsv0zPnU7Rp2FOXon6vpAiBqShFq/8GBWnzZEpvqZU0jwmyFszGeWchcIi6IfSmE0A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":354},"_npmUser":{"name":"nbhson43","email":"nbhson43@gmail.com"},"description":"Temporary package placeholder for staged publishing","directories":{}},"1.4.0":{"name":"@nbhson43/s-bitbucket-mcp-server","version":"1.4.0","keywords":["bitbucket","mcp","model-context-protocol","atlassian","devtools"],"author":"","license":"MIT","_id":"@nbhson43/s-bitbucket-mcp-server@1.4.0","maintainers":[{"name":"nbhson43","email":"nbhson43@gmail.com"}],"homepage":"https://github.com/nbhson/tool-bitbucket-mcp#readme","bugs":{"url":"https://github.com/nbhson/tool-bitbucket-mcp/issues"},"bin":{"bitbucket-mcp":"build/index.js"},"dist":{"shasum":"704d29e6ad96ef66213d3a7e2e21a6f43aeaefc6","tarball":"https://registry.npmjs.org/@nbhson43/s-bitbucket-mcp-server/-/s-bitbucket-mcp-server-1.4.0.tgz","fileCount":28,"integrity":"sha512-UQQSN86puPIz0Axr4wW4Mi6LJ0xgMpp6vdwFWnfbw4eDDpjI/Nt6ysm6jJAwJb8OSQ19kDz7Fq7TgDxyDdRzsw==","signatures":[{"sig":"MEQCIDLzpK7O4+EcMpd0YY6ZU9h95pZK1P6ng1K/4qw4Tm49AiA0f5qLbD/JpaLS5bHBAWQOdIMVLuTwLGQTdQVhtcVjDA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQC8WXL/9XI6cawfZivqEOl5a8EMxcXJSBiFxBNAXav3mQIhAK1mXl7R6WkKdpfOBJfEuOrXslpFXExy/vClcTrwYC7G","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":145555},"main":"build/index.js","type":"module","engines":{"node":">=18.0.0"},"scripts":{"dev":"tsc --watch","lint":"tsc --noEmit","test":"vitest run","build":"tsc","start":"node build/index.js","format":"prettier --write \"src/**/*.ts\" \"*.{json,md}\"","start:http":"node build/index.js --http","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"*.{json,md}\"","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"nbhson43","email":"nbhson43@gmail.com"},"repository":{"url":"git+https://github.com/nbhson/tool-bitbucket-mcp.git","type":"git"},"_npmVersion":"10.9.9","description":"MCP server for Bitbucket Server integration","directories":{},"_nodeVersion":"22.23.3","dependencies":{"zod":"^3.25.76","axios":"^1.18.1","dotenv":"^17.4.2","@modelcontextprotocol/sdk":"^1.29.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.10","prettier":"^3.6.2","typescript":"^6.0.3","@types/node":"^26.1.0","@vitest/coverage-v8":"^4.1.10"},"_npmOperationalInternal":{"tmp":"tmp/s-bitbucket-mcp-server_1.4.0_1793210442446_0.8499510611564819","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"@nbhson43/s-bitbucket-mcp-server","version":"1.5.0","keywords":["bitbucket","mcp","model-context-protocol","atlassian","devtools"],"author":"","license":"MIT","_id":"@nbhson43/s-bitbucket-mcp-server@1.5.0","maintainers":[{"name":"nbhson43","email":"nbhson43@gmail.com"}],"homepage":"https://bitbucket.org/nbhson/tool-bitbucket-mcp#readme","bugs":{"url":"https://bitbucket.org/nbhson/tool-bitbucket-mcp/issues"},"bin":{"bitbucket-mcp":"build/index.js"},"dist":{"shasum":"e02a417b4b6422b2ce0fc62eed8ad35f04e64875","tarball":"https://registry.npmjs.org/@nbhson43/s-bitbucket-mcp-server/-/s-bitbucket-mcp-server-1.5.0.tgz","fileCount":38,"integrity":"sha512-GJP7yD5rSlCEuRO1MO4lVuFPaeF7pGDVZChtvUbe52KhzVvFwdY0CzWu3SKrwq2j1xkSshrUxbttqeCxUW24eg==","signatures":[{"sig":"MEYCIQCu9enktDxafcmNxLwrUwBXcqTZF/eNGUe5xHJwW17t5QIhAOzJv7yFtLPxfIo5BTYMWt3to8oNkkLZlfGrZxjMIFPE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDtz3IblrnTpz/VFKUxZQvV9WTlVK/z+Dsnk+xzBPaarAIgY/+KWB3HQAOvEQARQGd17WzWAE83b3J1j/yQDfEpaVc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":156961},"main":"build/index.js","type":"module","engines":{"node":">=18.0.0"},"gitHead":"13c8915a815b03ef8676923e035d23487fce387f","scripts":{"dev":"tsc --watch","lint":"eslint src && tsc --noEmit","test":"vitest run","build":"tsc","start":"node build/index.js","format":"prettier --write \"src/**/*.ts\" \"*.{json,md}\"","start:http":"node build/index.js --http","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"*.{json,md}\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"nbhson43","email":"nbhson43@gmail.com"},"repository":{"url":"git+https://bitbucket.org/nbhson/tool-bitbucket-mcp.git","type":"git"},"_npmVersion":"10.9.9","description":"MCP server for Bitbucket Server integration","directories":{},"_nodeVersion":"22.23.3","dependencies":{"zod":"^4.6.7","axios":"^1.21.0","dotenv":"^17.4.2","@modelcontextprotocol/sdk":"^1.32.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.20.0","vitest":"^5.0.5","globals":"^15.14.0","prettier":"^3.5.2","@eslint/js":"^9.20.0","typescript":"^5.7.3","@types/node":"^22.13.0","typescript-eslint":"^8.25.0","@vitest/coverage-v8":"^5.0.5","eslint-plugin-import-x":"^4.6.1","@typescript-eslint/parser":"^8.25.0","@typescript-eslint/eslint-plugin":"^8.25.0"},"_npmOperationalInternal":{"tmp":"tmp/s-bitbucket-mcp-server_1.5.0_1793291680539_0.7557401776176261","host":"s3://npm-registry-packages-npm-production"}},"1.5.1":{"_id":"@nbhson43/s-bitbucket-mcp-server@1.5.1","bin":{"bitbucket-mcp":"build/index.js"},"bugs":{"url":"https://github.com/nbhson/tool-bitbucket-mcp/issues"},"dist":{"shasum":"b334ce6970092fde5537331d13ece3b5793983f4","tarball":"https://registry.npmjs.org/@nbhson43/s-bitbucket-mcp-server/-/s-bitbucket-mcp-server-1.5.1.tgz","fileCount":47,"integrity":"sha512-f0fPwBwjUQXdpjET4ZN/DQjIurMevWM9s1ycxDhLaSjyhookoXbZ261bvnDZzyVnNgi7uE/8+2D4HNkvhX/VLA==","signatures":[{"sig":"MEYCIQDXzIvsFlBRrXysAOhpzpgGHtQlGJvofZgGZ7rMIXMcCgIhAOCzQy9356rF0TggEsLkf/4ZqcdHmQknhlL5zbIottgR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCO0tTK669JHk9Ai/phJqwBWmRS9wQS6iSs37N4TjuTeQIhAKjZVpLnvOAn5wCgGffhVv8Cw0eGL4vi3s8ekyhDMfFk"}],"unpackedSize":214894},"main":"build/index.js","name":"@nbhson43/s-bitbucket-mcp-server","type":"module","author":"","engines":{"node":">=18.0.0"},"gitHead":"0794cb0f881d4ac71b2e2628f124b4672e3eef69","license":"MIT","scripts":{"dev":"tsc --watch","lint":"eslint src && tsc --noEmit","test":"vitest run","build":"tsc","start":"node build/index.js","format":"prettier --write \"src/**/*.ts\" \"*.{json,md}\"","start:http":"node build/index.js --http","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"*.{json,md}\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"version":"1.5.1","_npmUser":{"name":"nbhson43","email":"nbhson43@gmail.com"},"homepage":"https://github.com/nbhson/tool-bitbucket-mcp#readme","keywords":["bitbucket","mcp","model-context-protocol","atlassian","devtools"],"repository":{"url":"git+https://github.com/nbhson/tool-bitbucket-mcp.git","type":"git"},"_npmVersion":"10.9.9","description":"MCP server for Bitbucket Server integration","directories":{},"maintainers":[{"name":"nbhson43","email":"nbhson43@gmail.com"}],"_nodeVersion":"22.23.3","dependencies":{"zod":"^4.6.7","axios":"^1.21.0","dotenv":"^18.0.9","@modelcontextprotocol/sdk":"^1.32.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.7.0","eslint":"^10.14.0","vitest":"^5.0.5","globals":"^17.13.0","prettier":"^3.5.2","@eslint/js":"^10.0.1","typescript":"^5.7.3","@types/node":"^26.6.6","typescript-eslint":"^8.72.1","@vitest/coverage-v8":"^5.0.5","eslint-plugin-import-x":"^4.17.1","@typescript-eslint/parser":"^8.72.1","@typescript-eslint/eslint-plugin":"^8.72.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/s-bitbucket-mcp-server_1.5.1_1793583281906_0.3944984589745104"}}},"time":{"created":"2026-10-28T17:58:33.746Z","modified":"2026-11-02T01:34:42.147Z","0.0.0-stage":"2026-10-28T17:58:33.746Z","1.4.0":"2026-10-28T18:00:42.535Z","1.5.0":"2026-10-29T16:34:40.632Z","1.5.1":"2026-11-02T01:34:41.986Z"},"bugs":{"url":"https://github.com/nbhson/tool-bitbucket-mcp/issues"},"license":"MIT","homepage":"https://github.com/nbhson/tool-bitbucket-mcp#readme","keywords":["bitbucket","mcp","model-context-protocol","atlassian","devtools"],"repository":{"url":"git+https://github.com/nbhson/tool-bitbucket-mcp.git","type":"git"},"description":"MCP server for Bitbucket Server integration","maintainers":[{"name":"nbhson43","email":"nbhson43@gmail.com"}],"readme":"# Bitbucket MCP Server\n\n> **Repository:** https://bitbucket.org/nbhson/tool-bitbucket-mcp\n> MCP (Model Context Protocol) server for Bitbucket Server (Data Center) integration.\n> This server provides tools to interact with Bitbucket Server APIs via Personal Access Token (PAT) authentication.\n\n## Tools (39)\n\n### Project Operations\n\n- **list_projects** — List all projects the user has access to (paged: `limit`/`start`, returns `{ values, isLastPage, nextPageStart }`)\n- **get_project_detail** — Get detailed information about a specific project\n\n### Repository Operations\n\n- **list_repositories** — List repositories in a specific project (paged)\n- **search_repositories** — Find repositories by name or description across all accessible projects (server-side `name` filter with concurrent fallback)\n- **fork_repository** — Fork a repository into a target project\n- **list_webhooks** — List webhooks configured on a repository (paged)\n\n### Branch Operations\n\n- **get_repo_branches** — List branches in a repository, with optional `filterText` (paged)\n- **get_default_branch** — Get the default branch of a repository\n- **create_branch** — Create a new branch (with optional `message`)\n- **delete_branch** — Delete a branch (with optional `dryRun` check)\n\n### Commit Operations\n\n- **get_repo_commits** — List recent commits in a repository (`until`/`since`/`path` filters, paged)\n- **get_commit_detail** — Get commit details with configurable detail level: `metadata`, `files` (changed file list), or `full` (unified diff)\n\n### Tag Operations\n\n- **get_repo_tags** — List tags in a repository, with optional `filterText` (paged)\n\n### Pull Request Operations\n\n- **get_pull_requests** — Get pull requests for a repository (filter by state: OPEN, MERGED, DECLINED, ALL; `order`, paged)\n- **get_pull_request_detail** — Get detailed information about a specific pull request\n- **create_pull_request** — Create a new pull request (with optional reviewers)\n- **update_pull_request** — Update PR title, description, reviewers with auto-refetch and 409 conflict retry\n- **merge_pull_request** — Merge a pull request (with optional `strategy` and message)\n- **decline_pull_request** — Decline/reject a pull request\n- **reopen_pull_request** — Reopen a declined pull request (auto-fetches `version` if omitted)\n- **get_pull_request_merge_status** — Check mergeability: `canMerge`, `conflicted`, vetoes\n- **get_pull_request_comments** — Get comments on a pull request (paged)\n- **get_pull_request_activities** — Get the activity stream of a pull request (paged)\n- **get_pull_request_reviewers** — List participants/reviewers with approval status\n- **get_pull_request_tasks** — List blocker tasks (BLOCKER comments), filterable by state\n- **get_pull_request_diff** — Get the diff of a pull request for code review (optional `path` filter)\n- **list_pr_commits** — List commits on a specific pull request with pagination\n- **set_review_status** — Set the caller's own review status: APPROVED, NEEDS_WORK, or UNAPPROVED (via participants endpoint, never touches other reviewers)\n\n### Comment Operations\n\n- **add_comment** — Add a comment (general, reply, inline code, or blocker task) to a pull request. Supports anchor for inline comments on specific file paths and line numbers.\n- **manage_comment** — Manage a comment or task: edit, delete, resolve, reopen, convert to task, or convert to comment\n\n### Source Code Operations\n\n- **get_file_content** — Get the raw content of a file (supports `at` ref parameter)\n- **get_directory_listing** — List files and directories at a given path (paged)\n- **get_file_diff** — Get the diff between two commits or branches for a specific file or all files\n- **get_file_history** — Get commit history for a single file (paged)\n- **get_commit_compare** — List commits between two refs (`fromRef..toRef`), useful for changelogs\n\n### User Operations\n\n- **get_current_user** — Get the Bitbucket user bound to the configured token\n- **search_users** — Search users by name, slug, or email (paged)\n\n### Code Search Operations\n\n- **search_code** — Index-backed exact-term search across a repository (case-insensitive, files <512 KiB)\n- **grep** — Regex search file contents across a repository (like ripgrep). Supports content/files/count modes, filename glob (`*`, `**`, `?`), path filtering, context lines, case-insensitive search, `max_files` fetch cap. Defaults to the repository's default branch when `ref` is omitted.\n\n## Tool Input Examples\n\nReady-to-paste `arguments` for every tool (grouped by domain):\n\n### Project Operations\n\n```json\n{\"tool\": \"list_projects\", \"arguments\": {\"limit\": 25}}\n{\"tool\": \"get_project_detail\", \"arguments\": {\"projectKey\": \"PROJ1\"}}\n```\n\n### Repository Operations\n\n```json\n{\"tool\": \"list_repositories\", \"arguments\": {\"projectKey\": \"PROJ1\", \"limit\": 50}}\n{\"tool\": \"search_repositories\", \"arguments\": {\"query\": \"api\", \"max_results\": 10}}\n{\"tool\": \"fork_repository\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"targetProjectKey\": \"PROJ2\"}}\n{\"tool\": \"list_webhooks\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\"}}\n```\n\n### Branch Operations\n\n```json\n{\"tool\": \"get_repo_branches\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"filterText\": \"feature/\"}}\n{\"tool\": \"get_default_branch\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\"}}\n{\"tool\": \"create_branch\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"name\": \"feature/login\", \"startPoint\": \"refs/heads/main\", \"message\": \"Add login feature\"}}\n{\"tool\": \"delete_branch\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"branchName\": \"refs/heads/old-feature\", \"dryRun\": true}}\n```\n\n### Commit Operations\n\n```json\n{\"tool\": \"get_repo_commits\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"until\": \"refs/heads/main\", \"limit\": 30}}\n{\"tool\": \"get_commit_detail\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"commitId\": \"abcdef123456\", \"detail\": \"full\"}}\n```\n\n### Tag Operations\n\n```json\n{\"tool\": \"get_repo_tags\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"filterText\": \"v1.\", \"limit\": 50}}\n```\n\n### Pull Request Operations\n\n```json\n{\"tool\": \"get_pull_requests\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"state\": \"OPEN\", \"limit\": 25}}\n{\"tool\": \"get_pull_request_detail\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42}}\n{\"tool\": \"create_pull_request\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"title\": \"Add login\", \"fromRef\": \"refs/heads/feature/login\", \"toRef\": \"refs/heads/main\", \"reviewers\": [\"jsmith\"]}}\n{\"tool\": \"update_pull_request\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42, \"title\": \"New title\"}}\n{\"tool\": \"merge_pull_request\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42, \"version\": 3, \"strategy\": \"squash\"}}\n{\"tool\": \"decline_pull_request\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42, \"version\": 3}}\n{\"tool\": \"reopen_pull_request\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42}}\n{\"tool\": \"get_pull_request_merge_status\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42}}\n{\"tool\": \"get_pull_request_comments\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42}}\n{\"tool\": \"get_pull_request_activities\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42}}\n{\"tool\": \"get_pull_request_reviewers\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42}}\n{\"tool\": \"get_pull_request_tasks\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42, \"state\": \"OPEN\"}}\n{\"tool\": \"get_pull_request_diff\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42}}\n{\"tool\": \"list_pr_commits\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42}}\n{\"tool\": \"set_review_status\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42, \"status\": \"APPROVED\"}}\n```\n\n### Comment Operations\n\n```json\n{\"tool\": \"add_comment\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42, \"text\": \"LGTM!\"}}\n{\"tool\": \"add_comment\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42, \"text\": \"Fix this\", \"severity\": \"BLOCKER\", \"anchor\": {\"path\": \"src/main.ts\", \"line\": 12, \"lineType\": \"ADDED\"}}}\n{\"tool\": \"manage_comment\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42, \"commentId\": 101, \"version\": 1, \"action\": \"edit\", \"text\": \"Updated text\"}}\n{\"tool\": \"manage_comment\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"pullRequestId\": 42, \"commentId\": 101, \"version\": 1, \"action\": \"delete\"}}\n```\n\n### Source Code Operations\n\n```json\n{\"tool\": \"get_file_content\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"path\": \"src/main.ts\", \"at\": \"refs/heads/main\"}}\n{\"tool\": \"get_directory_listing\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"path\": \"src\", \"at\": \"refs/heads/main\"}}\n{\"tool\": \"get_file_diff\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"fromRef\": \"refs/heads/main\", \"toRef\": \"refs/heads/feature/login\", \"path\": \"src/main.ts\"}}\n{\"tool\": \"get_file_history\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"path\": \"src/main.ts\", \"limit\": 20}}\n{\"tool\": \"get_commit_compare\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"fromRef\": \"v1.0.0\", \"toRef\": \"v1.1.0\"}}\n```\n\n### User Operations\n\n```json\n{\"tool\": \"get_current_user\", \"arguments\": {}}\n{\"tool\": \"search_users\", \"arguments\": {\"query\": \"john\", \"limit\": 10}}\n```\n\n### Code Search Operations\n\n```json\n{\"tool\": \"search_code\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"query\": \"TODO\", \"limit\": 25}}\n{\"tool\": \"grep\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"query\": \"function\\\\s+handle\\\\w+\", \"mode\": \"content\", \"glob\": \"src/**/*.ts\", \"context_lines\": 2, \"max_results\": 50}}\n{\"tool\": \"grep\", \"arguments\": {\"projectKey\": \"PROJ1\", \"repoSlug\": \"my-repo\", \"query\": \"FIXME\", \"mode\": \"count\", \"ref\": \"refs/heads/main\"}}\n```\n\n## Pagination\n\nEvery collection tool returns a stable envelope:\n\n```json\n{\n  \"values\": [...],\n  \"size\": 25,\n  \"isLastPage\": false,\n  \"nextPageStart\": 25,\n  \"limit\": 25,\n  \"start\": 0\n}\n```\n\nPass `nextPageStart` as `start` in the next call to fetch the following page.\n\n## Installation\n\n### Using npx (recommended)\n\n```bash\nnpx sbitbucket-mcp-server\n```\n\n### Using npm\n\n```bash\nnpm install -g sbitbucket-mcp-server\n```\n\n### Using Docker\n\n```bash\ndocker build -t bitbucket-mcp .\ndocker run --rm -i \\\n  -e BITBUCKET_URL=https://bitbucket.example.com \\\n  -e BITBUCKET_TOKEN=your-token \\\n  bitbucket-mcp\n```\n\nRemote HTTP mode:\n\n```bash\ndocker run --rm -p 3000:3000 \\\n  -e BITBUCKET_URL=https://bitbucket.example.com \\\n  -e BITBUCKET_TOKEN=your-token \\\n  bitbucket-mcp\n# MCP endpoint: http://localhost:3000/mcp\n# GET on the endpoint returns a health payload: {\"ok\": true, ...}\n```\n\n## Configuration\n\n### Environment Variables\n\nCopy `.env.example` to `.env` and fill in the values:\n\n| Variable                 | Required | Default     | Description                                                                       |\n| ------------------------ | -------- | ----------- | --------------------------------------------------------------------------------- |\n| `BITBUCKET_URL`          | Yes      | —           | Your Bitbucket Server URL (e.g., `https://bitbucket.example.com`)                 |\n| `BITBUCKET_TOKEN`        | Yes      | —           | Personal Access Token (PAT) for authentication                                    |\n| `BITBUCKET_INSECURE_SSL` | No       | `false`     | Set to `true` to skip TLS verification (self-signed certs, trusted networks only) |\n| `BITBUCKET_TIMEOUT_MS`   | No       | `30000`     | Per-request timeout in milliseconds                                               |\n| `BITBUCKET_MAX_RETRIES`  | No       | `2`         | Retries with backoff on HTTP 429/5xx                                              |\n| `BITBUCKET_CACHE_TTL_MS` | No       | `30000`     | Short TTL cache for GET responses (fewer repeated API calls); `0` disables        |\n| `MCP_TRANSPORT`          | No       | `stdio`     | `stdio` or `http`                                                                 |\n| `PORT`                   | No       | `3000`      | HTTP port in `http` mode                                                          |\n| `MCP_ENDPOINT`           | No       | `/mcp`      | HTTP endpoint path in `http` mode                                                 |\n| `HOST`                   | No       | `127.0.0.1` | HTTP bind address in `http` mode (non-loopback = insecure, warned at startup)     |\n\n> TLS certificates are verified by default. The legacy behavior of blindly\n> accepting any certificate now requires explicit opt-in via\n> `BITBUCKET_INSECURE_SSL=true`.\n\n### Transports\n\nStdio (default, for Claude Desktop / Cline / VS Code):\n\n```bash\nnpx sbitbucket-mcp-server\n```\n\nStreamable HTTP (stateless, binds to **127.0.0.1** by default for security):\n\n```bash\nnpx sbitbucket-mcp-server --http --port=3000 --endpoint=/mcp\n# or: npm run start:http\n\n# NOTE: HTTP transport binds to 127.0.0.1 — only accessible locally.\n# To bind on all interfaces (INSECURE — anyone on the network can invoke\n# your Bitbucket PAT), override with HOST=0.0.0.0 in the environment.\n# For remote hosting, put this behind a reverse proxy with TLS + auth.\n# or: npm run start:http\n```\n\n### Claude Desktop Configuration\n\nAdd to your Claude Desktop config file:\n\n```json\n{\n  \"mcpServers\": {\n    \"bitbucket\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"sbitbucket-mcp-server\"],\n      \"env\": {\n        \"BITBUCKET_URL\": \"https://your-bitbucket-server.com\",\n        \"BITBUCKET_TOKEN\": \"your-personal-access-token\"\n      }\n    }\n  }\n}\n```\n\n### Cline / VS Code Configuration\n\nAdd to your MCP settings:\n\n```json\n{\n  \"mcpServers\": {\n    \"bitbucket\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"sbitbucket-mcp-server\"],\n      \"env\": {\n        \"BITBUCKET_URL\": \"https://your-bitbucket-server.com\",\n        \"BITBUCKET_TOKEN\": \"your-personal-access-token\"\n      }\n    }\n  }\n}\n```\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Lint with ESLint + TypeScript\nnpm run lint\n\n# Format / check formatting\nnpm run format\nnpm run format:check\n\n# Development mode (watch)\nnpm run dev\n\n# Start server (stdio)\nnpm start\n\n# Start server (HTTP)\nnpm run start:http\n\n# Run tests\nnpm test\n```\n\n## Troubleshooting\n\n### Common Issues\n\n**`BITBUCKET_URL must be a valid URL` error**\n\n- Ensure `BITBUCKET_URL` uses `https://` and doesn't end with a trailing slash\n- Example: `https://bitbucket.example.com` (not `https://bitbucket.example.com/`)\n\n**`BITBUCKET_TOKEN is required` error**\n\n- Generate a Personal Access Token (PAT) in Bitbucket:\n  1. Go to **Profile → Personal access tokens**\n  2. Create a token with appropriate permissions (read/write based on your needs)\n  3. Set `BITBUCKET_TOKEN=your-token` in your environment\n\n**TLS/SSL certificate errors**\n\n- For self-signed certificates in dev environments: set `BITBUCKET_INSECURE_SSL=true`\n- **Warning:** Only use this in trusted networks, never in production\n\n**Rate limiting (HTTP 429)**\n\n- The server automatically retries with exponential backoff (default: 2 retries)\n- Adjust `BITBUCKET_MAX_RETRIES` for more retries\n- For heavy workloads, consider adding delays between requests\n\n**Branch names with slashes fail to delete**\n\n- Branch names containing `/` must be passed as full ref: `refs/heads/feature/my-branch`\n\n**Merge conflicts not detected**\n\n- Use `get_pull_request_merge_status` to check for conflicts before merging\n- Check `vetoes` array in the response for blocking reviews\n\n### Debug Mode\n\nEnable verbose logging by checking the console output:\n\n```bash\n# Stdio mode logs to stderr\nnpm start 2>debug.log\n```\n\n### Performance Tips\n\n- **Pagination:** Always use pagination for large result sets\n- **Search:** Use `grep` with specific paths (`path` parameter) for faster results\n- **Batch operations:** Use `Promise.allSettled` for concurrent operations\n\n## Example Prompts\n\nHere are example prompts for each tool category:\n\n### Project Operations\n\n```\n\"List all projects I'm a member of\"\n\"Get details of the PROJ1 project\"\n```\n\n### Repository Operations\n\n```\n\"List repositories in the PROJ1 project\"\n\"Find repositories with 'api' in the name\"\n\"Fork the myrepo repository from PROJ1 to PROJ2\"\n```\n\n### Branch Operations\n\n```\n\"List all branches in myrepo\"\n\"Get the default branch for myrepo\"\n\"Create a new branch feature/login from main\"\n\"Delete the old-feature branch\"\n```\n\n### Pull Request Operations\n\n```\n\"Get all open pull requests in myrepo\"\n\"Create a PR from feature branch to main\"\n\"Check if PR #42 can be merged\"\n\"Approve the pull request\"\n\"Add a comment to PR #42: 'LGTM!'\"\n```\n\n### Code Search\n\n```\n\"Find all occurrences of 'TODO' in the codebase\"\n\"Search for files containing 'auth' in the src directory\"\n\"Get the diff between main and feature branch\"\n```\n\n## Project Structure\n\n```\nsrc/\n├── index.ts              # Server entry point (stdio + Streamable HTTP)\n├── version.ts            # Version from package.json (single source of truth)\n├── config.ts             # Validated config (zod) + axios client w/ retry\n├── pagination.ts         # Shared paging helpers + envelope type\n├── tools/\n│   └── index.ts          # All tool definitions (39 tools)\n├── handlers/\n│   ├── index.ts          # Handler registry + required-arg validation\n│   ├── project.ts        # Project operations\n│   ├── repository.ts     # Repository operations (+ fork, webhooks)\n│   ├── branch.ts         # Branch operations (+ default branch)\n│   ├── commit.ts         # Commit operations\n│   ├── tag.ts            # Tag operations\n│   ├── pullRequest.ts    # Pull request operations (+ reopen, merge status, ...)\n│   ├── comment.ts        # Comment operations\n│   ├── sourceCode.ts     # Source code operations (+ history, compare)\n│   ├── user.ts           # User operations\n│   └── search.ts         # Search operations\n└── __tests__/\n    ├── handlers/         # Vitest suites (per-handler units)\n    ├── http.test.ts      # Integration: Streamable HTTP transport (413, health, JSON-RPC)\n    └── *.test.ts         # Config, registry, version\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}