HM

hainanzhao/mcp-gitlab-jira

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

11 stars 6 forks 质量 62 趋势 18MIT

A Model Context Protocol (MCP) server for GitLab and Jira integration. This server allows AI agents like gemini-cli to interact with your GitLab and Jira instances.

概览

A Model Context Protocol (MCP) server for GitLab and Jira integration. This server allows AI agents like gemini-cli to interact with your GitLab and Jira instances. - : List all accessible projects or filter them by name. - : List merge requests for a project, get detailed information (including diffs), add comments, and assign reviewers. - : Get pipeline status, trigger/retry/cancel pipelines, get job details and logs. - : List, create, delete branches and get branch details. - : Create, list, update, close issues and manage comments. - : Get the content of a specific file at a given SHA. - : List all releases for a project or filter them since a specific version. - : List project members, get a user's ID by username, and get user activities. - : Get detailed information about a ticket, get comments, add comments, search for tickets using JQL, create new tickets, get available transitions, update tickets, and transition tickets to a new status.

README

以下为原文 README 节选,完整内容请查看原文。

MCP GitLab Jira Server

A Model Context Protocol (MCP) server for GitLab and Jira integration. This server allows AI agents like gemini-cli to interact with your GitLab and Jira instances.

Features

GitLab

  • Projects: List all accessible projects or filter them by name.
  • Merge Requests: List merge requests for a project, get detailed information (including diffs), add comments, and assign reviewers.
  • Pipeline/CI/CD: Get pipeline status, trigger/retry/cancel pipelines, get job details and logs.
  • Branch Management: List, create, delete branches and get branch details.
  • Issue Management: Create, list, update, close issues and manage comments.
  • Files: Get the content of a specific file at a given SHA.
  • Releases: List all releases for a project or filter them since a specific version.
  • Users: List project members, get a user’s ID by username, and get user activities.

Jira

  • Tickets: Get detailed information about a ticket, get comments, add comments, search for tickets using JQL, create new tickets, get available transitions, update tickets, and transition tickets to a new status.
  • Project Management: Get all projects, project details, components, and versions.

Setup

Prerequisites

  • Node.js 18+
  • GitLab Personal Access Token with API access
  • Jira API Token
  • Access to a GitLab instance (on-premise or GitLab.com)
  • Access to a Jira instance

Installation

  1. Install the package globally:

    npm i -g mcp-gitlab-jira
    
  2. Set up environment variables:

    # GitLab
    export GITLAB_URL="https://your-gitlab-instance.com"
    export GITLAB_ACCESS_TOKEN="your-personal-access-token"
    
    # Jira
    export ATLASSIAN_SITE_NAME="your-atlassian-site-name"
    export ATLASSIAN_USER_EMAIL="[email protected]"
    export ATLASSIAN_API_TOKEN="your-jira-api-token"
    
  3. Test the server manually:

    # Test that the server starts without errors
    echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | mcp-gitlab-jira
    

    The server should start and log “GitLab/Jira MCP server started” to stderr.

Using with MCP Clients

Configuration for gemini-cli or other MCP clients

Create or update your MCP configuration file (usually ~/.mcp/config.json or similar):

{
  "mcpServers": {
    "gitlab-jira-mcp": {
      "command": "mcp-gitlab-jira",
      "env": {
        "GITLAB_URL": "https://your-gitlab-instance.com",
        "GITLAB_ACCESS_TOKEN": "your-personal-access-token",
        "ATLASSIAN_SITE_NAME": "your-atlassian-site-name",
        "ATLASSIAN_USER_EMAIL": "[email protected]",
        "ATLASSIAN_API_TOKEN": "your-jira-api-token"
      }
    }
  }
}

Running with Docker

You can also run this MCP server in a Docker container using the pre-built image from Docker Hub.

Available Docker Images

The Docker images are automatically built and published to Docker Hub for each release:

在 GitHub 查看完整 README

安装

docker exec -i mcp-gitlab-jira-container npm start
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "gitlab-jira-mcp": { "command": "mcp-gitlab-jira", "env": { "GITLAB_URL": "https://your-gitlab-instance.com", "GITLAB_ACCESS_TOKEN": "your-personal-access-token", "ATLASSIAN_SITE_NAME": "your-atlassian-site-name", "ATLASSIAN_USER_EMAIL": "[email protected]", "ATLASSIAN_API_TOKEN": "your-jira-api-token" } } } }