[Bug] Projman diagnostic failure: MCP tools require explicit repo format #70
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The projman Gitea MCP tools fail when called without an explicit
repoparameter, even when operating within a project that has Gitea configuration documented in CLAUDE.md.Failed Tests
Command:
/projman:labels-syncFirst Attempt (Failed):
Error Message:
Second Attempt (Success):
Expected Behavior
The MCP tools should either:
.projmanconfig file)Repository Context
personal-projects/personal-portfoliogitea.hotserv.cloudAdditional Observations
repoparameter is marked as optional in tool descriptions ("for PMO mode") but appears to be requiredSuggested Fix
Consider adding a configuration mechanism (environment variable, config file, or git remote detection) to set a default repository context for non-PMO workflows.
Labels: Type: Bug, Source: Internal
Fix Applied
Root Cause
The MCP server runs with
cwdset to the plugin directory (${CLAUDE_PLUGIN_ROOT}/mcp-servers/gitea), not the user's project directory. This caused:Path.cwd()to return the plugin directorygit remote get-url originto run in the wrong directorySolution
Added
_find_project_directory()method inconfig.pywith multiple detection strategies:.gitor.env)The git remote command now runs in the detected project directory.
Tests Added
test_find_project_directory_from_envtest_find_project_directory_from_cwdtest_find_project_directory_none_when_no_markersAll 9 config tests passing.
PRs
Workaround (if needed before update)
If the fix doesn't work in your environment, set
GITEA_REPOexplicitly in your project's.env: