jira-mcp-server

kushb05/jira-mcp-server

3.2

If you are the rightful owner of jira-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Jira Test Case Generator MCP Server is a powerful tool that integrates AI capabilities with Jira for enhanced test case generation and ticket management.

Tools
4
Resources
0
Prompts
0

Jira Test Case Generator MCP Server

A powerful Model Context Protocol (MCP) server that provides AI-powered Jira integration for test case generation, ticket management, and workflow automation. This server enables Claude Desktop and other MCP clients to interact with Jira using natural language, automating common tasks and generating intelligent test cases.

📋 Overview

This MCP server bridges the gap between AI assistants and Jira, allowing you to:

  • Generate comprehensive test cases from existing Jira tickets
  • Create and manage tickets of any type (Epic, Story, Task, Bug, etc.)
  • Create sub-tasks and link them to parent tickets
  • Link related tickets with various relationship types
  • Automate repetitive workflows through natural language commands

Built with Java 23 and Maven, it uses Jira's REST API v3 and follows the MCP protocol specification for seamless integration with AI tools.

✨ Features

Core Capabilities

  • 🎯 AI-Powered Test Case Generation: Automatically generates comprehensive test cases based on ticket type, description, and acceptance criteria
  • 🎫 Full Ticket Management: Create any Jira issue type with custom fields and priorities
  • 📎 Sub-task Creation: Create and link sub-tasks to parent tickets
  • 🔗 Ticket Linking: Link related tickets with relationship types (Relates, Blocks, Duplicates, Clones)
  • 🔍 Smart Analysis: Intelligently analyzes ticket content to generate relevant test scenarios
  • 🔐 Secure Configuration: Environment-based credential management with .env file support
  • 🚀 MCP Compatible: Full compliance with Model Context Protocol for Claude Desktop integration
  • 📝 Rich Formatting: Uses Atlassian Document Format (ADF) for rich text descriptions

Prerequisites

  • Java 23 or higher
  • Maven 3.6 or higher
  • Jira account with API token
  • Jira Cloud or Server instance

Installation

1. Clone or Download the Project

cd jira-testcase-mcp-server

2. Configure Environment Variables

Create a .env file in the project root directory:

cp .env.example .env

Edit the .env file and add your Jira credentials:

JIRA_URL=https://your-domain.atlassian.net
JIRA_EMAIL=your-email@example.com
JIRA_API_TOKEN=your_api_token_here

How to get your Jira API Token:

  1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
  2. Click "Create API token"
  3. Give it a name (e.g., "MCP Server")
  4. Copy the generated token and paste it in your .env file

3. Build the Project

mvn clean package

This will create a fat JAR file in the target directory: jira-testcase-mcp-server-1.0.0.jar

Usage

Running the Server Standalone

java -jar target/jira-testcase-mcp-server-1.0.0.jar

The server will start and listen for MCP requests on stdin/stdout.

Configuring with Claude Desktop

To use this MCP server with Claude Desktop, add it to your MCP configuration:

For Windows, edit %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "jira-testcase-generator": {
      "command": "java",
      "args": [
        "-jar",
        "C:\\path\\to\\your\\jira-testcase-mcp-server-1.0.0.jar"
      ]
    }
  }
}

For macOS/Linux, edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "jira-testcase-generator": {
      "command": "java",
      "args": [
        "-jar",
        "/path/to/your/jira-testcase-mcp-server-1.0.0.jar"
      ]
    }
  }
}

Important: Make sure to:

  1. Use the full absolute path to your JAR file
  2. Place the .env file in the same directory as the JAR file
  3. Restart Claude Desktop after updating the configuration

Using with Claude

Once configured, you can ask Claude to interact with Jira using natural language:

Generate test cases:

Can you generate test cases for Jira ticket PROJ-123?

Create a new ticket:

Create a Story in PROJ with summary "Add user authentication" and description "Implement login functionality"

Create a sub-task:

Create a subtask under PROJ-123 with summary "Write unit tests" and description "Add test coverage"

Link tickets together:

Link PROJ-123 to PROJ-456 with a Relates relationship

Claude will automatically use the appropriate tool to fulfill your request.

Available Tools

This MCP server provides four powerful tools:

1. generate_test_cases

Generates comprehensive test cases for a specific Jira ticket based on its type, description, and acceptance criteria.

Parameters:

  • ticketKey (required): The Jira ticket key (e.g., "PROJ-123", "DEV-456")

Example Usage:

Generate test cases for ticket PROJ-123

Output:

  • Ticket details (summary, description, type, priority, status)
  • AI-generated test cases with:
    • Test case ID
    • Title
    • Priority level
    • Detailed test steps
    • Expected results
    • Test type (Positive, Negative, Regression, etc.)

2. create_ticket

Creates a new Jira ticket of any type (Epic, Story, Task, Bug, Feature, etc.).

Parameters:

  • projectKey (required): The Jira project key (e.g., "PROJ", "DEV")
  • issueType (required): Type of issue (e.g., "Story", "Task", "Bug", "Epic")
  • summary (required): Brief title/summary of the ticket
  • description (required): Detailed description of the ticket
  • priority (optional): Priority level (e.g., "High", "Medium", "Low")

Example Usage:

Create a Bug in PROJ with summary "Login button not working" and description "Users cannot log in on mobile devices" with High priority

Output:

  • Created ticket key (e.g., "PROJ-789")
  • Ticket URL for easy access

3. create_subtask

Creates a sub-task and links it to a parent ticket.

Parameters:

  • parentKey (required): Parent ticket key (e.g., "PROJ-123")
  • summary (required): Brief title/summary of the sub-task
  • description (required): Detailed description of the sub-task

Example Usage:

Create a subtask under PROJ-123 with summary "Update API documentation" and description "Document the new endpoints"

Output:

  • Created sub-task key (e.g., "PROJ-790")
  • Sub-task URL
  • Parent ticket reference

4. link_tickets

Links two Jira tickets with a specified relationship type.

Parameters:

  • inwardIssue (required): First ticket key (e.g., "PROJ-123")
  • outwardIssue (required): Second ticket key (e.g., "PROJ-456")
  • linkType (required): Relationship type - one of:
    • "Relates" - General relationship
    • "Blocks" - First ticket blocks second ticket
    • "Duplicate" - Tickets are duplicates
    • "Cloners" - Cloning relationship

Example Usage:

Link PROJ-123 to PROJ-456 with a Blocks relationship

Output:

  • Success confirmation
  • Link type and direction
  • Both ticket references

Test Case Types

The generator creates different types of test cases based on the Jira issue type:

For Bugs

  • Reproduce bug test case
  • Verify fix test case
  • Regression test case

For User Stories

  • Positive test case (happy path)
  • Negative test case (error handling)
  • UI/UX test case (if applicable)
  • Integration test case

For Tasks

  • Functional verification
  • Performance test (if applicable)

For Epics

  • End-to-end test
  • System integration test

Generic Test Cases

  • Functional test
  • Validation test

Project Structure

testcasegenerator/
├── pom.xml                           # Maven configuration
├── .env.example                      # Environment variables template
├── .env                              # Your actual environment variables (not in git)
├── README.md                         # This file
└── src/
    └── main/
        └── java/
            └── com/
                └── mcp/
                    ├── Main.java                          # Application entry point
                    ├── server/
                    │   └── JiraTestCaseMCPServer.java    # MCP server implementation
                    └── service/
                        ├── JiraService.java               # Jira API integration
                        └── TestCaseGenerator.java         # Test case generation logic

Code Overview

Main.java

  • Entry point of the application
  • Loads configuration from .env file
  • Initializes and starts the MCP server
  • Validates required environment variables

JiraTestCaseMCPServer.java

  • Implements the MCP protocol
  • Handles MCP requests (initialize, tools/list, tools/call)
  • Coordinates between Jira service and test case generator
  • Formats responses in MCP format

JiraService.java

  • Connects to Jira REST API
  • Authenticates using Basic Auth (email + API token)
  • Fetches ticket details
  • Parses Jira's JSON response (including ADF format)

TestCaseGenerator.java

  • Analyzes Jira ticket content
  • Generates test cases based on issue type
  • Creates different test scenarios (positive, negative, regression, etc.)
  • Formats test cases with detailed steps and expected results

Troubleshooting

"JIRA_URL is required" Error

  • Make sure you have a .env file in the same directory as your JAR file
  • Verify that the .env file contains all required variables

"Failed to fetch Jira ticket: 401" Error

  • Check that your JIRA_EMAIL is correct
  • Verify that your JIRA_API_TOKEN is valid and hasn't expired
  • Ensure you have permission to access the ticket

"Failed to fetch Jira ticket: 404" Error

  • Verify the ticket key is correct (e.g., "PROJ-123")
  • Make sure the ticket exists and you have permission to view it

Server Not Responding in Claude

  • Restart Claude Desktop after configuration changes
  • Check the Claude logs for any error messages
  • Verify the JAR file path in the configuration is correct and absolute

Development

Building from Source

# Clean and build
mvn clean package

# Run tests (if any)
mvn test

# Run without packaging
mvn compile exec:java

Adding Custom Test Case Logic

To customize test case generation, edit the TestCaseGenerator.java file and modify the generation methods:

  • generateBugTestCases()
  • generateStoryTestCases()
  • generateTaskTestCases()
  • generateEpicTestCases()

Security Notes

  • Never commit your .env file to version control
  • Keep your Jira API token secure
  • Rotate your API tokens periodically
  • Use read-only API tokens if possible

License

This project is provided as-is for educational and commercial use.

Support

For issues or questions:

  1. Check the troubleshooting section above
  2. Verify your Jira credentials and permissions
  3. Check the server logs for detailed error messages

Changelog

Version 1.0.0 (November 2025)

  • ✅ Initial release with MCP protocol compliance
  • ✅ AI-powered test case generation for multiple issue types
  • ✅ Full ticket management (create any issue type)
  • ✅ Sub-task creation and linking
  • ✅ Ticket linking with relationship types (Relates, Blocks, Duplicate, Cloners)
  • ✅ Jira REST API v3 integration with Basic Authentication
  • ✅ Environment-based secure configuration
  • ✅ Support for Atlassian Document Format (ADF) for rich descriptions
  • ✅ UTF-8 encoding support for international characters
  • ✅ Comprehensive error handling and logging

Use Cases

This server is perfect for:

  • QA Teams: Automatically generate test cases from user stories and bugs
  • Development Teams: Create and manage tickets without leaving your AI assistant
  • Project Managers: Link related tickets and create sub-tasks quickly
  • Automation: Integrate Jira workflows into AI-powered automation pipelines
  • Documentation: Generate test documentation from existing tickets

Technical Details

  • Language: Java 23
  • Build Tool: Maven 3.x
  • Protocol: Model Context Protocol (MCP) via JSON-RPC 2.0
  • Communication: stdin/stdout
  • Jira API: REST API v3
  • Authentication: Basic Auth (email + API token)
  • Dependencies:
    • Apache HttpClient 5.3 (HTTP communication)
    • Gson 2.10.1 (JSON parsing)
    • Dotenv Java 3.0.0 (environment configuration)