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(用于环境变量)
安装
克隆此存储库:
git clone https://github.com/yourusername/python-jira-mcp.git cd python-jira-mcp安装依赖项:
pip install -r requirements.txt设置您的 Jira 凭证:
cp .env.example .env # Edit .env with your Jira credentials
用法
运行服务器
要启动 MCP 服务器,请运行:
或者直接使用可执行文件:
服务器将启动并在标准输入(stdin)上监听 MCP 消息并在标准输出(stdout)上做出响应。
与 Cursor 集成
要将此 MCP 服务器与 Cursor 一起使用:
启动服务器(如上)
在 Cursor 中,配置 MCP 服务器路径指向
main.py直接在 Cursor 中使用 Jira 工具
可用工具
JQL 搜索
使用 JQL(Jira 查询语言)搜索 Jira 问题。
例子:
获取问题
通过 ID 或密钥检索有关特定 Jira 问题的详细信息。
例子:
发展
项目结构
main.py:MCP 服务器的入口点src/server.py:主 MCP 服务器实现src/tools/jira_tools.py:Jira API 工具实现src/tool_schemas.py:工具模式定义
添加新工具
要添加新的 Jira 相关工具:
在
src/tools/jira_tools.py中实现工具功能在
src/tool_schemas.py中添加工具模式在
src/server.py中注册该工具
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。
致谢
Related MCP Servers
- -securityFlicense-qualityEnables AI models to interact with Jira using a standardized protocol, offering full Jira REST API integration with features like optimal performance through connection pooling, error handling, and request monitoring.Last updated -2
- AsecurityAlicenseAqualityA Model Context Protocol server that provides integration with Jira, allowing Large Language Models to interact with Jira projects, boards, sprints, and issues through natural language.Last updated -5432MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants like Claude to interact with Jira, allowing for project management tasks such as listing projects, searching issues, creating tickets, and managing sprints through natural language queries.Last updated -7172TypeScriptMIT License
- -securityAlicense-qualityA Simple Model Context Protocol server that enables AI assistants to interact with Jira, allowing operations like fetching tickets, adding comments, and updating ticket status.Last updated -1Apache 2.0