Bitbucket MCP
Bitbucket MCP
A Model Context Protocol (MCP) server for Bitbucket Cloud. Enables AI assistants to manage repositories, pull requests, pipelines, and more.
Installation
Option 1: Using npx (Recommended)
No installation required. Run directly:
npx @icy-r/bitbucket-mcpOption 2: Global Installation
npm install -g @icy-r/bitbucket-mcp
bitbucket-mcpOption 3: Local Development
git clone https://github.com/icy-r/bitbucket-mcp.git
cd bitbucket-mcp
pnpm install
pnpm build
node dist/index.jsMCP Client Configuration
Cursor IDE
Add to your Cursor MCP settings (~/.cursor/mcp.json on Windows: %USERPROFILE%\.cursor\mcp.json):
Using npx (Recommended):
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@icy-r/bitbucket-mcp"],
"env": {
"BITBUCKET_AUTH_METHOD": "api_token",
"BITBUCKET_USER_EMAIL": "your.email@example.com",
"BITBUCKET_API_TOKEN": "your_api_token"
}
}
}
}Using local build:
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": ["D:\\path\\to\\bitbucket-mcp\\dist\\index.js"],
"env": {
"BITBUCKET_AUTH_METHOD": "api_token",
"BITBUCKET_USER_EMAIL": "your.email@example.com",
"BITBUCKET_API_TOKEN": "your_api_token"
}
}
}
}Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@icy-r/bitbucket-mcp"],
"env": {
"BITBUCKET_AUTH_METHOD": "api_token",
"BITBUCKET_USER_EMAIL": "your.email@example.com",
"BITBUCKET_API_TOKEN": "your_api_token"
}
}
}
}Other MCP Clients
The server follows the MCP standard and works with any compatible client. Use the configuration pattern above, adjusting paths as needed for your platform.
Authentication
API Token (Recommended)
Go to Bitbucket API Tokens
Create a new token with the required permissions
Set the environment variables:
BITBUCKET_AUTH_METHOD=api_token
BITBUCKET_USER_EMAIL=your.email@example.com
BITBUCKET_API_TOKEN=your_api_tokenApp Password
Go to Bitbucket App Passwords
Create a new app password with required permissions
Use
basicauth method with your username and app password
Environment Variables
Variable | Description | Required |
|
| Yes |
| Your Atlassian email | For api_token |
| API token | For api_token |
| Bitbucket username | For basic auth |
| App password | For basic auth |
| Default workspace (used when tool call omits | No |
|
| No |
Available Tools
Tool | Actions |
| list, get, list_projects, list_members |
| list, get, create, delete, fork, get_file, list_source |
| list, get, create, update, merge, approve, unapprove, decline, list_comments, add_comment, get_diff |
| list_branches, get_branch, create_branch, delete_branch, list_tags, get_tag, create_tag |
| list, get, get_diff, get_diffstat |
| list, get, trigger, trigger_custom, stop, list_steps, get_step, get_logs, get_config, set_enabled, list_variables, get_variable, create_variable, update_variable, delete_variable |
| list, get, create, update, delete, list_comments, add_comment, vote, unvote, watch, unwatch |
| list, get, create, update, delete, list_workspace, get_workspace, create_workspace, update_workspace, delete_workspace |
Output Formats
Control response verbosity with the format parameter:
Format | Description | Token Savings |
| Full JSON output | 0% |
| Compact TOON format | ~50% |
| Essential fields only | ~76% |
Example usage:
{ "action": "list", "workspace": "my-workspace", "format": "compact" }Examples
List repositories in a workspace
{
"action": "list",
"workspace": "my-workspace"
}Create a pull request
{
"action": "create",
"workspace": "my-workspace",
"repo_slug": "my-repo",
"title": "Feature: Add new functionality",
"source_branch": "feature/new-feature",
"destination_branch": "main"
}Trigger a pipeline
{
"action": "trigger",
"workspace": "my-workspace",
"repo_slug": "my-repo",
"branch_name": "main"
}Default workspace
Set BITBUCKET_WORKSPACE in your environment to skip the workspace parameter on every tool call:
{ "action": "list", "repo_slug": "my-repo" }Development
# Clone the repository
git clone https://github.com/icy-r/bitbucket-mcp.git
cd bitbucket-mcp
# Install dependencies
pnpm install
# Build
pnpm build
# Run tests
pnpm test
# Run in development mode (watch)
pnpm dev
# Lint and format
pnpm lint
pnpm formatRequirements
Node.js >= 20.0.0
pnpm (for development)
License
MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/icy-r/bitbucket-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server