The MCP Server for Bitbucket allows you to connect AI assistants like Claude and Cursor AI directly to your Bitbucket repositories, enabling you to interact with your code, pull requests, and repositories using natural language commands. This integration streamlines your development workflow by providing AI-powered insights and automation.
Before installing, you'll need to set up your Bitbucket credentials. There are two authentication methods:
repository
, workspace
repository
, workspace
, pullrequest
ATATT
)To quickly test your setup:
# For Scoped API Token (recommended)
export ATLASSIAN_USER_EMAIL="[email protected]"
export ATLASSIAN_API_TOKEN="your_scoped_api_token"
# OR for Legacy App Password
export ATLASSIAN_BITBUCKET_USERNAME="your_username"
export ATLASSIAN_BITBUCKET_APP_PASSWORD="your_app_password"
# List your workspaces
npx -y @aashari/mcp-server-atlassian-bitbucket ls-workspaces
# List repositories in your workspace
npx -y @aashari/mcp-server-atlassian-bitbucket ls-repos --workspace-slug your-workspace
For regular use, install the package globally:
npm install -g @aashari/mcp-server-atlassian-bitbucket
Edit your Claude configuration file:
For Scoped API Token:
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@aashari/mcp-server-atlassian-bitbucket"],
"env": {
"ATLASSIAN_USER_EMAIL": "[email protected]",
"ATLASSIAN_API_TOKEN": "your_scoped_api_token"
}
}
}
}
For Legacy App Password:
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@aashari/mcp-server-atlassian-bitbucket"],
"env": {
"ATLASSIAN_BITBUCKET_USERNAME": "your_username",
"ATLASSIAN_BITBUCKET_APP_PASSWORD": "your_app_password"
}
}
}
}
Restart Claude Desktop after making changes.
You can also create a system-wide configuration file at ~/.mcp/configs.json
:
For Scoped API Token:
{
"bitbucket": {
"environments": {
"ATLASSIAN_USER_EMAIL": "[email protected]",
"ATLASSIAN_API_TOKEN": "your_scoped_api_token",
"BITBUCKET_DEFAULT_WORKSPACE": "your_main_workspace"
}
}
}
For Legacy App Password:
{
"bitbucket": {
"environments": {
"ATLASSIAN_BITBUCKET_USERNAME": "your_username",
"ATLASSIAN_BITBUCKET_APP_PASSWORD": "your_app_password",
"BITBUCKET_DEFAULT_WORKSPACE": "your_main_workspace"
}
}
}
Ask your AI assistant:
Ask your AI assistant:
Ask your AI assistant:
If you receive "Authentication failed" or "403 Forbidden":
Verify your credentials with a test command:
npx -y @aashari/mcp-server-atlassian-bitbucket ls-workspaces
For Scoped API Tokens:
For App Passwords:
If you get "Workspace not found" or "Repository not found":
List available workspaces:
npx -y @aashari/mcp-server-atlassian-bitbucket ls-workspaces
Use the exact slug from your Bitbucket URL:
https://bitbucket.org/myteam/my-repo
myteam
my-repo
Set a default workspace to avoid specifying it every time:
export BITBUCKET_DEFAULT_WORKSPACE="your-main-workspace-slug"
If you're having issues with Claude Desktop:
~/.claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "bitbucket" '{"command":"npx","args":["-y","@aashari/mcp-server-atlassian-bitbucket"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": [
"-y",
"@aashari/mcp-server-atlassian-bitbucket"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": [
"-y",
"@aashari/mcp-server-atlassian-bitbucket"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect