hs-mcp-server-jiraservciemanagement

hariraj-singh/hs-mcp-server-jiraservciemanagement

3.2

If you are the rightful owner of hs-mcp-server-jiraservciemanagement 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.

An AI-ready MCP server that integrates with Jira Service Desk, providing customers and AI assistants with programmatic access to tickets, projects, and service management operations.

Tools
7
Resources
0
Prompts
0

Jira Service Desk - MCP Server

An AI-ready MCP (Model Context Protocol) server that integrates with Jira Service Desk, providing customers and AI assistants with programmatic access to tickets, projects, and service management operations.

Overview

This MCP server bridges Jira Service Desk with AI applications through the Model Context Protocol, enabling:

  • Seamless ticket management and querying
  • Project exploration and navigation
  • Issue creation and updates
  • Real-time comment additions
  • Intelligent caching for performance optimization
  • Enterprise-grade authentication

Features

Available Tools

The server exposes 7 primary MCP tools for Jira Service Desk operations:

  1. list_projects - Retrieve all accessible Jira projects
  2. list_ticket_types - Get available ticket types for a project
  3. get_user_tickets - Query tickets assigned to the current user
  4. get_ticket_detail - Retrieve comprehensive ticket information with comments
  5. create_ticket - Create new service desk tickets
  6. update_ticket_additional_details - Update ticket custom fields
  7. add_comments - Add comments to existing tickets

Key Capabilities

  • Async-first architecture - High-performance concurrent operations
  • Smart caching - Optimized project and ticket type retrieval
  • Comprehensive error handling - Custom exceptions for precise error reporting
  • Full test coverage - 99% code coverage with 218 passing tests (194 unit + 24 integration)
  • Production-ready - Zero technical debt, clean code architecture
  • Docker support - Container-ready deployment

Prerequisites

  • Python 3.10+ - Required runtime environment
  • Jira Service Desk - Cloud or Server instance
  • API Token - For Jira authentication
  • Docker (optional) - For containerized deployment

Quick Start

1. Clone the Repository

git clone https://github.com/hariraj-singh/hs-mcp-server-jiraservciemanagement.git
cd hs-mcp-server-jiraservciemanagement

2. Install Dependencies

# Using pip
pip install -r requirements.txt

# Or using uv (recommended)
uv pip install -r requirements.txt

3. Configure Environment

Create a .env file in the root directory:

# Jira Configuration (Required)
JIRA_URL=https://your-organization.atlassian.net
JIRA_EMAIL=your-email@domain.com
JIRA_API_TOKEN=your-api-token

# Jira Project Configuration
JIRA_MAX_RESULTS=50

# Field Configuration (Optional)
# Format: FIELD_MAPPING-{PROJECT_KEY}-{TICKET_TYPE_ID}=field1,field2
FIELD_MAPPING-IT-1=customfield_10000,customfield_10001

# MCP Server Configuration
MCP_SERVER_NAME=jira-service-desk-mcp
MCP_HOST_NAME=127.0.0.1
MCP_HOST_PORT=8080
TRANSPORT=streamable-http

# Logging Configuration
LOG_LEVEL=INFO

4. Run the Server

Option A: Local Development

python -m src.mcp.main

Option B: Docker

docker compose up -d --build

Configuration Guide

Environment Variables

Required Variables (Jira Authentication)
VariableDescriptionExample
JIRA_URLYour Jira cloud instance URLhttps://mycompany.atlassian.net
JIRA_EMAILEmail address for Jira authenticationuser@company.com
JIRA_API_TOKENAPI token for authenticationATATT3xFfGF03_38pn...
Optional Variables (Jira Configuration)
VariableDescriptionDefault
JIRA_MAX_RESULTSMaximum tickets to retrieve per query10
FIELDMAPPING_*Custom field mappings for ticket types (see below)N/A
Optional Variables (MCP Server)
VariableDescriptionDefault
MCP_SERVER_NAMEMCP server identifierjiraServiceDesk-mcp-server
MCP_HOST_NAMEServer hostname (use 0.0.0.0 for Docker/Azure)127.0.0.1
MCP_HOST_PORTServer port8080
TRANSPORTMCP transport type (streamable-http or stdio)streamable-http
LOG_LEVELLogging verbosity level (DEBUG, INFO, WARNING, ERROR, CRITICAL)INFO
Optional Variables (Testing Only)

Note: These variables are only required when running integration tests. See Testing section for details.

VariableDescriptionExample
TEST_JIRA_PROJECT_KEYProject key for integration testsITSD
TEST_JIRA_TICKET_TYPE_IDTicket type ID for integration tests50
TEST_JIRA_EXISTING_ISSUE_KEYExisting issue key for testing ticket detailITSD-127
TEST_JIRA_REQUESTER_EMAILEmail address for requester field testingtest@example.com
Field Mapping Configuration

For specific ticket types, you can configure custom fields to be returned with ticket details:

# Format: FIELDMAPPING_{PROJECT_KEY}_{TICKET_TYPE_ID}=field1,field2,field3,...

# Example for ITSD project, ticket type 48:
FIELDMAPPING_ITSD_48=customfield_10278,customfield_10377,customfield_10346

# Example for ITSD project, ticket type 50:
FIELDMAPPING_ITSD_50=customfield_10313,customfield_10270,customfield_10378,customfield_10442

# Example for HRD project, ticket type 1:
FIELDMAPPING_HRD_1=customfield_10001,customfield_10002,customfield_10003

Obtaining Jira API Token

  1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
  2. Click "Create API token"
  3. Name it (e.g., "MCP Server")
  4. Copy the token and store it securely
  5. Add to .env file as JIRA_API_TOKEN

Development

Local Development Setup

  1. Create virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  2. Install development dependencies:

    pip install -r requirements.txt
    pip install pytest pytest-asyncio pytest-cov black ruff mypy
    
  3. Configure environment:

    cp .env.example .env
    # Edit .env with your Jira credentials
    
  4. Run the server:

    python -m src.mcp.main
    

IDE Setup

Visual Studio Code

Add this to your .vscode/launch.json for debugging:

{
  "name": "MCP Server (Debugger)",
  "type": "debugpy",
  "request": "launch",
  "module": "src.mcp.main",
  "console": "integratedTerminal",
  "justMyCode": false
}

Then press F5 to start debugging.

Code Quality

Run code quality checks:

# Format code
black src/ tests/

# Lint code
ruff check src/ tests/

# Type checking
mypy src/

Testing

Comprehensive test suite with 99% code coverage (515/520 statements):

Unit Tests

Run unit tests for all modules:

# Run all unit tests with verbose output
python -m pytest tests/unit_tests/ -v

# Run with coverage report
python -m pytest tests/unit_tests/ --cov=src --cov-report=term-missing

# Run specific test file
python -m pytest tests/unit_tests/test_jsm_tools.py -v

Test Coverage by Module:

  • config.py - 100% (54/54 statements)
  • helper.py - 100% (19/19 statements)
  • custom_exception.py - 100% (25/25 statements)
  • jira_rest.py - 100% (95/95 statements)
  • jira_servicedesk.py - 100% (122/122 statements)
  • jsm_tools.py - 98% (176/180 statements)
  • main.py - 95% (22/23 statements)

Total Unit Tests: 194 tests, all passing ✅

Integration Tests

Run tests against your configured Jira Service Desk instance:

# Before running integration tests, configure these OPTIONAL environment variables in .env:
TEST_JIRA_PROJECT_KEY=YOUR_PROJECT_KEY
TEST_JIRA_TICKET_TYPE_ID=50
TEST_JIRA_EXISTING_ISSUE_KEY=ITSD-127
TEST_JIRA_REQUESTER_EMAIL=test@example.com

# Run integration tests
python -m pytest tests/integrated_tests/ -v

# Run with server output
python -m pytest tests/integrated_tests/ -v -s

Total Integration Tests: 24 tests covering all 7 MCP tools ✅

Note: Integration tests require a valid Jira instance configured with JIRA_URL, JIRA_EMAIL, and JIRA_API_TOKEN. The TEST_* variables are optional - if not set, some tests will be skipped.

Run All Tests

# Run all tests (unit + integration)
python -m pytest tests/ -v

# Quick summary without detailed output
python -m pytest tests/ -q --tb=short

Test Statistics

Total Tests:        218 (100% passing)
├── Unit Tests:     194 tests
│   └── 7 modules tested
├── Integration:    24 tests
│   └── All 7 MCP tools covered
Code Coverage:      99% (515/520 statements)
Execution Time:     ~25 seconds
Technical Debt:     0%

Docker Deployment

Build and Run with Docker Compose

# Build and start the container
docker compose up -d --build

# View logs
docker compose logs -f

# Stop the server
docker compose down

Docker Configuration

The docker-compose.yml includes:

  • Python 3.11-slim base image
  • Automatic dependency installation
  • Environment variable configuration
  • Health check endpoint
  • Non-root user for security

Environment in Docker

Create a .env file in the project root (same as local setup), and Docker will automatically load it.

Project Structure

hs-mcp-server-jiraservciemanagement/
├── src/
│   ├── mcp/
│   │   ├── main.py              # Entry point
│   │   ├── jsm_tools.py          # 7 MCP tools implementation
│   │   └── __init__.py
│   ├── services/
│   │   ├── jira_servicedesk.py   # Service Desk API layer
│   │   ├── jira_rest.py          # REST API layer
│   │   └── __init__.py
│   └── common/
│       ├── config.py             # Configuration management
│       ├── helper.py             # Utility functions
│       ├── custom_exception.py    # Custom exceptions
│       └── __init__.py
├── tests/
│   ├── unit_tests/               # 194 unit tests
│   └── integrated_tests/         # 24 integration tests
├── pyproject.toml                # Project metadata
├── requirements.txt              # Dependencies
├── Dockerfile                    # Container configuration
├── docker-compose.yml            # Docker compose setup
├── .env.example                  # Environment template
└── README.md                     # This file

Architecture

Layered Design

MCP Server (FastMCP)
    ↓
MCP Tools Layer (jsm_tools.py)
    ↓
Service Layer (jira_servicedesk.py, jira_rest.py)
    ↓
Jira REST APIs

Key Components

  • main.py: MCP server initialization and tool registration
  • jsm_tools.py: 7 MCP tool implementations with caching
  • jira_servicedesk.py: Service Desk API operations
  • jira_rest.py: REST API operations
  • config.py: Centralized configuration from environment
  • helper.py: Caching and utility functions
  • custom_exception.py: Error handling

For detailed architecture information, see

Troubleshooting

Authentication Issues

Error: 401 Unauthorized

  • Verify JIRA_EMAIL and JIRA_API_TOKEN are correct
  • Check API token hasn't expired (regenerate if needed)
  • Ensure email matches Jira account email

Error: 403 Forbidden

  • Verify user has access to configured projects
  • Check JIRA_PROJECT_KEY values are correct
  • Ensure API token has "read:jira-work" scope

Connection Issues

Error: Connection timeout

  • Verify JIRA_URL is correct and accessible
  • Check network connectivity to Jira instance
  • Ensure firewall allows outbound HTTPS

Error: Certificate verification failed

  • Update certificates: pip install --upgrade certifi
  • For development only (not recommended for production):
    export PYTHONHTTPSVERIFY=0
    

Ticket Operations

Issue: Can't create tickets

  • Verify JIRA_TICKET_TYPE IDs are valid for your projects
  • Check required fields are configured in Fields:* variables
  • Ensure user has create permission in Jira

Issue: Missing fields in tickets

  • Configure field mappings in environment variables
  • Verify field IDs are correct for your Jira instance
  • Check user has read permission for fields

API Documentation

For detailed MCP tool documentation and usage examples, refer to

Performance Characteristics

  • Caching: Project and ticket type lists cached in memory for optimal performance
  • Async Operations: All I/O operations are non-blocking
  • Connection Pooling: httpx.AsyncClient reuses connections
  • Batch Operations: Efficient bulk ticket operations

Security Considerations

  • ✅ API tokens stored in .env (not in code)
  • ✅ Environment variables used for secrets
  • ✅ HTTPS enforcement for Jira connections
  • ✅ No sensitive data in logs by default
  • ✅ Non-root user in Docker container

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Make your changes with tests
  4. Run code quality checks: black src/ && ruff check src/
  5. Ensure all tests pass: pytest tests/ -v
  6. Submit a pull request

Code Quality Standards

  • Test Coverage: Minimum 90% (currently 99%)
  • Type Hints: Full type annotations required
  • Code Format: Black formatted code
  • Linting: Ruff compliance
  • Type Checking: MyPy validation

License

This project is part of the Jira Service Desk MCP ecosystem.

Support

For issues, questions, or contributions:

  1. Check existing documentation in DOCUMENTATION_INDEX.md
  2. Review test examples in tests/integrated_tests/
  3. Check logs with appropriate LOG_LEVEL
  4. Open an issue on GitHub

Related Documentation

  • - System architecture and execution flow

Version: 0.1.0
Last Updated: December 3, 2025
Status: Production Ready ✅