MCP Jira Server

February 27, 2025 ยท View on GitHub

A Model Context Protocol (MCP) server that provides Jira integration for LLMs like Claude. This server exposes tools for executing JQL queries and retrieving detailed ticket information.

Features

  • JQL Query Tool: Run JQL (Jira Query Language) queries against your Jira instance
  • Ticket Details Tool: Get comprehensive information about specific Jira tickets
  • PR Link Detection: Automatically extracts pull request links from descriptions and comments
  • Project Context: Customizable project context for all operations

Installation

Prerequisites

  • Python 3.10 or higher
  • A Jira account with API access
  • Claude Desktop or another MCP client

Setup

  1. Clone this repository or download the source code

  2. Install dependencies:

    pip install mcp[cli] httpx
    
  3. Configure your Jira credentials as environment variables:

    export JIRA_DOMAIN="your-domain"  # e.g., "mycompany" if your Jira URL is https://mycompany.atlassian.net
    export JIRA_EMAIL="your-email@example.com"
    export JIRA_API_TOKEN="your-api-token"
    

    Note: You can generate a Jira API token from Atlassian Account Settings.

Usage with Claude Desktop

  1. First, ensure Claude Desktop is installed and updated to the latest version

  2. Edit your Claude Desktop configuration file:

    macOS:

    code ~/Library/Application\ Support/Claude/claude_desktop_config.json
    

    Windows:

    code $env:APPDATA\Claude\claude_desktop_config.json
    
  3. Add the following configuration to enable the Jira server:

    {
      "mcpServers": {
        "jira": {
          "command": "python",
          "args": ["/absolute/path/to/jira_mcp_server.py"],
          "env": {
            "JIRA_DOMAIN": "your-domain",
            "JIRA_EMAIL": "your-email@example.com",
            "JIRA_API_TOKEN": "your-api-token"
          }
        }
      }
    }
    
  4. Save the configuration file and restart Claude Desktop

  5. Verify the server is running by checking for the hammer icon in Claude's interface, which indicates available tools

Tools

execute_jql

Execute JQL queries against your Jira instance.

Arguments:

  • query: A JQL snippet (e.g., summary ~ NFR ORDER BY created DESC)
  • project_name: (Optional) The Jira project key (defaults to "LAN")

Examples:

Ask Claude to:

  • "Find all open tickets in project ABC"
  • "Search for high priority bugs in the LAN project"
  • "Show me tickets assigned to me that were updated this week"

get_ticket_details

Get comprehensive information about a specific Jira ticket.

Arguments:

  • ticket_key: The full ticket key (e.g., "LAN-123")
  • project_name: (Optional) The Jira project key (defaults to "LAN")

Examples:

Ask Claude to:

  • "What's the status of ticket LAN-123?"
  • "Get me details about PROJ-456 including any PR links"
  • "Show me the comments on ticket ABC-789"

Troubleshooting

Common Issues

  1. Authentication Errors:

    • Verify your Jira credentials are set correctly in environment variables
    • Check that your API token is valid and has not expired
  2. Connection Problems:

    • Ensure you have internet connectivity
    • Verify your Jira domain is correct
  3. MCP Integration Issues:

    • Check Claude Desktop logs: tail -f ~/Library/Logs/Claude/mcp*.log
    • Ensure the path to the server script in the configuration is absolute and correct

Debug Logging

To enable verbose logging, modify the setup_logging function in the code to use logging.DEBUG instead of logging.INFO.

Advanced Configuration

Customizing the Default Project

The default project is set to "LAN". You can modify this by changing the default value for the project_name parameter in both tool functions.

Adding More Tools

You can extend this server with additional Jira functionality by:

  1. Adding new methods to the JiraAPI class
  2. Creating new tool functions with the @mcp.tool() decorator

License

This project is open source and available under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


For more information about MCP, visit https://modelcontextprotocol.io