Back to MCP directory
publicPublicdnsLocal runtime

mcp_bitbucket_pipelines

Bitbucket Pipelines MCP服务器是一个实现Model Context Protocol的服务,提供与Bitbucket Pipelines交互的工具,支持列出、触发、查询和停止流水线。

article

README

🚀 基于MCP协议的Bitbucket Pipeline集成服务器

本项目借助Model Context Protocol(MCP)协议,成功实现了与Bitbucket Pipeline的集成服务器。通过MCP协议,语言模型能够以统一的标准接口,与Bitbucket Pipeline进行高效交互,为相关开发工作提供了便利。

🚀 快速开始

📦 安装依赖

  1. 克隆仓库。
  2. 进入项目目录安装依赖:
npm install

▶️ 运行服务器

npm start

💻 使用示例

基础用法

import { Client } from '@modelcontextprotocol/sdk/client';
import { ChildProcessTransport } from '@modelcontextprotocol/sdk/client/child-process';

async function main() {
  const client = new Client({
    transport: new ChildProcessTransport({
      command: 'node',
      args: ['dist/index.js'],
      env: {
        BITBUCKET_ACCESS_TOKEN: 'your_token',
        BITBUCKET_WORKSPACE: 'your_workspace', 
        BITBUCKET_REPO_SLUG: 'your_repository'
      }
    })
  });

  const tools = await client.listTools();
  console.log('Available tools:', tools);

  const pipelines = await client.callTool('mcp_bitbucket_list_pipelines', { page: 1, pagelen: 5 });
  console.log('Pipelines:', pipelines);

  await client.close();
}

main().catch(console.error);

✨ 主要特性

  • MCP 协议支持:实现了 MCP 协议的服务器端,支持通过标准输入输出进行通信。
  • Bitbucket Pipeline 集成:提供了与 Bitbucket Pipeline 系统交互的功能模块。
  • 工具化设计:所有功能均以 MCP 标准工具的形式实现,便于扩展和维护。

📚 详细文档

项目结构

.
├── src/
│   ├── index.ts                # 服务器入口文件
│   └── tools/
│       └── bitbucket-pipelines.ts  # Bitbucket Pipeline 相关功能实现
├── package.json               # 依赖管理及脚本配置
└── tsconfig.json              # TypeScript 编译配置

使用 MCP 协议

初始化连接

echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"name":"Test Client","version":"1.0.0","protocolVersion":"0.3.0","capabilities":{},"clientInfo":{"name":"Test Client","version":"1.0.0"}}}' | docker exec -i bitbucket-pipelines-mcp_mcp-server-1 node dist/index.js

列出可用工具

echo '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | docker exec -i bitbucket-pipelines-mcp_mcp-server-1 node dist/index.js

调用具体工具

echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"mcp_bitbucket_list_pipelines","input":{"page":1,"pagelen":5}}}' | docker exec -i bitbucket-pipelines-mcp_mcp-server-1 node dist/index.js

🤝 贡献指南

  1. ** Fork 项目仓库。
  2. ** 创建功能分支(git checkout -b feature/nova-feature)。
  3. ** 提交修改(git commit -am '添加新功能')。
  4. ** 推送分支到远程仓库(git push origin feature/nova-feature)。
  5. ** 创建 Pull Request。

👨‍💻 项目维护者

  • [your_name]
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client