bitbucket-server-mcp 1.4.0__tar.gz
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.
- bitbucket_server_mcp-1.4.0/.dockerignore +12 -0
- bitbucket_server_mcp-1.4.0/.github/ISSUE_TEMPLATE/bug_report.yml +67 -0
- bitbucket_server_mcp-1.4.0/.github/ISSUE_TEMPLATE/feature_request.yml +33 -0
- bitbucket_server_mcp-1.4.0/.github/PULL_REQUEST_TEMPLATE.md +21 -0
- bitbucket_server_mcp-1.4.0/.github/workflows/ci.yml +89 -0
- bitbucket_server_mcp-1.4.0/.github/workflows/release.yml +101 -0
- bitbucket_server_mcp-1.4.0/.gitignore +12 -0
- bitbucket_server_mcp-1.4.0/AGENTS.md +130 -0
- bitbucket_server_mcp-1.4.0/CHANGELOG.md +63 -0
- bitbucket_server_mcp-1.4.0/CODE_OF_CONDUCT.md +83 -0
- bitbucket_server_mcp-1.4.0/CONTRIBUTING.md +478 -0
- bitbucket_server_mcp-1.4.0/Dockerfile +17 -0
- bitbucket_server_mcp-1.4.0/LICENSE +21 -0
- bitbucket_server_mcp-1.4.0/PKG-INFO +335 -0
- bitbucket_server_mcp-1.4.0/README.md +306 -0
- bitbucket_server_mcp-1.4.0/SECURITY.md +170 -0
- bitbucket_server_mcp-1.4.0/pyproject.toml +78 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/__init__.py +1 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/client.py +161 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/server.py +127 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/__init__.py +0 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/attachments.py +111 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/branches.py +141 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/commits.py +153 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/dashboard.py +99 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/files.py +141 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/projects.py +50 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/pull_requests.py +1018 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/repositories.py +90 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/search.py +105 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/tools/users.py +46 -0
- bitbucket_server_mcp-1.4.0/src/bitbucket_mcp/validation.py +202 -0
- bitbucket_server_mcp-1.4.0/tests/__init__.py +0 -0
- bitbucket_server_mcp-1.4.0/tests/conftest.py +132 -0
- bitbucket_server_mcp-1.4.0/tests/test_attachments.py +101 -0
- bitbucket_server_mcp-1.4.0/tests/test_branches.py +104 -0
- bitbucket_server_mcp-1.4.0/tests/test_client.py +216 -0
- bitbucket_server_mcp-1.4.0/tests/test_commits.py +107 -0
- bitbucket_server_mcp-1.4.0/tests/test_dashboard.py +189 -0
- bitbucket_server_mcp-1.4.0/tests/test_files.py +144 -0
- bitbucket_server_mcp-1.4.0/tests/test_logging.py +128 -0
- bitbucket_server_mcp-1.4.0/tests/test_projects.py +89 -0
- bitbucket_server_mcp-1.4.0/tests/test_pull_requests.py +829 -0
- bitbucket_server_mcp-1.4.0/tests/test_repositories.py +80 -0
- bitbucket_server_mcp-1.4.0/tests/test_search.py +133 -0
- bitbucket_server_mcp-1.4.0/tests/test_users.py +62 -0
- bitbucket_server_mcp-1.4.0/tests/test_validation.py +145 -0
- bitbucket_server_mcp-1.4.0/uv.lock +1008 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report a bug in Bitbucket Server MCP
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: description
|
|
7
|
+
attributes:
|
|
8
|
+
label: Describe the bug
|
|
9
|
+
description: A clear and concise description of what the bug is.
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: reproduce
|
|
14
|
+
attributes:
|
|
15
|
+
label: Steps to reproduce
|
|
16
|
+
description: Steps to reproduce the behaviour.
|
|
17
|
+
placeholder: |
|
|
18
|
+
1. Configure MCP with '...'
|
|
19
|
+
2. Call tool '...' with arguments '...'
|
|
20
|
+
3. See error
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
- type: textarea
|
|
24
|
+
id: expected
|
|
25
|
+
attributes:
|
|
26
|
+
label: Expected behaviour
|
|
27
|
+
description: What you expected to happen.
|
|
28
|
+
validations:
|
|
29
|
+
required: true
|
|
30
|
+
- type: textarea
|
|
31
|
+
id: actual
|
|
32
|
+
attributes:
|
|
33
|
+
label: Actual behaviour
|
|
34
|
+
description: What actually happened. Include error messages if applicable.
|
|
35
|
+
validations:
|
|
36
|
+
required: true
|
|
37
|
+
- type: input
|
|
38
|
+
id: version
|
|
39
|
+
attributes:
|
|
40
|
+
label: Version
|
|
41
|
+
description: "Output of: pip show bitbucket-server-mcp | grep Version"
|
|
42
|
+
placeholder: "1.3.1"
|
|
43
|
+
validations:
|
|
44
|
+
required: true
|
|
45
|
+
- type: input
|
|
46
|
+
id: python
|
|
47
|
+
attributes:
|
|
48
|
+
label: Python version
|
|
49
|
+
description: "Output of: python --version"
|
|
50
|
+
placeholder: "3.12.0"
|
|
51
|
+
validations:
|
|
52
|
+
required: true
|
|
53
|
+
- type: input
|
|
54
|
+
id: mcp-host
|
|
55
|
+
attributes:
|
|
56
|
+
label: MCP host
|
|
57
|
+
description: Which MCP client are you using?
|
|
58
|
+
placeholder: "Claude Code, GitHub Copilot, etc."
|
|
59
|
+
validations:
|
|
60
|
+
required: false
|
|
61
|
+
- type: textarea
|
|
62
|
+
id: additional
|
|
63
|
+
attributes:
|
|
64
|
+
label: Additional context
|
|
65
|
+
description: Any other context, logs, or screenshots.
|
|
66
|
+
validations:
|
|
67
|
+
required: false
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest a new tool or enhancement
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: problem
|
|
7
|
+
attributes:
|
|
8
|
+
label: Problem or use case
|
|
9
|
+
description: What problem does this solve? What are you trying to do?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: solution
|
|
14
|
+
attributes:
|
|
15
|
+
label: Proposed solution
|
|
16
|
+
description: Describe the tool or feature you'd like to see.
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: alternatives
|
|
21
|
+
attributes:
|
|
22
|
+
label: Alternatives considered
|
|
23
|
+
description: Any alternative solutions or workarounds you've considered.
|
|
24
|
+
validations:
|
|
25
|
+
required: false
|
|
26
|
+
- type: input
|
|
27
|
+
id: api-endpoint
|
|
28
|
+
attributes:
|
|
29
|
+
label: Bitbucket API endpoint
|
|
30
|
+
description: If this maps to a specific Bitbucket REST API endpoint, link it here.
|
|
31
|
+
placeholder: "https://developer.atlassian.com/server/bitbucket/rest/..."
|
|
32
|
+
validations:
|
|
33
|
+
required: false
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
## What
|
|
2
|
+
|
|
3
|
+
Brief summary of the change.
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
Motivation or issue being addressed.
|
|
8
|
+
|
|
9
|
+
## How
|
|
10
|
+
|
|
11
|
+
High-level approach (especially for non-obvious changes).
|
|
12
|
+
|
|
13
|
+
## Checklist
|
|
14
|
+
|
|
15
|
+
- [ ] Tests pass (`uv run pytest -v`)
|
|
16
|
+
- [ ] Lint passes (`uv run ruff check src/ tests/`)
|
|
17
|
+
- [ ] New tools have tests (happy path, validation, error handling)
|
|
18
|
+
- [ ] All new tool arguments are validated in `validation.py`
|
|
19
|
+
- [ ] README.md tool count and inventory updated (if tools added)
|
|
20
|
+
- [ ] No deletion operations added
|
|
21
|
+
- [ ] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/) format
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
lint:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v4
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv sync --all-groups
|
|
29
|
+
|
|
30
|
+
- name: Lint with ruff
|
|
31
|
+
run: uv run ruff check src/ tests/
|
|
32
|
+
|
|
33
|
+
- name: Format check with ruff
|
|
34
|
+
run: uv run ruff format --check src/ tests/
|
|
35
|
+
|
|
36
|
+
test:
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
strategy:
|
|
39
|
+
fail-fast: false
|
|
40
|
+
matrix:
|
|
41
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
|
|
45
|
+
- name: Install uv
|
|
46
|
+
uses: astral-sh/setup-uv@v4
|
|
47
|
+
|
|
48
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
49
|
+
uses: actions/setup-python@v5
|
|
50
|
+
with:
|
|
51
|
+
python-version: ${{ matrix.python-version }}
|
|
52
|
+
|
|
53
|
+
- name: Install dependencies
|
|
54
|
+
run: uv sync --all-groups
|
|
55
|
+
|
|
56
|
+
- name: Run tests
|
|
57
|
+
run: uv run pytest -v --tb=short
|
|
58
|
+
|
|
59
|
+
build:
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
needs: [lint, test]
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v4
|
|
64
|
+
|
|
65
|
+
- name: Install uv
|
|
66
|
+
uses: astral-sh/setup-uv@v4
|
|
67
|
+
|
|
68
|
+
- name: Set up Python
|
|
69
|
+
uses: actions/setup-python@v5
|
|
70
|
+
with:
|
|
71
|
+
python-version: "3.12"
|
|
72
|
+
|
|
73
|
+
- name: Install build tools
|
|
74
|
+
run: uv pip install --system build
|
|
75
|
+
|
|
76
|
+
- name: Build package
|
|
77
|
+
run: python -m build
|
|
78
|
+
|
|
79
|
+
- name: Verify package
|
|
80
|
+
run: |
|
|
81
|
+
uv pip install --system twine
|
|
82
|
+
twine check dist/*
|
|
83
|
+
|
|
84
|
+
- name: Upload build artifacts
|
|
85
|
+
uses: actions/upload-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: dist
|
|
88
|
+
path: dist/
|
|
89
|
+
retention-days: 7
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["CI"]
|
|
6
|
+
types: [completed]
|
|
7
|
+
branches: [master]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
release:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
# Only run when CI succeeds and not on release commits (avoid infinite loops)
|
|
17
|
+
if: >-
|
|
18
|
+
github.event.workflow_run.conclusion == 'success' &&
|
|
19
|
+
!startsWith(github.event.workflow_run.head_commit.message, 'chore(release):')
|
|
20
|
+
|
|
21
|
+
environment:
|
|
22
|
+
name: pypi
|
|
23
|
+
url: https://pypi.org/p/bitbucket-server-mcp
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
30
|
+
|
|
31
|
+
- name: Set up Python
|
|
32
|
+
uses: actions/setup-python@v5
|
|
33
|
+
with:
|
|
34
|
+
python-version: "3.12"
|
|
35
|
+
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: |
|
|
38
|
+
python -m pip install --upgrade pip
|
|
39
|
+
pip install python-semantic-release build
|
|
40
|
+
|
|
41
|
+
- name: Configure git
|
|
42
|
+
run: |
|
|
43
|
+
git config user.name "github-actions[bot]"
|
|
44
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
45
|
+
|
|
46
|
+
# PSR determines version from conventional commits:
|
|
47
|
+
# feat: -> minor bump (1.x.0)
|
|
48
|
+
# fix:/perf: -> patch bump (1.0.x)
|
|
49
|
+
# BREAKING CHANGE: -> major bump (x.0.0)
|
|
50
|
+
- name: Python Semantic Release — Determine version
|
|
51
|
+
id: semver
|
|
52
|
+
run: |
|
|
53
|
+
OUTPUT=$(semantic-release version --print 2>/dev/null) || true
|
|
54
|
+
echo "new_version=$OUTPUT" >> "$GITHUB_OUTPUT"
|
|
55
|
+
if [ -z "$OUTPUT" ]; then
|
|
56
|
+
echo "released=false" >> "$GITHUB_OUTPUT"
|
|
57
|
+
echo "No new release needed."
|
|
58
|
+
else
|
|
59
|
+
echo "released=true" >> "$GITHUB_OUTPUT"
|
|
60
|
+
echo "New version: $OUTPUT"
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
- name: Python Semantic Release — Apply version & tag
|
|
64
|
+
if: steps.semver.outputs.released == 'true'
|
|
65
|
+
env:
|
|
66
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
67
|
+
run: |
|
|
68
|
+
semantic-release version --no-push
|
|
69
|
+
|
|
70
|
+
- name: Build package
|
|
71
|
+
if: steps.semver.outputs.released == 'true'
|
|
72
|
+
run: python -m build
|
|
73
|
+
|
|
74
|
+
- name: Verify package
|
|
75
|
+
if: steps.semver.outputs.released == 'true'
|
|
76
|
+
run: |
|
|
77
|
+
pip install twine
|
|
78
|
+
twine check dist/*
|
|
79
|
+
|
|
80
|
+
- name: Publish to PyPI
|
|
81
|
+
if: steps.semver.outputs.released == 'true'
|
|
82
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
83
|
+
with:
|
|
84
|
+
# Uses trusted publishing (OIDC) — no API token needed
|
|
85
|
+
# Configure at: https://pypi.org/manage/project/bitbucket-server-mcp/settings/publishing/
|
|
86
|
+
print-hash: true
|
|
87
|
+
|
|
88
|
+
- name: Create GitHub Release
|
|
89
|
+
if: steps.semver.outputs.released == 'true'
|
|
90
|
+
env:
|
|
91
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
92
|
+
run: |
|
|
93
|
+
semantic-release publish --no-upload
|
|
94
|
+
|
|
95
|
+
- name: Summary
|
|
96
|
+
if: steps.semver.outputs.released == 'true'
|
|
97
|
+
run: |
|
|
98
|
+
echo "## Release v${{ steps.semver.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
|
|
99
|
+
echo "- Published to PyPI" >> $GITHUB_STEP_SUMMARY
|
|
100
|
+
echo "- GitHub Release created" >> $GITHUB_STEP_SUMMARY
|
|
101
|
+
echo "- Install: \`pip install bitbucket-server-mcp==${{ steps.semver.outputs.new_version }}\`" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# AGENTS.md — Bitbucket Server MCP
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
MCP server for Atlassian Bitbucket Server / Data Center (Enterprise) REST API. Provides 54 tools for managing projects, repositories, branches, files, commits, pull requests, and code search. No deletion operations by design.
|
|
6
|
+
|
|
7
|
+
## Tech Stack
|
|
8
|
+
|
|
9
|
+
- **Language**: Python 3.10+
|
|
10
|
+
- **Framework**: MCP SDK (`mcp[cli]`) with `FastMCP`
|
|
11
|
+
- **HTTP Client**: `httpx` (async)
|
|
12
|
+
- **Build**: Hatchling
|
|
13
|
+
- **Package Manager**: `uv`
|
|
14
|
+
- **Linting**: `ruff`
|
|
15
|
+
- **Tests**: `pytest` + `pytest-asyncio` + `respx` (HTTP mocking)
|
|
16
|
+
- **CI/CD**: GitHub Actions (CI + semantic release to PyPI)
|
|
17
|
+
- **Versioning**: [Python Semantic Release](https://python-semantic-release.readthedocs.io/) (automated)
|
|
18
|
+
|
|
19
|
+
## Project Structure
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
src/bitbucket_mcp/
|
|
23
|
+
server.py # Entry point — env var config, wires client + tools, starts MCP stdio
|
|
24
|
+
client.py # BitbucketClient — all HTTP goes through here (auth, error handling, pagination)
|
|
25
|
+
validation.py # Input validation — every tool argument is validated/clamped here
|
|
26
|
+
tools/
|
|
27
|
+
projects.py # list_projects, get_project
|
|
28
|
+
repositories.py # list_repositories, get_repository, create_repository
|
|
29
|
+
branches.py # list_branches, get_default_branch, create_branch, list_tags
|
|
30
|
+
files.py # browse_files, get_file_content, list_files
|
|
31
|
+
commits.py # list_commits, get_commit, get_commit_diff, get_commit_changes
|
|
32
|
+
pull_requests.py # All PR tools (CRUD, diff, commits, activities, comments, tasks, approvals, watch)
|
|
33
|
+
dashboard.py # list_dashboard_pull_requests, list_inbox_pull_requests
|
|
34
|
+
search.py # search_code, find_file
|
|
35
|
+
users.py # find_user
|
|
36
|
+
attachments.py # get_attachment, get_attachment_metadata, save_attachment_metadata
|
|
37
|
+
tests/
|
|
38
|
+
conftest.py # Shared fixtures (mcp, client, respx mocks)
|
|
39
|
+
test_*.py # One test file per tool module + client + validation
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Architecture Patterns
|
|
43
|
+
|
|
44
|
+
- **Tool registration**: Each `tools/*.py` module exposes `register_tools(mcp, client)`. Tools are closures over the shared `mcp` and `client` objects — no global state.
|
|
45
|
+
- **HTTP abstraction**: Tool modules never construct `httpx` requests directly. All HTTP goes through `BitbucketClient` methods (`get`, `post`, `put`, `get_raw`, `search`, `get_paged`).
|
|
46
|
+
- **Validation layer**: All untrusted input from MCP tool arguments passes through `validation.py` before reaching the HTTP client. Validators raise `ValidationError`; clamp functions silently coerce out-of-range values.
|
|
47
|
+
- **Error handling**: Tools catch `BitbucketAPIError` and `ValidationError`, returning error strings to the MCP caller. 5xx errors are sanitised to avoid leaking server internals.
|
|
48
|
+
|
|
49
|
+
## Commands
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
uv sync # Install dependencies
|
|
53
|
+
uv run bitbucket-server-mcp # Run the server (requires BITBUCKET_URL + BITBUCKET_TOKEN)
|
|
54
|
+
uv run pytest -v # Run all tests
|
|
55
|
+
uv run pytest tests/test_projects.py -v # Run a single test file
|
|
56
|
+
uv run ruff check src/ tests/ # Lint
|
|
57
|
+
uv run ruff format src/ tests/ # Format
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Rules
|
|
61
|
+
|
|
62
|
+
### Versioning and Changelog (AUTOMATED)
|
|
63
|
+
|
|
64
|
+
Versioning is handled automatically by [Python Semantic Release (PSR)](https://python-semantic-release.readthedocs.io/). **Do NOT manually bump versions or edit CHANGELOG.md.**
|
|
65
|
+
|
|
66
|
+
PSR analyses conventional commit messages on `master` and automatically:
|
|
67
|
+
- Bumps version in `pyproject.toml` and `src/bitbucket_mcp/__init__.py`
|
|
68
|
+
- Updates `CHANGELOG.md`
|
|
69
|
+
- Creates a git tag and GitHub Release
|
|
70
|
+
- Publishes to PyPI
|
|
71
|
+
|
|
72
|
+
Version bumps are determined by commit type:
|
|
73
|
+
- `feat:` → **minor** (e.g., 1.3.0 → 1.4.0)
|
|
74
|
+
- `fix:` / `perf:` → **patch** (e.g., 1.3.0 → 1.3.1)
|
|
75
|
+
- `BREAKING CHANGE:` or `!` → **major** (e.g., 1.3.0 → 2.0.0)
|
|
76
|
+
- `docs:`, `chore:`, `refactor:`, `test:`, `ci:` → no release
|
|
77
|
+
|
|
78
|
+
### Commit Messages
|
|
79
|
+
|
|
80
|
+
Use [Conventional Commits](https://www.conventionalcommits.org/) format:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
<type>[optional scope]: <description>
|
|
84
|
+
|
|
85
|
+
[optional body]
|
|
86
|
+
|
|
87
|
+
[optional footer(s)]
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Types: `feat`, `fix`, `docs`, `chore`, `refactor`, `test`, `ci`, `perf`, `style`, `build`
|
|
91
|
+
|
|
92
|
+
Examples:
|
|
93
|
+
- `feat: add delete_branch tool`
|
|
94
|
+
- `fix(client): handle 429 rate limit responses`
|
|
95
|
+
- `feat!: require Python 3.14+ (BREAKING CHANGE)`
|
|
96
|
+
|
|
97
|
+
### Adding a New Tool
|
|
98
|
+
|
|
99
|
+
1. Create or edit the appropriate `src/bitbucket_mcp/tools/<domain>.py`
|
|
100
|
+
2. Add input validation to `validation.py` if new parameter types are introduced
|
|
101
|
+
3. Register the tool via `register_tools()` using the `@mcp.tool()` decorator
|
|
102
|
+
4. If adding a new tool module, wire it up in `server.py`
|
|
103
|
+
5. Add tests in `tests/test_<domain>.py` using `respx` to mock HTTP
|
|
104
|
+
6. Update the tool count and table in `README.md`
|
|
105
|
+
|
|
106
|
+
### Adding a New Bitbucket API Endpoint
|
|
107
|
+
|
|
108
|
+
1. Add the HTTP method to `BitbucketClient` in `client.py` if a new verb/path pattern is needed
|
|
109
|
+
2. Follow the existing pattern: tool modules call `client.get()` / `client.post()` etc., never `httpx` directly
|
|
110
|
+
|
|
111
|
+
### Code Style
|
|
112
|
+
|
|
113
|
+
- All modules use `from __future__ import annotations`
|
|
114
|
+
- Tool functions return `str` (JSON-serialised or error message)
|
|
115
|
+
- Validation happens at the tool level before calling the client
|
|
116
|
+
- Keep tools self-contained — each tool function should be readable on its own
|
|
117
|
+
|
|
118
|
+
### Testing
|
|
119
|
+
|
|
120
|
+
- Every tool module has a corresponding `tests/test_<module>.py`
|
|
121
|
+
- Use `respx` to mock HTTP responses — never hit a real Bitbucket Server in tests
|
|
122
|
+
- Shared fixtures live in `tests/conftest.py`
|
|
123
|
+
- Run `uv run pytest -v` before pushing; all tests must pass
|
|
124
|
+
|
|
125
|
+
### Security
|
|
126
|
+
|
|
127
|
+
- No deletion operations — this is a deliberate design constraint
|
|
128
|
+
- Path traversal protection in `validate_path()`
|
|
129
|
+
- 5xx responses are sanitised before returning to MCP callers
|
|
130
|
+
- Never log or expose the `BITBUCKET_TOKEN`
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.3.1] - 2026-03-20
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- MIT license file
|
|
13
|
+
- `license` field in `pyproject.toml`
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Corrected `test_http_allowed` to `test_http_rejected` to match HTTPS-only enforcement
|
|
18
|
+
|
|
19
|
+
## [1.3.0] - 2026-03-20
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Enforce HTTPS-only in `validate_base_url()` — `http://` URLs are now rejected at startup
|
|
24
|
+
- Updated `SECURITY.md` to reflect HTTPS enforcement and resolved HTTP risk
|
|
25
|
+
|
|
26
|
+
## [1.2.0] - 2026-03-20
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- Docker support for running the MCP server in a container
|
|
31
|
+
- `Dockerfile` and `.dockerignore` for building the server image
|
|
32
|
+
- Docker build/run instructions in README
|
|
33
|
+
- Docker-based integration examples for Claude Code and GitHub Copilot
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- Removed manual running section from README in favor of Docker-based instructions
|
|
38
|
+
|
|
39
|
+
## [1.1.1] - 2025-06-04
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- `SECURITY.md` — comprehensive security analysis covering threat model, input validation, injection prevention, and residual risks
|
|
44
|
+
- `CONTRIBUTING.md` — contributor guide with PR guidelines, code style, testing patterns, and security rules
|
|
45
|
+
|
|
46
|
+
## [1.0.0] - 2025-06-03
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
|
|
50
|
+
- MCP server for Atlassian Bitbucket Server / Data Center (Enterprise) REST API
|
|
51
|
+
- 28 tools covering projects, repositories, branches, files, commits, pull requests, and code search
|
|
52
|
+
- HTTP access token authentication via `BITBUCKET_URL` and `BITBUCKET_TOKEN` environment variables
|
|
53
|
+
- Pagination support (`start`/`limit`) on all list operations
|
|
54
|
+
- Input validation for required parameters
|
|
55
|
+
- **Projects**: `list_projects`, `get_project`
|
|
56
|
+
- **Repositories**: `list_repositories`, `get_repository`, `create_repository`
|
|
57
|
+
- **Branches & Tags**: `list_branches`, `get_default_branch`, `create_branch`, `list_tags`
|
|
58
|
+
- **Files & Content**: `browse_files`, `get_file_content`, `list_files`
|
|
59
|
+
- **Commits**: `list_commits`, `get_commit`, `get_commit_diff`, `get_commit_changes`
|
|
60
|
+
- **Pull Requests**: `list_pull_requests`, `get_pull_request`, `create_pull_request`, `update_pull_request`, `merge_pull_request`, `decline_pull_request`, `get_pull_request_diff`, `list_pull_request_commits`, `get_pull_request_activities`, `list_pull_request_comments`, `add_pull_request_comment`
|
|
61
|
+
- **Search**: `search_code` (requires Elasticsearch on the Bitbucket Server instance)
|
|
62
|
+
- No deletion operations by design
|
|
63
|
+
- Claude Code integration support via MCP settings
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
+
|
|
9
|
+
## Our Standards
|
|
10
|
+
|
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
+
|
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior include:
|
|
20
|
+
|
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
22
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
23
|
+
* Public or private harassment
|
|
24
|
+
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
|
25
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
26
|
+
|
|
27
|
+
## Enforcement Responsibilities
|
|
28
|
+
|
|
29
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
32
|
+
|
|
33
|
+
## Scope
|
|
34
|
+
|
|
35
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
36
|
+
|
|
37
|
+
## Enforcement
|
|
38
|
+
|
|
39
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at **manpreetshuann@gmail.com**. All complaints will be reviewed and investigated promptly and fairly.
|
|
40
|
+
|
|
41
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
42
|
+
|
|
43
|
+
## Enforcement Guidelines
|
|
44
|
+
|
|
45
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
46
|
+
|
|
47
|
+
### 1. Correction
|
|
48
|
+
|
|
49
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
50
|
+
|
|
51
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
52
|
+
|
|
53
|
+
### 2. Warning
|
|
54
|
+
|
|
55
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
56
|
+
|
|
57
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
58
|
+
|
|
59
|
+
### 3. Temporary Ban
|
|
60
|
+
|
|
61
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
62
|
+
|
|
63
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
64
|
+
|
|
65
|
+
### 4. Permanent Ban
|
|
66
|
+
|
|
67
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
68
|
+
|
|
69
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
70
|
+
|
|
71
|
+
## Attribution
|
|
72
|
+
|
|
73
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
74
|
+
|
|
75
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
76
|
+
|
|
77
|
+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
|
78
|
+
|
|
79
|
+
[homepage]: https://www.contributor-covenant.org
|
|
80
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
81
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
82
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
83
|
+
[translations]: https://www.contributor-covenant.org/translations
|