Jira 每周报告 MCP 服务器
该项目提供了一个FastMCP服务器,可连接到您的 Jira 实例(云或服务器/数据中心),并根据问题活动生成每周报告。它利用pycontribs-jira库与 Jira 进行交互,并可选择使用所连接客户端的大型语言模型 (LLM) 来汇总生成的报告。
✨ 特点
**Jira 连接:**使用存储在
.env文件中的 API 令牌安全地连接到 Jira。**MCP 工具:**公开可通过模型上下文协议访问的
generate_jira_report工具。灵活的报告:
默认报告过去 7 天内更新的问题。
允许指定自定义 JQL 查询。
可以按特定的 Jira 项目键过滤报告。
限制返回的结果数量(可配置)。
**(可选)LLM 摘要:**可以使用客户端的LLM(通过
ctx.sample())提供报告的简明摘要。**异步处理:**使用
asyncio.to_thread正确处理异步 FastMCP 服务器中的同步 Jira 库调用。
📋 先决条件
Python 3.10 或更高版本。
uv(推荐)或pip用于包管理。访问 Jira 实例(云、服务器或数据中心)。
Jira API 令牌(服务器/DC 的个人访问令牌)。
FastMCP CLI已安装并在系统的 PATH 中可用。
⚙️ 设置
克隆存储库(如果适用):
git clone https://github.com/Jongryong/jira_reporter.git cd jira_reporter**安装依赖项:**我们建议使用
uv:uv pip install fastmcp "jira[cli]" python-dotenv httpx anyio或者,使用
pip:pip install fastmcp "jira[cli]" python-dotenv httpx anyio**创建
.env文件:**在与jira_reporter_server.py相同的目录中创建一个名为.env的文件。添加您的 Jira 连接详细信息:# .env JIRA_URL=https://your-domain.atlassian.net # Your Jira Cloud URL or Self-Hosted URL JIRA_USERNAME=your_email@example.com # Your Jira login email JIRA_API_TOKEN=your_api_token_or_pat # Your generated API Token or PAT
▶️ 运行服务器(独立)
您可以独立运行服务器以进行测试或其他目的:
直接使用 Python:
python jira_reporter_server.py使用 FastMCP CLI:
fastmcp run jira_reporter_server.py要使用 SSE 运行(例如,用于远程访问):
fastmcp run jira_reporter_server.py --transport sse --port 8001
🖥️ 与 Claude Desktop 一起使用
要使此服务器作为 Claude Desktop 应用程序中的工具使用:
**确保先决条件:**确保
fastmcp已安装并可在系统 PATH 中访问,因为下面的配置使用fastmcp命令。**找到 Claude 配置文件:**找到
claude_desktop_config.json文件。其位置取决于您的操作系统:macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json(通常为C:\Users\<YourUsername>\AppData\Roaming\Claude\claude_desktop_config.json)Linux:
~/.config/Claude/claude_desktop_config.json(或$XDG_CONFIG_HOME/Claude/)
**编辑配置文件:**在文本编辑器中打开
claude_desktop_config.json。添加服务器配置::
{ "mcpServers": { // ... other servers might be here ... "jira_report": { "command": "fastmcp", "args": [ "run", "/path/to/your/jira_reporter_server.py" // <-- IMPORTANT: Use the full, absolute path here ] } // ... other servers might be here ... } // ... rest of your Claude config ... }"jira_report":这是 Claude 使用的内部名称。您可以根据需要更改它。"command": "fastmcp":告诉 Claude 使用fastmcp命令行工具。"args": [...]:告诉 Claude 运行fastmcp run /path/to/your/jira_reporter_server.py。
**保存并重新启动:**保存
claude_desktop_config.json文件并重新启动 Claude Desktop 应用程序。**调用工具:**现在,您应该能够在 Claude 中通过提及 Python 脚本(
Jira Weekly Reporter)中定义的服务器名称来使用该工具。例如:@Jira Weekly Reporter generate jira report for project MYPROJ and summarize it
🛠️ MCP 工具详情
工具名称:
generate_jira_report**描述:**基于 JQL 查询生成 Jira 问题报告(默认为最近更新)。可选择使用客户端的 LLM 汇总报告。
参数:
范围 | 类型 | 必需的 | 默认 | 描述 |
|
| 不 |
| 可选的 JQL 查询。如果省略,则使用默认值。 |
|
| 不 |
| 可选的 Jira 项目键(例如“PROJ”)用于限制搜索范围(添加为
)。 |
|
| 不 |
| 原始报告数据中包含的最大问题数。 |
|
| 不 |
| 如果为
,服务器将通过
向 客户端的 LLM 请求摘要。 |
📦服务器依赖项
FastMCP构造函数包含dependencies=["jira"] 。这告诉fastmcp install之类的工具,在创建隔离环境时,此服务器需要jira库才能正常运行。
🤝 贡献
欢迎贡献!请随时提交问题或拉取请求。
📄 许可证
MIT 许可证
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
连接到 Jira 实例以根据问题活动生成每周报告,支持自定义 JQL 查询和可选的 LLM 摘要。
Related MCP Servers
- AsecurityAlicenseAqualityProvides capabilities for searching Jira issues using JQL and retrieving detailed issue information.Last updated -9328MIT License
- AsecurityAlicenseAqualityProvides integration with Jira's REST API, allowing AI assistants to manage Jira issues programmatically.Last updated -89MIT License
- AsecurityAlicenseAqualityA TypeScript-based server that enables interaction with Jira, providing tools to execute JQL queries, manage tickets, list projects and statuses through natural language.Last updated -1124MIT License
- -securityAlicense-qualityA collection of tools for interacting with Jira via the Model Context Protocol, providing core functionalities like fetching and analyzing issues, plus a guided Issue Creation Wizard.Last updated -522MIT License