0.16 - adding search comments
CICD / Explore-Gitea-Actions (push) Successful in 51s Details

This commit is contained in:
Isaac Johnson 2025-10-13 07:03:46 -05:00
parent ab97ce1a0b
commit fccd340d66
3 changed files with 32 additions and 4 deletions

View File

@ -20,4 +20,4 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "main.py"]
#harbor.freshbrewed.science/library/vikunjamcp:0.15
#harbor.freshbrewed.science/library/vikunjamcp:0.16

View File

@ -1,6 +1,6 @@
{
"name": "vikunja",
"version": "1.0.15",
"version": "1.0.16",
"mcpServers": {
"nodeServer": {
"command": "docker",
@ -14,7 +14,7 @@
"VIKUNJA_USERNAME",
"-e",
"VIKUNJA_PASSWORD",
"harbor.freshbrewed.science/library/vikunjamcp:0.15"
"harbor.freshbrewed.science/library/vikunjamcp:0.16"
],
"env": {
"VIKUNJA_URL": "$VIKUNJA_URL",

28
main.py
View File

@ -187,7 +187,35 @@ def comment_task(task_id: int, description: str):
logger.exception("comment_task: request failed for task_id=%s", task_id)
return f"Error adding comment to task: {e}"
@mcp.tool()
def lookup_comment_task(task_id: int):
"""
Lists comments in a task in Vikunja.
:param task_id: The ID of the task of which to fetch comments.
"""
if "Authorization" not in session.headers:
return "Please run the 'login' command first."
try:
response = session.get(f"{VIKUNJA_URL}/api/v1/tasks/{task_id}/comments")
response.raise_for_status()
comments = response.json()
if not comments:
return "No comments found for this task."
result = []
for comment in comments:
comment_id = comment.get("id", "N/A")
comment_text = comment.get("comment", "N/A")
comment_created = comment.get("created", "N/A")
comment_author = comment.get("author", "N/A")
result.append(f"ID: {comment_id}, Created: {comment_created}, Author: {comment_author}, Comment: {comment_text}")
return "\n".join(result)
except requests.exceptions.RequestException as e:
logger.exception("lookup_comment_task: request failed for task_id=%s", task_id)
return f"Error looking up comments to task: {e}"
@mcp.tool()
def update_comment(task_id: int, comment_id: int, comment: str):