This MCP server allows you to connect AI assistants like Claude and Cursor AI directly to your Bitbucket repositories. It enables AI tools to access, search, and interact with your code, pull requests, and repositories using natural language commands.
Before using the MCP server, you'll need to generate Bitbucket credentials:
You can quickly test the server with npx:
# Set your credentials (choose one method)
# Method 1: Standard Atlassian credentials (recommended)
export ATLASSIAN_SITE_NAME="your-company" # for your-company.atlassian.net
export ATLASSIAN_USER_EMAIL="[email protected]"
export ATLASSIAN_API_TOKEN="your_api_token"
# OR Method 2: Bitbucket-specific credentials
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
# Get details about a specific repository
npx -y @aashari/mcp-server-atlassian-bitbucket get-repo --workspace-slug your-workspace --repo-slug your-repo
Add this to your Claude configuration file (~/.claude/claude_desktop_config.json
):
Option 1: Standard Atlassian credentials (recommended)
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@aashari/mcp-server-atlassian-bitbucket"],
"env": {
"ATLASSIAN_SITE_NAME": "your-company",
"ATLASSIAN_USER_EMAIL": "[email protected]",
"ATLASSIAN_API_TOKEN": "your_api_token"
}
}
}
}
Option 2: Bitbucket-specific credentials
{
"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, and you'll see "🔗 bitbucket" in the status bar.
Most AI assistants support MCP. Install the server globally:
npm install -g @aashari/mcp-server-atlassian-bitbucket
Then configure your AI assistant to use the MCP server with STDIO transport.
Create ~/.mcp/configs.json
for system-wide configuration:
Option 1: Standard Atlassian credentials (recommended)
{
"bitbucket": {
"environments": {
"ATLASSIAN_SITE_NAME": "your-company",
"ATLASSIAN_USER_EMAIL": "[email protected]",
"ATLASSIAN_API_TOKEN": "your_api_token",
"BITBUCKET_DEFAULT_WORKSPACE": "your_main_workspace"
}
}
}
Option 2: Bitbucket-specific credentials
{
"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:
Ask your AI assistant:
If you get "Authentication failed" or "403 Forbidden":
Choose the right authentication method:
For Bitbucket App Passwords:
For Atlassian API Tokens:
Verify your credentials:
# Test your credentials work
npx -y @aashari/mcp-server-atlassian-bitbucket ls-workspaces
If you get "Workspace not found" or "Repository not found":
Check your workspace slug:
# List your workspaces to see the correct slugs
npx -y @aashari/mcp-server-atlassian-bitbucket ls-workspaces
Use the exact slug from Bitbucket URL:
https://bitbucket.org/myteam/my-repo
myteam
my-repo
If you get "No default workspace configured", set a default workspace:
export BITBUCKET_DEFAULT_WORKSPACE="your-main-workspace-slug"
~/.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