bb-mcp-server 1.0.0__py3-none-any.whl
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.
- bb_mcp_server-1.0.0.dist-info/METADATA +222 -0
- bb_mcp_server-1.0.0.dist-info/RECORD +22 -0
- bb_mcp_server-1.0.0.dist-info/WHEEL +5 -0
- bb_mcp_server-1.0.0.dist-info/entry_points.txt +5 -0
- bb_mcp_server-1.0.0.dist-info/licenses/LICENSE +21 -0
- bb_mcp_server-1.0.0.dist-info/top_level.txt +3 -0
- modules/__init__.py +7 -0
- modules/meta_tools/__init__.py +11 -0
- modules/meta_tools/meta_tools.py +412 -0
- modules/middleware/__init__.py +9 -0
- modules/middleware/logging_middleware.py +28 -0
- modules/prompts/__init__.py +11 -0
- modules/prompts/prompts.py +28 -0
- modules/resources/__init__.py +17 -0
- modules/resources/resources.py +502 -0
- modules/tools/__init__.py +34 -0
- modules/tools/tools.py +304 -0
- server.py +477 -0
- utils/__init__.py +0 -0
- utils/api_client.py +64 -0
- utils/auth.py +33 -0
- utils/config.py +24 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bb-mcp-server
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Bitbucket MCP (Model Context Protocol) server built with FastMCP that provides programmatic access to Bitbucket API v2.0
|
|
5
|
+
Author-email: Jason Schulz <jason@schulz.studio>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/your-username/bb-mcp-server
|
|
8
|
+
Project-URL: Repository, https://github.com/your-username/bb-mcp-server
|
|
9
|
+
Project-URL: Issues, https://github.com/your-username/bb-mcp-server/issues
|
|
10
|
+
Keywords: mcp,bitbucket,api,fastmcp,model-context-protocol
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: fastmcp>=2.12.1
|
|
27
|
+
Requires-Dist: httpx>=0.25.0
|
|
28
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# Bitbucket MCP Server
|
|
32
|
+
|
|
33
|
+
[](https://badge.fury.io/py/bb-mcp-server)
|
|
34
|
+
[](https://pypi.org/project/bb-mcp-server/)
|
|
35
|
+
[](https://opensource.org/licenses/MIT)
|
|
36
|
+
[](https://github.com/yourusername/bb-mcp-server/actions/workflows/test.yml)
|
|
37
|
+
|
|
38
|
+
A Model Context Protocol (MCP) server that provides programmatic access to Bitbucket API v2.0. Built with FastMCP, this server enables LLMs and other tools to interact with Bitbucket repositories, pull requests, pipelines, and workspaces.
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
- **26 Bitbucket API Tools**: Complete coverage of essential Bitbucket operations
|
|
43
|
+
- **3 Meta-Tools**: High-level workflows for common patterns (pipeline analysis, PR reviews, workspace overview)
|
|
44
|
+
- **7 MCP Resources**: Quick access to repository info, branches, members, and more
|
|
45
|
+
- **Optimized for LLMs**: Token-efficient design with structured outputs
|
|
46
|
+
- **Flexible Configuration**: Works with any Bitbucket workspace and repository via environment variables
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
### From PyPI
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install bb-mcp-server
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### From Source
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git clone https://github.com/yourusername/bb-mcp-server.git
|
|
60
|
+
cd bb-mcp-server
|
|
61
|
+
pip install -e .
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Configuration
|
|
65
|
+
|
|
66
|
+
1. Create a Bitbucket App Password:
|
|
67
|
+
|
|
68
|
+
- Go to https://bitbucket.org/account/settings/app-passwords/
|
|
69
|
+
- Create a new app password with necessary permissions
|
|
70
|
+
- Save the password securely
|
|
71
|
+
|
|
72
|
+
2. Set up environment variables:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
cp .env.example .env
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
3. Edit `.env` with your credentials:
|
|
79
|
+
```env
|
|
80
|
+
BITBUCKET_USERNAME=your_username
|
|
81
|
+
BITBUCKET_APP_PASSWORD=your_app_password
|
|
82
|
+
BITBUCKET_WORKSPACE=your_workspace # Optional, defaults to "busie"
|
|
83
|
+
BITBUCKET_REPO=your_repo # Optional, defaults to "fe-main"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Usage
|
|
87
|
+
|
|
88
|
+
### Running the Server
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Using the installed package
|
|
92
|
+
bb-mcp-server
|
|
93
|
+
|
|
94
|
+
# Or directly with Python
|
|
95
|
+
python server.py
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Integrating with MCP Clients
|
|
99
|
+
|
|
100
|
+
Add to your MCP client configuration:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"servers": {
|
|
105
|
+
"bitbucket": {
|
|
106
|
+
"command": "bb-mcp-server",
|
|
107
|
+
"env": {
|
|
108
|
+
"BITBUCKET_USERNAME": "your_username",
|
|
109
|
+
"BITBUCKET_APP_PASSWORD": "your_app_password"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Available Tools
|
|
117
|
+
|
|
118
|
+
### Pipeline Operations
|
|
119
|
+
|
|
120
|
+
- `list_pipelines` - List and filter pipeline runs
|
|
121
|
+
- `get_pipeline` - Get pipeline details
|
|
122
|
+
- `list_pipeline_steps` - Get pipeline step information
|
|
123
|
+
- `get_pipeline_step_logs` - Retrieve step logs
|
|
124
|
+
- `create_pipeline` - Trigger new pipeline
|
|
125
|
+
|
|
126
|
+
### Pull Request Operations
|
|
127
|
+
|
|
128
|
+
- `list_pull_requests` - List PRs with filtering
|
|
129
|
+
- `create_pull_request` - Create new PR
|
|
130
|
+
- `get_pull_request` - Get PR details
|
|
131
|
+
- `update_pull_request` - Update existing PR
|
|
132
|
+
- `list_pr_comments` - Get PR comments
|
|
133
|
+
- `create_pr_comment` - Add PR comment
|
|
134
|
+
- `get_pr_changes` - View file changes
|
|
135
|
+
- `get_pr_diffstat` - Get diff statistics
|
|
136
|
+
- `list_pr_tasks` - List PR tasks
|
|
137
|
+
|
|
138
|
+
### Meta-Tools (Workflows)
|
|
139
|
+
|
|
140
|
+
- `analyze_pipeline_failure` - Complete pipeline failure analysis with logs and recommendations
|
|
141
|
+
- `review_pull_request` - Comprehensive PR review with changes, comments, and approval status
|
|
142
|
+
- `workspace_overview` - Full workspace summary with repos, projects, and team info
|
|
143
|
+
|
|
144
|
+
### Resources
|
|
145
|
+
|
|
146
|
+
- `bitbucket://{workspace}/{repo}/info` - Repository information
|
|
147
|
+
- `bitbucket://{workspace}/{repo}/recent-pipelines` - Recent pipeline runs
|
|
148
|
+
- `bitbucket://{workspace}/{repo}/open-prs` - Open pull requests
|
|
149
|
+
- `bitbucket://{workspace}/workspace-members` - Team members for reviewers
|
|
150
|
+
- `bitbucket://{workspace}/{repo}/branches` - Available branches
|
|
151
|
+
- `bitbucket://{workspace}/workspace-projects` - Workspace projects
|
|
152
|
+
|
|
153
|
+
## Development
|
|
154
|
+
|
|
155
|
+
### Setting up Development Environment
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Clone the repository
|
|
159
|
+
git clone https://github.com/yourusername/bb-mcp-server.git
|
|
160
|
+
cd bb-mcp-server
|
|
161
|
+
|
|
162
|
+
# Create virtual environment
|
|
163
|
+
python -m venv .venv
|
|
164
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
165
|
+
|
|
166
|
+
# Install in development mode
|
|
167
|
+
pip install -e .
|
|
168
|
+
pip install -r requirements.txt
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Running Tests
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Install test dependencies
|
|
175
|
+
pip install pytest pytest-asyncio pytest-cov
|
|
176
|
+
|
|
177
|
+
# Run tests
|
|
178
|
+
pytest tests/
|
|
179
|
+
|
|
180
|
+
# Run with coverage
|
|
181
|
+
pytest tests/ --cov=. --cov-report=html
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Code Quality
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Linting
|
|
188
|
+
ruff check .
|
|
189
|
+
|
|
190
|
+
# Formatting
|
|
191
|
+
black .
|
|
192
|
+
|
|
193
|
+
# Type checking
|
|
194
|
+
mypy server.py utils/ modules/
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Contributing
|
|
198
|
+
|
|
199
|
+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
|
|
200
|
+
|
|
201
|
+
1. Fork the repository
|
|
202
|
+
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
|
|
203
|
+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
|
|
204
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
205
|
+
5. Open a Pull Request
|
|
206
|
+
|
|
207
|
+
## License
|
|
208
|
+
|
|
209
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
210
|
+
|
|
211
|
+
## Acknowledgments
|
|
212
|
+
|
|
213
|
+
- Built with [FastMCP](https://github.com/jlowin/fastmcp) framework
|
|
214
|
+
- Uses Bitbucket API v2.0
|
|
215
|
+
- Implements Model Context Protocol (MCP) specification
|
|
216
|
+
|
|
217
|
+
## Support
|
|
218
|
+
|
|
219
|
+
For issues, questions, or contributions, please visit:
|
|
220
|
+
|
|
221
|
+
- GitHub Issues: https://github.com/yourusername/bb-mcp-server/issues
|
|
222
|
+
- Documentation: https://github.com/yourusername/bb-mcp-server/wiki
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
server.py,sha256=eSS1ChaZeIfxpjHl9noa_Sk31LDqCYeehj-7Ge0LMiI,14530
|
|
2
|
+
bb_mcp_server-1.0.0.dist-info/licenses/LICENSE,sha256=UtWDM6w7nMyyFqRyOZnsYCr408jfBPWGJGVXAx8pIKM,1065
|
|
3
|
+
modules/__init__.py,sha256=6qWA9jeagdOYalzGwj5DMFKeWMW0SMwBJghjMsdAFM8,183
|
|
4
|
+
modules/meta_tools/__init__.py,sha256=4pjENk32X0Lfh7JCwTcVB5lLoeLR2QONlUvLVlElz80,167
|
|
5
|
+
modules/meta_tools/meta_tools.py,sha256=pcGnYqA3MlKeBe9NB96w6O3O6cBWIAx_39U_vhSLixg,16934
|
|
6
|
+
modules/middleware/__init__.py,sha256=OwrICBox84S0D0-IegdT0qk1ATwHa710ZBgeFTuzsho,116
|
|
7
|
+
modules/middleware/logging_middleware.py,sha256=mskjV0oOIegFFTgdQfb9VUJ3a7qdkZ8MUG1wiu26cZI,1067
|
|
8
|
+
modules/prompts/__init__.py,sha256=7UgWzA9dhZGq4nfGgHb3aJH2SAHtwN-_KaHHndMp5GU,168
|
|
9
|
+
modules/prompts/prompts.py,sha256=GBfooj5D8J6tTkUySgGl2JYuAiY-kQGB4pxzSj351KQ,1376
|
|
10
|
+
modules/resources/__init__.py,sha256=uvXB_zXK_n1-Hi1vK-aoOACYBNV0GnBpaL7DDxiKqEk,349
|
|
11
|
+
modules/resources/resources.py,sha256=GfprMEc0e8OLr8e_l19t51TFH0iYpQIc9ys3d8c3N2o,18552
|
|
12
|
+
modules/tools/__init__.py,sha256=KMuzGSFjJ6dxxSVh3riaLSPXaOft-Vo_-CD-dp3pzgw,736
|
|
13
|
+
modules/tools/tools.py,sha256=uvkoy0aQs_rM6dJmt_NzOwNXQvIrkpu2aqPn0HWRfDU,9268
|
|
14
|
+
utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
utils/api_client.py,sha256=7ZKNxCx92Nrcl2rvtpgxd6IOgByEKgvtZKKAdShjGJM,2146
|
|
16
|
+
utils/auth.py,sha256=mR9uBf__RaCo6roldDFTnqyb1mThSMXzBJjtDEjLRgY,971
|
|
17
|
+
utils/config.py,sha256=CRoIFw5E8h5FXm0P8sen3uCQ_RZSbuTzrf2-3HMVxZ4,781
|
|
18
|
+
bb_mcp_server-1.0.0.dist-info/METADATA,sha256=KvK0yIAEi1c6ghwr4naX5nm9cLgwy9g22M36-Yq_iXM,6759
|
|
19
|
+
bb_mcp_server-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
20
|
+
bb_mcp_server-1.0.0.dist-info/entry_points.txt,sha256=Zm59ZPpBUSts2H3pS3c_FtIUUq2hoyRhRvXT7_jW1OM,84
|
|
21
|
+
bb_mcp_server-1.0.0.dist-info/top_level.txt,sha256=vvJqhNLswsP0-ZCrpW-pWYrrSAm29a8zXelEgSX1A9o,21
|
|
22
|
+
bb_mcp_server-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Your Name
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
modules/__init__.py
ADDED