Sponsored by Deepsite.site

MCP Server - Jira & Git Integration

Created By
kashuta8 months ago
MCP Server - Jira & Git Integration
Content

MCP Server - Jira & Git Integration

Overview

This project provides an MCP (Model Context Protocol) server that integrates with Jira and Git to automate common development workflows. It watches for file changes in a specified Git repository, checks the current branch for a Jira issue key, and updates the corresponding Jira issue status.

Additionally, it exposes MCP tools for:

  • Retrieving Jira issue details (getJiraIssue).
  • Creating a Git feature branch and a basic Pull Request template from a Jira issue (createGitBranchAndPR).
  • Manually updating a Jira issue status (updateJiraStatus).

Features

  • Automatic Jira Status Updates: Monitors file changes and updates linked Jira issues (e.g., to "In Progress") when code changes are detected on a feature branch.
  • MCP Tool Integration: Provides tools callable by MCP clients (like AI agents or IDE extensions) to interact with Jira and Git.
  • Configurable: Uses environment variables for Jira/Git credentials and behavior.

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd mcp-server 
    
  2. Install dependencies:

    npm install
    
  3. Configure Environment Variables: Create a .env file in the project root by copying .env.example:

    cp .env.example .env
    

    Then edit the .env file with your specific settings:

    # Jira Configuration
    JIRA_BASE_URL=https://<your-domain>.atlassian.net # Your Jira instance URL
    JIRA_EMAIL=<your-jira-email>
    JIRA_API_TOKEN=<your-jira-api-token> # Generate from Jira Account Settings > Security > API token
    JIRA_PROJECT_KEY=<YOUR_PROJ_KEY> # e.g., PROJ
    JIRA_UPDATE_STATUS="In Progress" # Target status for automatic updates
    
    # Git Configuration
    GIT_REPO_PATH=/path/to/your/local/repository # Absolute path to the Git repo to monitor
    GIT_DEFAULT_BRANCH=main # Or your default branch (e.g., develop)
    
    # Optional Debug Configuration
    # DEBUG=1 # Uncomment to enable debug mode
    # LOG_LEVEL=info # Options: debug, info, warn, error
    
    • Replace placeholders with your actual Jira credentials, project key, desired status, Git repository path, and default branch.
    • To generate a Jira API token, go to Atlassian Account Settings > Security > Create and manage API tokens.

Running the Server

  • Development (with auto-restart on changes):
    npm run dev
    
  • Production (build first):
    npm run build
    npm start
    

The server will start and connect using STDIN/STDOUT for MCP communication.

Usage (MCP Client)

An MCP client can connect to this server (via STDIN/STDOUT when run) and call the following tools:

  • getJiraIssue:
    • Input: { "issueId": "PROJ-123" }
    • Output: JSON string containing Jira issue details.
  • createGitBranchAndPR:
    • Input: { "issueId": "PROJ-123" }
    • Output: JSON string { "branchName": "feature/PROJ-123-summary", "prTemplate": "..." }
    • Side effects: Creates the Git branch, writes .github/PULL_REQUEST_TEMPLATE.md, updates Jira status to JIRA_UPDATE_STATUS.
  • updateJiraStatus:
    • Input: { "issueId": "PROJ-123", "status": "Done" }
    • Output: Confirmation message.
    • Side effects: Updates the Jira issue status.

File Watching Behavior

When the server is running (npm start or npm run dev):

  1. It monitors the directory specified by GIT_REPO_PATH for file changes (ignoring .git, node_modules, dist).
  2. On detecting a change (add, change, unlink):
    • It checks the current branch name of the repository.
    • It extracts a Jira issue key (e.g., PROJ-123) from the branch name (expected format: type/KEY-123-description).
    • It checks if there are uncommitted Git changes (git status).
    • If an issue key is found AND there are Git changes, it attempts to update the corresponding Jira issue's status to the value defined in the JIRA_UPDATE_STATUS environment variable.

Environment Variables

  • JIRA_BASE_URL: Base URL of your Jira instance.
  • JIRA_EMAIL: Email associated with your Jira account.
  • JIRA_API_TOKEN: Your Jira API token.
  • JIRA_PROJECT_KEY: The project key for your Jira project.
  • JIRA_UPDATE_STATUS: The target status name in Jira to set when file changes are detected (e.g., "In Progress", "Development").
  • GIT_REPO_PATH: Absolute path to the local Git repository to monitor.
  • GIT_DEFAULT_BRANCH: The default branch of the repository (e.g., main, master, develop).
  • DEBUG: Set to 1 to enable debug mode (optional).
  • LOG_LEVEL: Set logging level - debug, info, warn, error (optional, defaults to info).

Testing

Run unit tests:

npm test
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Serper MCP ServerA Serper MCP Server
ChatWiseThe second fastest AI chatbot™
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Tavily Mcp
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
CursorThe AI Code Editor
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright McpPlaywright MCP server
DeepChatYour AI Partner on Desktop
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.