Skip to main content
Glama

Jira MCP Server

A Model Context Protocol (MCP) server that provides tools for interacting with Jira Cloud REST API and Bitbucket repositories.

✨ Recently Updated: Simplified tool architecture by prioritizing get_pull_requests_for_issue as the primary tool for PR queries and removing redundant Bitbucket API-based tools to improve reliability and reduce authentication issues.

Features

  • Search Jira issues using JQL (Jira Query Language)

  • Get detailed information about specific issues

  • πŸš€ Enhanced Unified Issue Updates with comprehensive field type support

  • Add comments to issues (with automatic markdown-to-HTML conversion)

  • Add comments to Bitbucket pull requests (with markdown support)

  • ⭐ Get pull requests for Jira issues (Primary tool: get_pull_requests_for_issue)

  • List Bitbucket repositories with caching

  • Comprehensive Jira ticket summarization

  • Cache management for performance optimization

Related MCP server: Jira MCP Server

Prerequisites

  • Node.js 18+

  • A Jira Cloud instance

  • Jira API token

Setup

πŸš€ One-Click Installation

For macOS/Linux:

git clone https://github.com/NivethithaJM/jira-bitbucket-mcp.git
cd jira-bitbucket-mcp
chmod +x install.sh
./install.sh

For Windows:

git clone https://github.com/NivethithaJM/jira-bitbucket-mcp.git
cd jira-bitbucket-mcp
install.bat

Note: The installation scripts will generate the MCP configuration and display it in the console. You'll need to copy and paste this configuration into your mcp.json file at your desired location.

πŸ”„ Updating the MCP Server

To update the MCP server to the latest version:

./update_and_restart.sh

This script will:

  • Pull the latest changes from git

  • Install any new dependencies

  • Rebuild the project

  • Stop any running MCP servers

  • Ask you to restart your IDE (MCP server will start automatically)

πŸ“‹ Manual Setup

  1. Clone the repository:

    git clone https://github.com/NivethithaJM/jira-bitbucket-mcp.git
    cd jira-bitbucket-mcp
  2. Install dependencies:

    npm install
  3. Generate API Tokens:

    • Go to Atlassian Account Settings

    • For Jira: Click "Create API token"

      • Name: "Jira MCP Server"

      • Expires: 1 year

      • App: Jira

      • Scopes: All scopes except delete actions

      • Generate and copy the token as JIRA_API_TOKEN

    • For Bitbucket: Click "Create API token" again

      • Name: "Bitbucket MCP Server"

      • Expires: 1 year

      • App: Bitbucket

      • Scopes: All scopes except delete actions

      • Generate and copy the token as BITBUCKET_API_TOKEN

  4. Build the project:

    npm run build

πŸ”„ Updating the MCP Server

To update to the latest version and restart the server:

./update_and_restart.sh

This script will automatically:

  • βœ… Pull the latest changes from git

  • βœ… Install any new dependencies

  • βœ… Rebuild the project

  • βœ… Stop any running MCP servers

  • βœ… Display update information

  • βœ… Prompt you to restart your IDE (MCP server will start automatically)

Note: The script will handle uncommitted changes by offering to stash them before updating.

MCP Server Configuration

What is MCP?

The Model Context Protocol (MCP) is a standard for connecting AI assistants to external data sources and tools. This Jira MCP server allows AI assistants to interact with your Jira instance through a standardized interface.

Configuration Files

1. Environment Variables

Environment variables are configured directly in the MCP configuration within Cursor IDE. No separate .env file is needed.

Required Environment Variables:

  • JIRA_BASE_URL - Your Jira Cloud instance URL

  • JIRA_EMAIL - Your Jira Cloud email address

  • JIRA_API_TOKEN - Your Jira Cloud API token

  • BITBUCKET_WORKSPACE - Your Bitbucket workspace name

  • BITBUCKET_API_TOKEN - Your Bitbucket API token

2. MCP Configuration File

Run the installation script to generate the configuration, or manually create an mcp.json file in your project root or user directory:

{
  "mcpServers": {
    "jira-bitbucket-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/your/mcp/dist/index.js"],
      "env": {
        "JIRA_BASE_URL": "https://your-domain.atlassian.net",
        "JIRA_EMAIL": "your-email@example.com",
        "JIRA_API_TOKEN": "your-jira-api-token",
        "BITBUCKET_WORKSPACE": "your-workspace-name",
        "BITBUCKET_API_TOKEN": "your-bitbucket-api-token"
      }
    }
  }
}

File Locations:

  • Project-specific: Place mcp.json in your project root directory

  • Global: Place mcp.json in your home directory (~/.mcp.json on Unix systems)

Configuration Steps

  1. Build the MCP Server:

    npm run build
  2. Get the Absolute Path:

    # On macOS/Linux
    pwd
    # Copy the full path to your project directory
  3. Create MCP Configuration:

    • Create mcp.json file in your project root or home directory

    • Replace /absolute/path/to/your/mcp with your actual project path

    • Add your Jira credentials in the env section

  4. Restart Cursor IDE:

    • Close Cursor IDE completely

    • Reopen Cursor IDE

    • The Jira MCP server will be available in your AI assistant

  5. Test the Connection:

    • Open a chat with your AI assistant in Cursor

    • Try asking: "Search for Jira issues in project PROJ"

    • The assistant should be able to use the Jira and Bitbucket tools

Security Considerations

  • API Token Security: Never commit your Jira API token to version control

  • Environment Variables: Environment variables are securely stored in the mcp.json configuration file

  • Configuration Security: Keep your mcp.json file secure and don't commit it to version control

  • Network Security: Use HTTPS for Jira API communication (already configured)

Available Tools

⭐ Tool Prioritization

For Pull Request Queries:

  • Primary Tool: get_pull_requests_for_issue - Use this for all PR-related queries

  • Why: Uses Jira's integrated dev-status API, more reliable, better error handling

For Issue Updates:

  • Primary Tool: enhanced_jira_update - Use this for all issue updates

  • Why: Comprehensive field type support, intelligent formatting, smart field detection

For Issue Management:

  • Primary Tool: get_issue - Get basic issue details

  • Advanced: summarize_jira_ticket - Get comprehensive analysis with comments, custom fields, etc.

πŸ“‹ Complete Tool List

Core Jira Tools:

  1. search_issues - Search issues using JQL

  2. get_issue - Get detailed issue information

  3. summarize_jira_ticket - Comprehensive ticket analysis

  4. add_comment - Add comments to issues (with markdown support)

Enhanced Update Function: 5. enhanced_jira_update - ⭐ PRIMARY: Comprehensive update function with field type support

Pull Request Tools: 6. get_bitbucket_repositories - List Bitbucket repositories (with caching) 7. get_pull_requests_for_issue - ⭐ PRIMARY: Get PRs for Jira issues 8. get_pr_diff - Get PR diff information from Bitbucket URL 9. add_bitbucket_comment - Add comments to Bitbucket pull requests

Cache Management: 10. reset_mcp_server_cache - Reset MCP server cache (clear all caches and get statistics)

Custom Field Management: 11. get_custom_field_mappings - Get all custom field mappings with caching 12. get_custom_field_by_name - Find a custom field by name (case-insensitive search) 13. get_custom_field_by_id - Get custom field information by its ID 14. list_custom_fields - List all custom fields with their names and types 15. clear_custom_field_cache - Clear the custom field mapping cache

Connection Testing: 16. test_bitbucket_connection - Test Bitbucket API connection and list repositories

Total Tools: 16

Enhanced Jira Update Function

The enhanced_jira_update function provides comprehensive field type support for updating Jira issues with intelligent formatting and validation.

Key Features:

  • Universal Field Support: Handles all Jira field types automatically

  • Intelligent Formatting: Applies correct API format for each field type

  • Smart Field Detection: Identifies field types from Jira metadata

  • Dropdown Validation: Validates dropdown values against available options

  • Non-Custom Field Handling: Automatically converts non-custom fields to comments

  • Dry Run Support: Test field formatting without making changes

  • Partial Updates: Continue with valid fields even if some fail

Usage Examples:

{
  "issueKey": "NFD-38469",
  "summary": "Updated summary",
  "priority": "High",
  "customFields": {
    "customfield_10405": "N/A"
  },
  "customFieldsByName": {
    "DEV - Has Impact & Change been Unit tested?": "N/A"
  },
  "validateDropdowns": true,
  "addComment": true,
  "dryRun": false
}

Parameters:

  • issueKey (required): The Jira issue key

  • summary, description, priority, assignee, status, labels, components, fixVersions (optional): Direct standard field parameters

  • fields (optional): Legacy standard Jira fields object

  • customFields (optional): Custom fields by field ID

  • customFieldsByName (optional): Custom fields by field name (automatically resolved to IDs)

  • validateDropdowns (optional, default: true): Validate dropdown values

  • addComment (optional, default: true): Add documentation comment

  • dryRun (optional, default: false): Test formatting without making updates

  • allowPartialUpdates (optional, default: false): Continue with valid fields if some fail

πŸ“– For comprehensive implementation details and field type mappings, see COMPREHENSIVE_FIELD_TYPE_SUPPORT.md

πŸ“– For comprehensive field type support details, see COMPREHENSIVE_FIELD_TYPE_SUPPORT.md

Enhanced Custom Field Cache

The custom field cache now includes comprehensive information:

Cache Information Includes:

  • Field Name: Human-readable field name

  • Field ID: Technical field identifier (e.g., customfield_10405)

  • Field Type: Technical field type information

  • Dropdown Detection: Automatically identifies dropdown fields

  • Dropdown Options: For dropdown fields, stores all available options with IDs and values

  • Multi-value Support: Identifies fields that support multiple values

Dropdown Field Support

The server now includes specialized support for dropdown custom fields with:

  • Automatic option discovery - Gets available dropdown options from Jira

  • Value validation - Validates values against available options before updating

  • Error handling - Comprehensive error messages for invalid values

  • Field metadata - Detailed field information including type and properties

Quick Example

// Get dropdown options
const options = await getDropdownFieldOptions("customfield_10405");

// Validate a value
const validation = await validateDropdownValue("customfield_10405", "N/A");

// Update the field
const result = await updateDropdownField("NFD-38469", "customfield_10405", "N/A");

For detailed documentation, see Dropdown Field Support.

Documentation

For detailed information about tool implementations and usage examples, see:

License

MIT

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests if applicable

  5. Submit a pull request

Troubleshooting

Common Issues:

  1. "Command not found" error:

    • Ensure Node.js is installed and in your PATH

    • Verify the path to dist/index.js is correct

  2. "Missing environment variables" error:

    • Check that all required environment variables are set in the mcp.json configuration

    • Verify the mcp.json file exists and is properly formatted

  3. "Authentication failed" error:

    • Verify your Jira API token is correct

    • Ensure your email address matches your Jira account

    • Check that your Jira instance URL is correct

  4. "Permission denied" error:

    • Ensure the dist/index.js file has execute permissions

    • Check file ownership and permissions

Debug Mode:

To run the MCP server in debug mode:

DEBUG=* npm run dev

This will show detailed logs about the MCP server's operation.

Available Tools

15 tools
add_bitbucket_commentA

Add a comment to a Bitbucket pull request. Markdown input will be automatically converted to HTML.

Inputs: prUrl (required), comment (required).

add_commentB

Add a comment to a Jira issue. Markdown input will be automatically converted to HTML.

Inputs: comment (required), issueKey (required).

clear_custom_field_cacheA

Clear the custom field mapping cache to force refresh from Jira API

Inputs: no named parameters.

enhanced_jira_updateC

Enhanced unified function to update Jira issues with comprehensive field validation, smart dropdown handling, and flexible input formats

Inputs: issueKey (required), dryRun, fields, labels, +12 more.

get_bitbucket_repositoriesB

List all repositories in the configured Bitbucket workspace

Inputs: maxResults.

get_custom_field_by_idC

Get custom field information by its ID (e.g., customfield_10199)

Inputs: fieldId (required).

get_custom_field_by_nameB

Find a custom field by name (case-insensitive search)

Inputs: fieldName (required).

get_custom_field_mappingsB

Get all custom field mappings with caching (field ID to name mapping)

Inputs: no named parameters.

get_issueB

Get details of a specific Jira issue by key

Inputs: issueKey (required).

get_pr_diffC

Get pull request diff information from a Bitbucket URL

Inputs: prUrl (required).

get_pull_requests_for_issueC

Search all Bitbucket repositories for pull requests that reference a specific Jira issue key

Inputs: issueKey (required).

list_custom_fieldsA

List all custom fields with their names and types

Inputs: no named parameters.

reset_mcp_server_cacheB

Reset MCP server cache - clear all caches and return statistics

Inputs: clearAll, issueKey, workspace, clearIssueCache, +1 more.

search_issuesC

Search for Jira issues using JQL (Jira Query Language)

Inputs: jql (required), startAt, maxResults.

summarize_jira_ticketB

Get a comprehensive summary of a Jira ticket including all information, comments, custom fields, attachments, and structured analysis

Inputs: issueKey (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 15 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes (get_issue vs search_issues vs add_comment vs get_pr_diff), but the custom-field cluster is fuzzy: get_custom_field_mappings, list_custom_fields, get_custom_field_by_name, and get_custom_field_by_id all return overlapping metadata about the same resource. summarize_jira_ticket vs get_issue also overlap somewhat, though the summary/raw distinction is stated.

    Naming Consistency4/5

    Nearly everything follows a clean verb_noun snake_case pattern (get_issue, add_comment, list_custom_fields, search_issues). The main deviation is enhanced_jira_update, which leads with an adjective and puts the verb last, breaking the predictable pattern; the cache tools also mix 'reset'/'clear' semantics but readably.

    Tool Count4/5

    15 tools is at the upper end of a well-scoped set and each broadly maps to a real operation. However, four custom-field lookup tools plus two separate cache-clearing tools (reset_mcp_server_cache, clear_custom_field_cache) suggest a bit of redundancy that could be consolidated.

    Completeness3/5

    The surface covers read/search/update/comment/summarize for Jira plus read-only Bitbucket PR access, which is a reasonable core. But there is no issue creation, no status transition/workflow tool, no assignment, and no project/board listing, leaving notable lifecycle gaps; Bitbucket is read-only apart from commenting.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers