Python Jira MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Supports loading Jira credentials from environment variables using python-dotenv for secure configuration.

  • Integrates with Atlassian's Jira API, enabling AI models to perform Jira operations like searching for issues and retrieving issue details.

  • Provides tools for searching Jira issues with JQL queries and retrieving detailed information about specific Jira issues, including fields like summary, description, status, and assignee.

Python Jira MCP 服务器

一个用 Python 实现的模型上下文协议 (MCP) 服务器,可与 Jira API 集成。这使得 AI 模型能够通过标准化协议与 Jira 进行交互。

概述

此 MCP 服务器将 Jira API 操作公开为可供支持模型上下文协议 (MCP) 的 AI 模型使用的工具。该服务器实现了 stdio 传输机制,以便与 Cursor 等客户端进行通信。

特征

  • JQL 搜索工具:使用 JQL 查询搜索 Jira 问题
  • 获取问题工具:检索有关特定 Jira 问题的详细信息
  • MCP SDK 集成:兼容官方 MCP Python SDK
  • 回退模式:当 SDK 不可用时,最小实现
  • 环境配置:从环境变量加载 Jira 凭据

要求

  • Python 3.8+
  • Jira API 访问(API 令牌、电子邮件和域)
  • 所需的 Python 包:
    • mcp (模型上下文协议 Python SDK)
    • aiohttp (用于 HTTP 请求)
    • pydantic (用于验证)
    • python-dotenv (用于环境变量)

安装

  1. 克隆此存储库:
    git clone https://github.com/yourusername/python-jira-mcp.git cd python-jira-mcp
  2. 安装依赖项:
    pip install -r requirements.txt
  3. 设置您的 Jira 凭证:
    cp .env.example .env # Edit .env with your Jira credentials

用法

运行服务器

要启动 MCP 服务器,请运行:

python main.py

或者直接使用可执行文件:

./main.py

服务器将启动并在标准输入(stdin)上监听 MCP 消息并在标准输出(stdout)上做出响应。

与 Cursor 集成

要将此 MCP 服务器与 Cursor 一起使用:

  1. 启动服务器(如上)
  2. 在 Cursor 中,配置 MCP 服务器路径指向main.py
  3. 直接在 Cursor 中使用 Jira 工具

可用工具

JQL 搜索

使用 JQL(Jira 查询语言)搜索 Jira 问题。

例子:

{ "type": "tool_call", "id": "123", "name": "jql_search", "parameters": { "jql": "project = XYZ AND status = 'In Progress'", "max_results": 10, "fields": ["summary", "description", "status"] } }

获取问题

通过 ID 或密钥检索有关特定 Jira 问题的详细信息。

例子:

{ "type": "tool_call", "id": "456", "name": "get_issue", "parameters": { "issue_id_or_key": "XYZ-123", "fields": ["summary", "description", "status", "assignee"], "expand": "changelog" } }

发展

项目结构

  • main.py :MCP 服务器的入口点
  • src/server.py :主 MCP 服务器实现
  • src/tools/jira_tools.py :Jira API 工具实现
  • src/tool_schemas.py :工具模式定义

添加新工具

要添加新的 Jira 相关工具:

  1. src/tools/jira_tools.py中实现工具功能
  2. src/tool_schemas.py中添加工具模式
  3. src/server.py中注册该工具

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

致谢

-
security - not tested
F
license - not found
-
quality - not tested

服务器实现允许 AI 模型通过模型上下文协议与 Jira 交互,从而实现 JQL 搜索和检索问题详细信息等任务。

  1. Overview
    1. Features
      1. Requirements
        1. Installation
          1. Usage
            1. Running the Server
            2. Integrating with Cursor
            3. Available Tools
          2. Development
            1. Project Structure
            2. Adding New Tools
          3. License
            1. Acknowledgments
              ID: trslzvvi2w