backlog-mcp 1.0.5__tar.gz → 1.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/PKG-INFO +1 -1
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/main.py +2 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/tools/__init__.py +2 -0
- backlog_mcp-1.0.7/app/tools/get_my_issues.py +28 -0
- backlog_mcp-1.0.7/app/tools/get_user_issue_list.py +26 -0
- backlog_mcp-1.0.7/app/tools/get_users_by_project.py +24 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/tools/update_issue_description.py +4 -1
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/utils/ultils.py +32 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/pyproject.toml +1 -1
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/uv.lock +1 -1
- backlog_mcp-1.0.5/app/tools/get_user_issue_list.py +0 -28
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/.env.example +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/.gitignore +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/.mise.toml +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/README.md +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/__init__.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/constants/__init__.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/constants/constants.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/core/__init__.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/logging_config.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/models/__init__.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/models/models.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/server_settings.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/tools/get_issue_details.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/utils/__init__.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/app/utils/di.py +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/docs/mcp-installer-template.md +0 -0
- {backlog_mcp-1.0.5 → backlog_mcp-1.0.7}/scripts/install-backlog-mcp.sh +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from app.utils.di import create_backlog_context
|
|
2
|
+
from app.utils.ultils import get_current_user, get_user_task
|
|
3
|
+
|
|
4
|
+
async def get_my_issues():
|
|
5
|
+
"""
|
|
6
|
+
Retrieves a list of issues assigned to the current user from Backlog.
|
|
7
|
+
|
|
8
|
+
This function automatically determines the current user's ID via API
|
|
9
|
+
and returns only issues assigned to that user.
|
|
10
|
+
|
|
11
|
+
Returns:
|
|
12
|
+
List of issues with {issueKey, title}
|
|
13
|
+
"""
|
|
14
|
+
try:
|
|
15
|
+
ctx = create_backlog_context()
|
|
16
|
+
current_user = await get_current_user(
|
|
17
|
+
backlog_domain=ctx.backlog_domain,
|
|
18
|
+
api_key=ctx.api_key,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
issues = await get_user_task(
|
|
22
|
+
backlog_domain=ctx.backlog_domain,
|
|
23
|
+
api_key=ctx.api_key,
|
|
24
|
+
assignee_ids=[current_user["id"]],
|
|
25
|
+
)
|
|
26
|
+
return issues
|
|
27
|
+
except Exception as e:
|
|
28
|
+
raise e
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from app.utils.di import create_backlog_context
|
|
2
|
+
from app.utils.ultils import get_user_task
|
|
3
|
+
|
|
4
|
+
async def get_user_issue_list(user_id: int):
|
|
5
|
+
"""
|
|
6
|
+
Get issues assigned to a specific user.
|
|
7
|
+
|
|
8
|
+
Args:
|
|
9
|
+
user_id (int): The Backlog user ID to filter issues by.
|
|
10
|
+
|
|
11
|
+
Returns:
|
|
12
|
+
List of issues with {issueKey, title}
|
|
13
|
+
"""
|
|
14
|
+
try:
|
|
15
|
+
if not user_id:
|
|
16
|
+
raise ValueError("Please provide a user ID.")
|
|
17
|
+
|
|
18
|
+
ctx = create_backlog_context()
|
|
19
|
+
issues = await get_user_task(
|
|
20
|
+
backlog_domain=ctx.backlog_domain,
|
|
21
|
+
api_key=ctx.api_key,
|
|
22
|
+
assignee_ids=[user_id],
|
|
23
|
+
)
|
|
24
|
+
return issues
|
|
25
|
+
except Exception as e:
|
|
26
|
+
raise e
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from app.utils.di import create_backlog_context
|
|
2
|
+
from app.utils.ultils import get_project_users
|
|
3
|
+
|
|
4
|
+
async def get_users_by_project(project_key: str):
|
|
5
|
+
"""
|
|
6
|
+
Get all users in a specific project.
|
|
7
|
+
|
|
8
|
+
Args:
|
|
9
|
+
project_key (str): Project key to search users in (e.g., 'PROJ')
|
|
10
|
+
|
|
11
|
+
Returns:
|
|
12
|
+
List of all users with {id, name, mailAddress}
|
|
13
|
+
"""
|
|
14
|
+
try:
|
|
15
|
+
ctx = create_backlog_context()
|
|
16
|
+
project_users = await get_project_users(
|
|
17
|
+
backlog_domain=ctx.backlog_domain,
|
|
18
|
+
api_key=ctx.api_key,
|
|
19
|
+
project_key=project_key
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
return project_users
|
|
23
|
+
except Exception as e:
|
|
24
|
+
raise e
|
|
@@ -7,7 +7,10 @@ async def update_issue_description(
|
|
|
7
7
|
description: str,
|
|
8
8
|
):
|
|
9
9
|
"""
|
|
10
|
-
|
|
10
|
+
Updates the description of a Backlog issue.
|
|
11
|
+
|
|
12
|
+
IMPORTANT: Call this tool directly when all parameters are provided.
|
|
13
|
+
Do NOT call other tools to check issue existence beforehand.
|
|
11
14
|
|
|
12
15
|
Args:
|
|
13
16
|
issue_key (str): The key or ID of the Backlog issue to update.
|
|
@@ -301,6 +301,38 @@ async def get_current_user(backlog_domain: str, api_key: str) -> dict:
|
|
|
301
301
|
except Exception as e:
|
|
302
302
|
raise ValueError(f"Unexpected error while getting current user: {e}") from e
|
|
303
303
|
|
|
304
|
+
async def get_project_users(backlog_domain: str, api_key: str, project_key: str) -> list[dict]:
|
|
305
|
+
"""Get users in a specific project (requires only project access, not admin).
|
|
306
|
+
|
|
307
|
+
Args:
|
|
308
|
+
backlog_domain (str): Backlog domain URL
|
|
309
|
+
api_key (str): API key for authentication
|
|
310
|
+
project_key (str): Project key (e.g., 'PROJ')
|
|
311
|
+
|
|
312
|
+
Returns:
|
|
313
|
+
list[dict]: List of users with {id, name, mailAddress}
|
|
314
|
+
"""
|
|
315
|
+
url = f"{backlog_domain}api/v2/projects/{project_key}/users"
|
|
316
|
+
params = {"apiKey": api_key}
|
|
317
|
+
|
|
318
|
+
async with httpx.AsyncClient() as client:
|
|
319
|
+
try:
|
|
320
|
+
response = await client.get(url, params=params, timeout=10.0)
|
|
321
|
+
response.raise_for_status()
|
|
322
|
+
data = response.json()
|
|
323
|
+
return [
|
|
324
|
+
{
|
|
325
|
+
"id": user["id"],
|
|
326
|
+
"name": user["name"],
|
|
327
|
+
"mailAddress": user.get("mailAddress")
|
|
328
|
+
}
|
|
329
|
+
for user in data
|
|
330
|
+
]
|
|
331
|
+
except httpx.HTTPError as e:
|
|
332
|
+
raise ValueError(f"Failed to get project users: {e}") from e
|
|
333
|
+
except Exception as e:
|
|
334
|
+
raise ValueError(f"Unexpected error while getting project users: {e}") from e
|
|
335
|
+
|
|
304
336
|
|
|
305
337
|
async def update_issue_description_handler(
|
|
306
338
|
backlog_domain: str,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "backlog-mcp"
|
|
3
|
-
version = "1.0.
|
|
3
|
+
version = "1.0.7"
|
|
4
4
|
description = "A Model Context Protocol (MCP) server for Backlog project management integration"
|
|
5
5
|
authors = [{name = "BaoNguyen", email = "baonguyen@teqnological.asia"}]
|
|
6
6
|
readme = "README.md"
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
from app.utils.di import create_backlog_context
|
|
2
|
-
from app.utils.ultils import get_user_task, get_current_user
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
async def get_user_issue_list():
|
|
6
|
-
"""
|
|
7
|
-
Retrieves a list of issues assigned to the current user from Backlog.
|
|
8
|
-
|
|
9
|
-
This function automatically determines the current user's ID via API
|
|
10
|
-
and returns only issues assigned to that user.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
try:
|
|
14
|
-
ctx = create_backlog_context()
|
|
15
|
-
|
|
16
|
-
# Fetch current user information
|
|
17
|
-
current_user = await get_current_user(ctx.backlog_domain, ctx.api_key)
|
|
18
|
-
current_user_id = current_user["id"]
|
|
19
|
-
|
|
20
|
-
# Get issues assigned to current user
|
|
21
|
-
issue_list = await get_user_task(
|
|
22
|
-
backlog_domain=ctx.backlog_domain,
|
|
23
|
-
api_key=ctx.api_key,
|
|
24
|
-
assignee_ids=[current_user_id]
|
|
25
|
-
)
|
|
26
|
-
return issue_list
|
|
27
|
-
except Exception as e:
|
|
28
|
-
raise e
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|