JIRA MCP Server

JIRA MCP Server

Provides read-only access to JIRA REST API, enabling LLMs to query and retrieve information from JIRA instances.

Category
访问服务器

README

JIRA MCP Server

A Model Context Protocol (MCP) server that provides read-only access to JIRA REST API, enabling LLMs to query and retrieve information from JIRA instances.

Features

Issue Operations

  • Search Issues - Execute JQL queries to find issues
  • Get Issue Details - Retrieve comprehensive information about specific issues
  • Get Issue Comments - Fetch comments for issues
  • Get Issue Transitions - View available workflow transitions

Project Operations

  • List Projects - Get all accessible projects
  • Get Project Details - Retrieve detailed project information
  • Search Projects - Find projects by various criteria

User Operations

  • Get Current User - Retrieve authenticated user information
  • Get User - Get details about specific users
  • Search Users - Find users by query

Field Discovery Operations

  • Get Issue Types - Get all issue types for a project
  • Get Issue Type Fields - Get all fields available for a specific issue type
  • Get Issue Field Names - Get all field IDs and names for a specific issue
  • Search Issue Fields - Search for fields by name in a specific issue with partial matching

Architecture

This MCP server follows a modular architecture designed for maintainability and extensibility:

Project Structure

JIRA-API-MCP/
├── src/
│   ├── index.ts              # MCP server entry point
│   ├── server.ts             # Server initialization and tool registration
│   ├── client/
│   │   ├── JiraClient.ts     # JIRA API client wrapper with axios
│   │   └── types.ts          # TypeScript interfaces for JIRA data models
│   ├── tools/
│   │   ├── issues.ts         # Issue-related MCP tool implementations
│   │   ├── projects.ts       # Project-related MCP tool implementations
│   │   ├── users.ts          # User-related MCP tool implementations
│   │   └── fields.ts         # Field discovery MCP tool implementations
│   └── __tests__/
│       ├── tools-direct.test.ts    # Integration tests for tool handlers
│       ├── jira.test.ts           # Direct JIRA API tests
│       └── generate-mcp-docs.ts   # Documentation generation utility
├── dist/                     # Compiled JavaScript output
├── __tool_response_logs__/   # Test response captures
└── docs/
    ├── CLAUDE.md            # Instructions for AI assistants
    ├── INSPECTOR_GUIDE.md   # MCP Inspector usage guide
    ├── MCP_TOOL_DOCUMENTATION.md  # Detailed tool specifications
    └── TEST_SUMMARY.md      # Testing documentation

Key Components

  1. MCP Server Layer (server.ts)

    • Implements Model Context Protocol specification
    • Registers all available tools with the MCP SDK
    • Handles tool dispatch and response formatting
  2. JIRA Client (client/JiraClient.ts)

    • Axios-based HTTP client for JIRA REST API v2
    • Handles authentication via Bearer tokens
    • Implements retry logic and error handling
    • Manages request/response transformations
  3. Tool Modules (tools/*.ts)

    • Each module exports tool definitions with:
      • Zod schemas for input validation
      • Handler functions that call the JIRA client
      • Consistent error handling and response formatting
    • Tools return standardized {success, data/error} structure
  4. Type System (client/types.ts)

    • Comprehensive TypeScript interfaces for JIRA entities
    • Ensures type safety across the application
    • Documents expected data structures

Data Flow

  1. Request Flow:

    MCP Client → MCP Server → Tool Handler → JIRA Client → JIRA API
    
  2. Response Flow:

    JIRA API → JIRA Client → Tool Handler → MCP Server → MCP Client
    

Design Principles

  • Modularity: Each tool is self-contained with its own validation and logic
  • Type Safety: Full TypeScript coverage with strict typing
  • Error Resilience: Graceful error handling at each layer
  • Testability: Comprehensive test suite with response capture
  • Documentation: Auto-generated docs from actual API responses

Installation

From NPM

npm install @mcp/jira-server

From Source

git clone https://github.com/jl-0/JIRA-API-MCP.git
cd JIRA-API-MCP
npm install
npm run build

Configuration

The server requires JIRA authentication credentials. You can provide these via environment variables or a .env file:

# Required
# For Server/Data Center: https://your-server.com/jira
# For Cloud: https://your-domain.atlassian.net (not currently supported)
JIRA_BASE_URL=https://your-server.com/jira

# For Server/Data Center: Personal Access Token (PAT)
JIRA_API_TOKEN=your-personal-access-token

# Optional
JIRA_MAX_RESULTS=50  # Default max results per request
JIRA_TIMEOUT=30000   # Request timeout in milliseconds

JIRA Server/Data Center Support

This MCP server is designed for JIRA Server and Data Center installations using:

  • REST API v2 endpoints
  • Personal Access Token (PAT) authentication with Bearer tokens
  • Compatible with JIRA Server 8.14+ and JIRA Service Management 4.15+

Getting a Personal Access Token (PAT)

For JIRA Server/Data Center:

  1. Log in to your JIRA instance
  2. Navigate to your Profile → Personal Access Tokens
  3. Click "Create token"
  4. Give it a descriptive name and set expiration
  5. Copy the token immediately (it won't be shown again)
  6. Use this token as JIRA_API_TOKEN in your configuration

The server uses Bearer token authentication: Authorization: Bearer <token>

Note: JIRA Cloud uses a different authentication mechanism (API tokens with Basic auth) which is not currently supported by this server.

Usage

With Claude Desktop

Add the server to your Claude Desktop configuration:

{
  "mcpServers": {
    "jira": {
      "command": "npx",
      "args": ["@jl-0/jira-server"],
      "env": {
        "JIRA_BASE_URL": "https://your-domain.atlassian.net",
        "JIRA_API_TOKEN": "your-api-token"
      }
    }
  }
}

As a Standalone Server

# Using environment variables
export JIRA_BASE_URL=https://your-domain.atlassian.net
export JIRA_API_TOKEN=your-api-token
npm start

# Or using a .env file
npm start

Testing & Development

Interactive Testing with MCP Inspector

The MCP Inspector provides an interactive web interface for testing all server capabilities:

# Launch inspector with TypeScript source (development)
npm run inspect

# Build and inspect with compiled JavaScript
npm run inspect:built

The inspector will open at http://localhost:6274 and allow you to:

  • Test all available tools with custom parameters
  • View real-time server responses
  • Debug authentication and connectivity issues
  • Monitor server logs and notifications

See INSPECTOR_GUIDE.md for detailed usage instructions.

Automated Testing

Run the comprehensive test suite:

# Run all tests
npm test

# Run direct tool integration tests
npm run test:direct

# Generate documentation from test responses
npm run test:generate-docs

Test outputs are saved to __tool_response_logs__/ for analysis.

See TEST_SUMMARY.md for test documentation.

Available Tools

jira_search_issues

Search for issues using JQL (JIRA Query Language).

Parameters:

  • jql (required): JQL query string
  • maxResults: Maximum results to return (default: 50)
  • fields: Array of fields to include
  • expand: Array of data to expand
  • startAt: Starting index for pagination

Example:

{
  "jql": "project = PROJ AND status = 'In Progress'",
  "maxResults": 10
}

jira_get_issue

Get detailed information about a specific issue.

Parameters:

  • issueIdOrKey (required): Issue ID or key (e.g., PROJ-123)
  • fields: Array of fields to include
  • expand: Array of data to expand

jira_get_issue_comments

Get comments for a specific issue.

Parameters:

  • issueIdOrKey (required): Issue ID or key
  • maxResults: Maximum results (default: 50)
  • startAt: Starting index for pagination

jira_get_issue_transitions

Get available transitions for an issue.

Parameters:

  • issueIdOrKey (required): Issue ID or key
  • includeUnavailable: Include unavailable transitions (default: false)

jira_list_projects

List all accessible projects.

Parameters:

  • expand: Array of additional data to expand
  • recent: Return only most recent projects

jira_get_project

Get detailed project information.

Parameters:

  • projectIdOrKey (required): Project ID or key
  • expand: Array of additional data to expand

jira_search_projects

Search for projects.

Parameters:

  • query: Search query string
  • maxResults: Maximum results (default: 50)
  • startAt: Starting index
  • orderBy: Sort order field
  • typeKey: Project type key
  • categoryId: Project category ID
  • action: Filter by permission (view/browse/edit)

jira_get_current_user

Get information about the authenticated user.

Parameters:

  • expand: Additional data to expand

jira_search_users

Search for users.

Parameters:

  • query: Search query matching display name and email
  • accountId: Find user by account ID
  • maxResults: Maximum results (default: 50)
  • startAt: Starting index

jira_get_issue_types

Get all issue types available for a specific project.

Parameters:

  • projectIdOrKey (required): Project ID or key
  • maxResults: Maximum results (default: 50)
  • startAt: Starting index

jira_get_issue_type_fields

Get all fields available for a specific issue type in a project.

Parameters:

  • projectIdOrKey (required): Project ID or key
  • issueTypeId (required): Issue type ID
  • maxResults: Maximum results (default: 50)
  • startAt: Starting index

jira_get_issue_field_names

Get all field IDs and names for a specific JIRA issue.

Parameters:

  • issueIdOrKey (required): Issue ID or key

Example:

{
  "issueIdOrKey": "IDS-10314"
}

jira_search_issue_fields

Search for specific fields by name in a JIRA issue.

Parameters:

  • issueIdOrKey (required): Issue ID or key
  • searchTerms (required): Array of search terms to match against field names

Example:

{
  "issueIdOrKey": "IDS-10314",
  "searchTerms": ["test", "procedure", "story points"]
}

JQL Examples

Common JQL queries you can use with jira_search_issues:

-- Find all open issues assigned to me
assignee = currentUser() AND resolution = Unresolved

-- Find high priority bugs
priority = High AND issuetype = Bug

-- Issues updated in the last week
updated >= -1w

-- Issues in specific projects
project in (PROJ1, PROJ2) AND status = "To Do"

-- Issues with specific labels
labels in ("backend", "api")

-- Issues created this month
created >= startOfMonth()

-- Find issues by reporter
reporter = "john.doe@example.com"

-- Complex query
project = PROJ AND (
  (priority = High AND status = "In Progress") OR
  (priority = Critical AND status != Done)
) ORDER BY created DESC

Development

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run in development mode
npm run dev

# Run tests
npm test

# Lint code
npm run lint

# Format code
npm run format

Publishing to npm

First-time Setup

  1. Ensure you have an npm account at npmjs.com
  2. Login to npm from your terminal:
    npm login
    

Publishing Process

  1. Update the version in package.json following semantic versioning:

    npm version patch  # for bug fixes (0.1.0 -> 0.1.1)
    npm version minor  # for new features (0.1.0 -> 0.2.0)
    npm version major  # for breaking changes (0.1.0 -> 1.0.0)
    
  2. Build the project:

    npm run clean
    npm run build
    
  3. Test locally (optional but recommended):

    npm link
    # In another project:
    npm link @mcp/jira-server
    
  4. Publish to npm:

    npm publish --access public
    
  5. Create a git tag and push:

    git push origin main
    git push origin --tags
    

Package Information

Error Handling

The server provides detailed error messages for common issues:

  • Authentication failures - Check your API token and email
  • Permission errors - Ensure your account has access to the requested resources
  • Rate limiting - The server implements retry logic for rate limits
  • Network issues - Check your internet connection and JIRA instance URL

Security

  • API tokens are never logged or exposed
  • All communication with JIRA uses HTTPS
  • Uses Bearer token authentication for secure API access
  • Credentials should be stored securely using environment variables
  • The server provides read-only access by default

Limitations

  • This is a read-only implementation (no issue creation/updates)
  • Rate limits are determined by your JIRA instance
  • Some JIRA Cloud features may not be available on JIRA Server/Data Center
  • Field discovery tools use the editmeta endpoint which returns fields available for editing

Future Enhancements

Planned features for future releases:

  • Issue creation and updates
  • Attachment handling
  • Webhook support
  • Advanced filtering and field customization
  • Bulk operations
  • Sprint and board operations (JIRA Software)
  • Service desk operations (JIRA Service Management)

Documentation

This project maintains comprehensive documentation:

Documentation Maintenance

When making changes to the codebase:

  1. Update README.md when adding features or changing configuration
  2. Run tests to capture new response formats: npm run test:direct
  3. Generate documentation from test outputs: npm run test:generate-docs
  4. Update tool documentation if parameters or responses change
  5. Follow guidelines in CLAUDE.md for consistent documentation

Contributing

Contributions are welcome! Please:

  1. Read CLAUDE.md for development guidelines
  2. Update documentation when making changes
  3. Add tests for new functionality
  4. Ensure all tests pass: npm test
  5. Run linting: npm run lint
  6. Submit a Pull Request with clear description

License

MIT

Support

For issues and questions, please use the GitHub Issues page.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选