[Bug] Projman diagnostic failure: MCP tools require explicit repo parameter #77
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
During
/projman:labels-syncexecution in thepersonal-projects/personal-portfoliorepository, MCP Gitea tools failed when called without an explicitrepoparameter, despite the repository context being available.Failed Tests
Tool calls without repo parameter:
Error Messages
Both tools returned:
Expected Behavior
MCP tools should automatically detect the repository context from:
personal-projects/personal-portfolioActual Behavior
Tools require explicit
repoparameter to function:Repository Context
personal-projects/personal-portfolio/home/lmiranda/Repositories/personal/personal-portfoliossh://git@hotserv.tailc9b278.ts.net:2222/personal-projects/personal-portfolio.gitpersonal-projects/personal-portfolioImpact
Suggested Fix
The MCP server should:
Labels:
Type: Bug,Source: InternalRoot Cause Analysis
The previous "fixes" (PRs #70, #71, #72) were incorrect. The MCP server cannot auto-detect the repository because:
cwdset to${CLAUDE_PLUGIN_ROOT}/mcp-servers/gitea(the plugin directory)_find_project_directory()code was wishful thinking - Claude Code doesn't setCLAUDE_PROJECT_DIRenv varPWDenv var is also the plugin directory, not the user's projectThe MCP server architecture fundamentally cannot know which project directory the user is in.
Correct Solution
The fix is in the command documentation, not the MCP server code.
The
labels-sync.mdnow explicitly instructs Claude to:git remote get-url originvia Bash (Claude CAN run bash in the user's project)owner/reporepoparameter to ALL MCP tool callsThis is the architecturally correct solution: Claude (the agent) detects the repo, then passes it to MCP tools.
Changes Made
Completely rewrote
plugins/projman/commands/labels-sync.md:repoparameterCommit:
69b71fc