使用说明
🔌 Jira MCP集成
Cursor AI和其他代理编写了令人惊叹的代码。 在企业中,任务在Jira、GitHub Issues、Azure DevOps等工具中给出。人工智能需要使用这些工具。
这个开源解决方案帮助AI代理处理Jira数据。
🌐 公共实例
可在https://jira-mcp.koveh.com
只需提供您的Jira凭据。我们不存储任何数据。
建筑
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ AI Agent │────▶│ MCP Server │────▶│ Jira Cloud │
│ (Cursor/etc) │◀────│ jira-mcp │◀────│ REST API │
└─────────────────┘ └─────────────────┘ └─────────────────┘
特性
- ✅ 获取项目列表
- ✅ 获取包含详细信息的任务列表
- ✅ 通过描述获取特定任务
- ✅ 创建新票
- ✅ 更新现有票证
- ✅ 删除门票
- ✅ 使用JQL搜索
- ✅ 为用户分配任务
- ✅ 过渡任务状态
快速开始
选项1:使用公共实例
首选 https://jira-mcp.koveh.com 并使用您的Jira凭据进行连接。
选项2:使用Docker运行
git clone https://github.com/Koveh/jira-mcp.git
cd jira-mcp
docker-compose up -d
访问地址:http://localhost:4200
选项3:本地运行
git clone https://github.com/Koveh/jira-mcp.git
cd jira-mcp
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python http_server.py
获取Jira API代币
- 首选https://id.atlassian.com/manage-profile/security/api-tokens
- 点击“创建API令牌”
- 复制令牌
用法
添加到游标IDE(本地MCP)
- 克隆并设置虚拟环境:
git clone https://github.com/Koveh/jira-mcp.git
cd jira-mcp
# Create virtual environment (required for mcp package)
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
-
从以下位置获取Jira API令牌:https://id.atlassian.com/manage-profile/security/api-tokens
-
添加到
~/.cursor/mcp.json(macOS/Linux)或%USERPROFILE%\.cursor\mcp.json(Windows):
{
"mcpServers": {
"jira": {
"command": "/full/path/to/jira-mcp/venv/bin/python",
"args": ["/full/path/to/jira-mcp/mcp_server.py"],
"env": {
"JIRA_BASE_URL": "https://your-domain.atlassian.net",
"JIRA_EMAIL": "your-email@example.com",
"JIRA_API_TOKEN": "your-api-token-from-step-2"
}
}
}
}
重要提示: 使用venv中Python解释器的完整路径(
venv/bin/python在Linux/macOS上,venv\Scripts\python.exe在Windows上)。这确保了mcp套餐可用。
- 重新启动光标(Cmd/Ctrl+Shift+P→ “开发人员:重新加载窗口”)
您将获得以下工具:
| 工具 | 说明 |
|---|---|
jira_connect |
连接到Jira实例 |
jira_get_projects |
列出所有项目 |
jira_get_issues |
从项目中获取问题 |
jira_get_issue |
获取具体问题详细信息 |
jira_create_issue |
创建新问题 |
jira_update_issue |
更新现有问题 |
jira_delete_issue |
删除问题 |
jira_search |
使用JQL搜索 |
jira_get_current_user |
获取当前用户信息 |
REST API使用
# 1. Connect and get token
curl -X POST https://jira-mcp.koveh.com/api/connect \
-H "Content-Type: application/json" \
-d '{
"base_url": "https://your-domain.atlassian.net",
"email": "your-email@example.com",
"api_token": "your-api-token"
}'
# Response includes token for subsequent requests
# {"status": "connected", "token": "eyJ...", ...}
# 2. Use token for API calls
curl https://jira-mcp.koveh.com/api/projects \
-H "Authorization: Bearer YOUR_TOKEN"
# 3. Create issue
curl -X POST https://jira-mcp.koveh.com/api/issues \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"project": "PROJ", "summary": "New task"}'
CLI使用情况
export JIRA_BASE_URL=https://your-domain.atlassian.net
export JIRA_EMAIL=your-email@example.com
export JIRA_API_TOKEN=your-api-token
python cli.py whoami # Show current user
python cli.py projects # List projects
python cli.py list PROJ # List issues
python cli.py get PROJ-123 # Get issue details
python cli.py create PROJ "Summary" # Create issue
python cli.py update PROJ-123 -s "New" # Update issue
python cli.py delete PROJ-123 # Delete issue
python cli.py search "status='Done'" # Search with JQL
Python客户端
from jira_client import JiraClient, JiraConfig
config = JiraConfig(
base_url="https://your-domain.atlassian.net",
email="your-email@example.com",
api_token="your-api-token"
)
client = JiraClient(config)
# Get projects
projects = client.get_all_projects()
# Create issue
issue = client.create_issue("PROJ", "Summary", "Description")
# Search
results = client.search_issues("status = 'In Progress'")
API终点
| 方法 | 端点 | 描述 |
|---|---|---|
| 得到 | /health |
健康检查 |
| 职位 | /api/connect |
连接并获取令牌 |
| 得到 | /api/user |
获取当前用户 |
| 得到 | /api/projects |
列出所有项目 |
| 得到 | /api/issues?project=KEY |
获取项目问题 |
| 得到 | /api/issue/KEY |
获取问题详细信息 |
| 职位 | /api/issues |
创建问题 |
| PUT | /api/issue/KEY |
更新问题 |
| 删除 | /api/issue/KEY |
删除问题 |
| 得到 | /api/search?jql=... |
使用JQL搜索 |
项目结构
jira-mcp/
├── jira_client.py # Core Jira API wrapper
├── mcp_server.py # MCP server (stdio transport)
├── http_server.py # HTTP/REST server
├── cli.py # Command-line interface
├── Dockerfile # Docker image
├── docker-compose.yml # Docker Compose config
├── requirements.txt # Python dependencies
├── examples/ # Usage examples
│ ├── cursor_mcp_config.json
│ └── api_usage.sh
└── tests/ # Test scripts
├── test_jira.py
└── demo.py
Docker自托管
# Build and run
docker-compose up -d
# Or manually
docker build -t jira-mcp .
docker run -d -p 4200:4200 --name jira-mcp jira-mcp
使用nginx反向代理
server {
server_name jira-mcp.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:4200;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
SSL与Certbot
certbot --nginx -d jira-mcp.yourdomain.com
安全
- 🔒 我们不存储任何凭据或数据
- 🔑 凭据仅用于直接Jira API调用
- 📤 使用API令牌(而不是密码)
- 🔄 代币可以在id.atlassian.com随时撤销
许可证
麻省理工学院
作者
DHW团队 - koveh.com
由...制作❤️ 面向人工智能驱动的开发社区
