loading…
Search for a command to run...
loading…
MCP server for Bitbucket Server / Data Center with code review, cross-repo PRs, and CI insights
MCP server for Bitbucket Server / Data Center with code review, cross-repo PRs, and CI insights
npm version
npm downloads
Bitbucket Server
TypeScript
Node
License
CI
CodeQL
codecov
Mutation testing
OpenSSF Scorecard
OpenSSF Best Practices
Install in VS Code Install in Cursor Install in LM Studio
Or via Claude Code:
claude mcp add bitbucket \
-e BITBUCKET_URL=https://your-bitbucket-server.com \
-e BITBUCKET_TOKEN=your-token \
-- npx -y @pavel-kalmykov/bitbucket-server-mcp
Add to your workspace .vscode/mcp.json:
{
"servers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@pavel-kalmykov/bitbucket-server-mcp"],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
"BITBUCKET_TOKEN": "your-access-token"
}
}
}
}
These clients all use the same mcpServers format. Add the JSON below to the config file for your client:
| Client | Config file |
|---|---|
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) |
| Cursor | ~/.cursor/mcp.json (one-click install) |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
| JetBrains | Settings > Tools > AI Assistant > MCP, or ~/.junie/mcp/mcp.json |
| Neovim | mcphub.nvim mcpservers.json |
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@pavel-kalmykov/bitbucket-server-mcp"],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
"BITBUCKET_TOKEN": "your-access-token"
}
}
}
}
Add to your Zed settings (~/.config/zed/settings.json on Linux, ~/Library/Application Support/Zed/settings.json on macOS):
{
"context_servers": {
"bitbucket": {
"source": "custom",
"command": "npx",
"args": ["-y", "@pavel-kalmykov/bitbucket-server-mcp"],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
"BITBUCKET_TOKEN": "your-access-token"
}
}
}
}
For environments without Node.js:
{
"mcpServers": {
"bitbucket": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "BITBUCKET_URL=https://your-bitbucket-server.com",
"-e", "BITBUCKET_TOKEN=your-access-token",
"ghcr.io/pavel-kalmykov/bitbucket-server-mcp"
]
}
}
}
Or build locally: docker build -t bitbucket-mcp .
[!TIP] Bun users can replace
npx -ywithbunxin any of the configs above.
| Tool | Description |
|---|---|
list_projects |
List all accessible Bitbucket projects |
list_repositories |
List repositories in a project |
browse_repository |
Browse files and directories |
get_file_content |
Read file contents with pagination |
upload_attachment |
Upload a local file and get a markdown reference for PR comments |
edit_file |
Edit a file by committing a new version via the REST API |
get_server_info |
Get Bitbucket Server version and properties |
| Tool | Description |
|---|---|
create_pull_request |
Create a PR, including cross-repo from forks (sourceProject/sourceRepository). Auto-fetches default reviewers unless includeDefaultReviewers: false. |
get_pull_request |
Get PR details |
update_pull_request |
Safely update title, description, or reviewers (read-modify-write, preserves fields not explicitly changed) |
merge_pull_request |
Merge a PR with optional strategy (no-ff, ff, ff-only, squash, rebase-no-ff, rebase-ff-only, squash-ff-only) |
decline_pull_request |
Decline a PR |
list_pull_requests |
List PRs with filtering by state, author, direction |
list_dashboard_pull_requests |
List PRs across all repos for the authenticated user, filtered by role (AUTHOR/REVIEWER/PARTICIPANT), state, and review status |
get_pull_request_activity |
Get PR activity timeline, filtered by type (all, reviews, comments) |
get_diff |
Get PR diff with per-file truncation support. Use stat: true for a lightweight summary of changed files instead of the full diff. |
| Tool | Description |
|---|---|
manage_comment |
Unified create/edit/delete for PR comments. Supports inline anchoring (filePath/line/lineType), draft state (state: PENDING), task creation (severity: BLOCKER), threaded replies (parentId), and resolve/unresolve (state: RESOLVED/OPEN). |
manage_review |
Unified approve/unapprove/publish. Publish transitions all PENDING comments to visible and optionally sets participantStatus (APPROVED/NEEDS_WORK). |
| Tool | Description |
|---|---|
list_branches |
List branches with default branch detection |
list_commits |
Browse commit history with branch and author filtering |
manage_branches |
Create or delete branches (safety check prevents deleting default branch) |
get_commit |
Get details of a specific commit by its ID |
compare_refs |
List commits reachable from one ref but not another |
list_tags |
List tags in a repository |
manage_tags |
Create or delete tags |
get_tag |
Get details of a specific tag by its name |
| Tool | Description |
|---|---|
search |
Search code and files across repositories |
get_code_insights |
Fetch Code Insights reports (SonarQube, security scans) and annotations |
get_build_status |
Get CI build status (state, name, URL) by commit ID or PR. When using prId, resolves the latest commit automatically. |
| Prompt | Description |
|---|---|
review-pr |
Step-by-step workflow for reviewing a PR: fetch details, read diff, check CI, create draft comments, and publish the review. Invoke via /bitbucket:review-pr in Claude Code. No arguments needed; the LLM asks for the PR interactively. You can add context, e.g. /bitbucket:review-pr PR #42 in my-repo. |
| Resource | URI | Description |
|---|---|---|
projects |
bitbucket://projects |
Cached list of all accessible projects (5 min TTL). Useful as ambient context without explicit tool calls. |
| Variable | Required | Description |
|---|---|---|
BITBUCKET_URL |
Yes | Base URL of your Bitbucket Server instance |
BITBUCKET_TOKEN |
Yes* | Personal access token |
BITBUCKET_USERNAME |
Yes* | Username for basic auth |
BITBUCKET_PASSWORD |
Yes* | Password for basic auth |
BITBUCKET_DEFAULT_PROJECT |
No | Default project key when not specified in tool calls |
BITBUCKET_READ_ONLY |
No | Set to true to disable all write operations |
BITBUCKET_CUSTOM_HEADERS |
No | Extra headers for all requests (Key=Value,Key2=Value2). Useful for Zero Trust tokens. |
BITBUCKET_DIFF_MAX_LINES_PER_FILE |
No | Max lines per file in diffs. Set to 0 for no limit. |
BITBUCKET_CACHE_TTL |
No | Cache duration in seconds (default: 300). Set to 0 to disable caching. |
BITBUCKET_ENABLED_TOOLS |
No | Comma-separated list of tool names to enable. If not set, all tools are available. |
*Either BITBUCKET_TOKEN or both BITBUCKET_USERNAME and BITBUCKET_PASSWORD are required.
Set BITBUCKET_READ_ONLY=true to restrict the server to read-only operations. Write tools (create_pull_request, update_pull_request, merge_pull_request, decline_pull_request, manage_comment, manage_review, manage_branches, manage_tags, upload_attachment, edit_file) are disabled.
Set BITBUCKET_ENABLED_TOOLS to load only specific tools, reducing context window usage:
BITBUCKET_ENABLED_TOOLS=get_pull_request,get_diff,manage_comment,manage_review
Read tools return compact responses by default, keeping only the fields an AI assistant typically needs. Every read tool accepts a fields parameter to customize:
fields: returns a curated summary (e.g. PR id, title, state, author, branches, reviewers, task count)fields: "*all": returns the complete raw Bitbucket API responsefields: "id,title,author.user.name": returns exactly those fields (dot notation for nested paths)The server caches frequently accessed data in memory (project lists, repository metadata, default reviewers) to reduce API calls. The cache uses LRU eviction (max 500 entries) so memory stays bounded, and write operations automatically invalidate related entries.
By default, cached entries expire after 5 minutes. Configure with BITBUCKET_CACHE_TTL (in seconds), or set to 0 to disable caching entirely.
See CONTRIBUTING.md for development setup, architecture overview, and how to add new tools.
Apache 2.0
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"bitbucket-server-mcp": {
"command": "npx",
"args": [
"-y",
"@pavel-kalmykov/bitbucket-server-mcp"
]
}
}
}PRs, issues, code search, CI status
автор: GitHubDatabase, auth and storage
автор: SupabaseReference / test server with prompts, resources, and tools.
Secure file operations with configurable access controls.
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development