forked from Rockachopa/Timmy-time-dashboard
fix: correct MCP tool names, timeout kwarg, and make mcp a core dep
- Fix tool names to match gitea-mcp server: issue_write, issue_read, list_issues, pull_request_write, etc. (old names didn't exist) - Fix timeout → timeout_seconds (MCPTools API) - Move mcp from optional to core dependency (required for agent) - Add PR tools (pull_request_write/read, list_pull_requests) - Fix create_gitea_issue_via_mcp to use issue_write with method="create" - Update tool_safety.py and tests for corrected names - Regenerate poetry.lock Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,12 +57,16 @@ def create_gitea_mcp_tools():
|
||||
"GITEA_HOST": settings.gitea_url,
|
||||
},
|
||||
include_tools=[
|
||||
"create_issue",
|
||||
"list_repo_issues",
|
||||
"create_issue_comment",
|
||||
"edit_issue",
|
||||
"issue_write",
|
||||
"issue_read",
|
||||
"list_issues",
|
||||
"pull_request_write",
|
||||
"pull_request_read",
|
||||
"list_pull_requests",
|
||||
"list_branches",
|
||||
"list_commits",
|
||||
],
|
||||
timeout=settings.mcp_timeout,
|
||||
timeout_seconds=settings.mcp_timeout,
|
||||
)
|
||||
logger.info("Gitea MCP tools created (lazy connect)")
|
||||
return tools
|
||||
@@ -92,7 +96,7 @@ def create_filesystem_mcp_tools():
|
||||
"get_file_info",
|
||||
"directory_tree",
|
||||
],
|
||||
timeout=settings.mcp_timeout,
|
||||
timeout_seconds=settings.mcp_timeout,
|
||||
)
|
||||
logger.info("Filesystem MCP tools created (lazy connect)")
|
||||
return tools
|
||||
@@ -170,7 +174,7 @@ async def create_gitea_issue_via_mcp(title: str, body: str = "", labels: str = "
|
||||
"GITEA_ACCESS_TOKEN": settings.gitea_token,
|
||||
"GITEA_HOST": settings.gitea_url,
|
||||
},
|
||||
timeout=settings.mcp_timeout,
|
||||
timeout_seconds=settings.mcp_timeout,
|
||||
)
|
||||
|
||||
# Ensure connected
|
||||
@@ -187,8 +191,9 @@ async def create_gitea_issue_via_mcp(title: str, body: str = "", labels: str = "
|
||||
# Parse owner/repo from settings
|
||||
owner, repo = settings.gitea_repo.split("/", 1)
|
||||
|
||||
# Build tool arguments
|
||||
# Build tool arguments — gitea-mcp uses issue_write with method="create"
|
||||
args = {
|
||||
"method": "create",
|
||||
"owner": owner,
|
||||
"repo": repo,
|
||||
"title": title,
|
||||
@@ -196,7 +201,7 @@ async def create_gitea_issue_via_mcp(title: str, body: str = "", labels: str = "
|
||||
}
|
||||
|
||||
# Call the MCP tool directly via the session
|
||||
result = await _issue_session.call_tool("create_issue", arguments=args)
|
||||
result = await _issue_session.call_tool("issue_write", arguments=args)
|
||||
|
||||
# Bridge to local work order
|
||||
label_list = [tag.strip() for tag in labels.split(",") if tag.strip()] if labels else []
|
||||
|
||||
Reference in New Issue
Block a user