本插件用于与 Bitbucket 仓库进行交互,支持拉取请求、评论、任务等多种操作,能有效提升仓库管理效率。
npm install bitbucket-mcp
const { BitbucketMCP } = require('bitbucket-mcp');
async function createPullRequest() {
const bitbucket = new BitbucketMCP({
host: 'https://api.bitbucket.org',
username: 'your-username',
password: 'your-password'
});
try {
const response = await bitbucket.prisms.pull_requests.create({
workspace: 'your-workspace',
repo_slug: 'your-repository',
title: 'New Feature',
description: 'Implement new feature',
source_branch: 'feature-branch',
destination_branch: 'main'
});
console.log('Pull request created:', response.data);
} catch (error) {
console.error('Error creating pull request:', error.message);
}
}
createPullRequest();
async function updatePullRequest() {
const bitbucket = new BitucketMCP({
host: 'https://api.bitbucket.org',
username: 'your-username',
// 这里原文档代码未完整,保持原样
拉取请求操作:
评论操作:
任务操作:
其他功能: