Interacting with Bitbucket via MCP

The Bitbucket Cloud MCP server lets any supported agent runtime interact securely with Bitbucket. It exposes tools that your agent can use to automate tasks simply by having them referenced in your natural language prompts.

Example prompt:

“Review the comments on the referenced pull request, implement any suggested feedback, then push your changes back to the source branch of the pull request”.


How to use the MCP

The Atlassian MCP server exposes wrapper tools for reading and writing content to Atlassian products. Step Authentication tokens with Bitbucket-specific scopes grant permissions to invoke Bitbucket specific tools using these wrapper tools. These scopes follow Bitbucket’s API token scope rules. The following scopes are supported:

リソース

サポートされているスコープ

リポジトリ

read:repository:bitbucket,write:repository:bitbucket

プル リクエスト

read:pullrequest:bitbucket,write:pullrequest:bitbucket

Pipelines

read:pipeline:bitbucket,write:pipeline:bitbucket

Read and write scopes need to be specified explicitly - so if your agent needs to run pipelines and read their results, explicitly include both read:pipeline:bitbucket and write:pipeline:bitbucket. When added, the resulting token contains the read:bitbucket:agent-interface and write:bitbucket:agent-interface scopes as mentioned in our developer documentation.

For more fine-grained controlled over picking the tools to allow or deny, use the permissions.on-ask property. See the Tool permission section of Agent configuration for more information.


Legacy MCP connection

You don’t need to configure this server yourself. To use it, simply:

  • make sure the step has the required auth scopes, and

  • Describe in your prompt what the agent should do (for example, “commit changes and create a pull request”).

The Bitbucket MCP server exposes tools such as:

Tool name

動作

API Token scope required

createPullRequest

Create a new pull request

write:pullrequest:bitbucket,
read:pullrequest:bitbucket

getPullRequests

Get a list of pull requests

read:pullrequest:bitbucket

getPullRequestDetails

Fetch details about a pull request

read:pullrequest:bitbucket

getPullRequestComments

List comments on a pull request

read:pullrequest:bitbucket

addPullRequestComment

Add a comment to a pull request or to a file that was changed

read:pullrequest:bitbucket

updatePullRequestComment

Edit an existing pull request comment that was created by an agent

read:pullrequest:bitbucket

getPullRequestTasks

List tasks on a pull request

read:pullrequest:bitbucket

createPullRequestTask

Add a task to a pull request

read:pullrequest:bitbucket

updatePullRequestTask

Update a pull request task

read:pullrequest:bitbucket

analyzePullRequestCommitStatusFailures

Analyze failed commit statuses on a pull request

read:pullrequest:bitbucket
read:pipeline:bitbucket

analyzePipelineStepFailure

Analyze why a pipeline step failed

read:pipeline:bitbucket

詳細:

 

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。