Provides 25+ tools for comprehensive Bitbucket Cloud API access, including repository management, pull request operations, branch and commit handling, issue tracking, pipeline management, and code search across workspaces.
@lexmata/bitbucket-mcp
A Model Context Protocol (MCP) server for Bitbucket Cloud - 25+ tools for repositories, pull requests, branches, commits, issues, pipelines, and code search.
Features
Full Bitbucket Cloud API Coverage: Access repositories, pull requests, branches, commits, issues, pipelines, and code search
OAuth 2.0 Authentication: Secure authentication with automatic token refresh
MCP Tools: 25+ tools for interacting with Bitbucket
MCP Resources: Access repositories, pull requests, and files as resources
TypeScript: Fully typed for reliability and developer experience
Installation
Configuration
Option 1: Access Token (Recommended for personal use)
Go to Bitbucket Settings > Personal Settings > App passwords
Create a new app password with the required permissions:
Account: Read
Repositories: Read, Write, Admin
Pull requests: Read, Write
Issues: Read, Write
Pipelines: Read, Write
Set the environment variable:
Option 2: OAuth 2.0 (Recommended for applications)
Go to Bitbucket Settings > Workspace Settings > OAuth consumers
Create a new OAuth consumer with:
Callback URL:
http://localhost:8080/callback(or your callback URL)Permissions: Select required scopes
Set the environment variables:
Usage with Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Or if installed globally:
Available Tools
Repository Management
Tool | Description |
| List repositories in a workspace |
| Get details of a specific repository |
| Create a new repository |
| Delete a repository |
| List all forks of a repository |
Pull Requests
Tool | Description |
| List pull requests with optional filtering |
| Get details of a specific pull request |
| Create a new pull request |
| Update a pull request |
| Merge a pull request |
| Decline a pull request |
| Approve a pull request |
| Request changes on a pull request |
| List comments on a pull request |
| Add a comment to a pull request |
| Get the diff for a pull request |
Branches
Tool | Description |
| List branches in a repository |
| Get details of a specific branch |
| Create a new branch |
| Delete a branch |
Commits
Tool | Description |
| List commits with optional filtering |
| Get details of a specific commit |
| Get the diff for a commit |
Issues
Tool | Description |
| List issues in a repository |
| Get details of a specific issue |
| Create a new issue |
| Update an issue |
| Delete an issue |
Pipelines
Tool | Description |
| List pipeline runs |
| Get details of a pipeline run |
| Trigger a new pipeline run |
| Stop a running pipeline |
Code Search
Tool | Description |
| Search code across repositories |
Files
Tool | Description |
| Get the content of a file |
Resources
The server provides the following resource types:
Resource URI | Description |
| Repository information |
| Pull request details |
| File contents |
Examples
List repositories in a workspace
Create a pull request
Search for code
Trigger a pipeline
Development
Prerequisites
Node.js 18+
pnpm 9+
Setup
Scripts
Script | Description |
| Build the project with SWC |
| Run in development mode |
| Run the built server |
| Run TypeScript type checking |
| Run ESLint |
| Fix ESLint issues |
| Format code with Prettier |
| Check code formatting |
License
MIT License - Copyright (c) 2025 Lexmata LLC
See LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request