Troubleshooting
Complete troubleshooting guide for common issues in the AI Coding Guidelines workflow.
Quick Diagnostics
System Check Commands
# List all installed servers
claude mcp list
# Check Node.js and npm
node --version && npm --version
# Verify UV installation
uv --version
# Test GitHub token
echo $NODE_AUTH_TOKEN | cut -c1-10 # Show first 10 charsEnvironment Validation
# Check essential environment variables
echo "NODE_AUTH_TOKEN: ${NODE_AUTH_TOKEN:+SET}"
echo "GITHUB_PERSONAL_ACCESS_TOKEN: ${GITHUB_PERSONAL_ACCESS_TOKEN:+SET}"
# Verify npm authentication
npm whoami --registry=https://npm.pkg.github.com
# Test network connectivity
ping -c 3 github.comMCP Server Issues
Server Installation Failures
Error: "command not found: npx"
Symptoms:
- Installation commands fail with "npx: command not found"
- MCP server setup scripts error out
Solutions:
Install Node.js from nodejs.org (version 18+ recommended)
Verify installation:
bashnode --version && npm --versionRestart terminal/shell session
Retry MCP server installation
Validation:
which npx # Should show path to npx
npx --version # Should show version numberError: "command not found: uvx"
Symptoms:
- UV-based server installations fail
- Git MCP server won't install
Solutions:
Install UV package manager:
bashcurl -LsSf https://astral.sh/uv/install.sh | shRestart terminal or source profile:
bashsource ~/.bashrc # or ~/.zshrcVerify installation:
bashuv --version which uvx
Error: "EACCES: permission denied"
Symptoms:
- Permission denied errors during npm operations
- Cannot write to npm directories
Solutions:
macOS/Linux:
# Fix npm permissions
sudo chown -R $(whoami) ~/.npm
# Or use npm's built-in fix
npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrcWindows:
- Run Command Prompt or PowerShell as Administrator
- Install Node.js with administrator privileges
Validation:
npm config get prefix # Should show user-writable directory
npm install -g npm@latest # Should work without sudoError: "Server failed to start"
Symptoms:
- MCP server shows as installed but won't start
- Claude Code can't connect to server
- Server logs show startup errors
Diagnostic Steps:
# Check server logs
claude mcp logs server-name
# Verify server configuration
claude mcp list
# Check system resources
top # or Activity Monitor on macOSSolutions:
Check Node.js version compatibility:
bashnode --version # Should be 18+Restart Claude Code session:
- Close and reopen Claude Code
- Clear session cache if available
Reinstall problematic server:
bashclaude mcp remove server-name # Reinstall with appropriate commandCheck port conflicts:
bash# Check if ports are in use lsof -i :3000 # or other relevant portsVerify system resources:
- Ensure sufficient RAM (2GB+ recommended)
- Check disk space
- Close unnecessary applications
Authentication Issues
GitHub Token Problems
Error: "401 Unauthorized" or "403 Forbidden"
Diagnostic:
# Test token validity
curl -H "Authorization: token $NODE_AUTH_TOKEN" \
https://api.github.com/user
# Check token scopes
curl -H "Authorization: token $NODE_AUTH_TOKEN" \
-I https://api.github.com/user | grep -i x-oauth-scopesSolutions:
Verify token exists:
bashecho $NODE_AUTH_TOKEN # Should show tokenCheck token scopes:
- Go to GitHub Settings > Developer settings > Personal access tokens
- Ensure token has
read:packagesscope - For GitHub MCP server, also need
reposcope
Regenerate token:
bash# Generate new token at github.com/settings/tokens export NODE_AUTH_TOKEN=new_token_here # Update shell profile for persistenceUpdate MCP server configuration:
bashclaude mcp remove developer-tools claude mcp add-json developer-tools '{ "command": "npx", "args": ["-y", "@agronod/developer-tools-mcp@latest"], "env": { "NODE_AUTH_TOKEN": "'$NODE_AUTH_TOKEN'" } }' -s user
NPM Authentication Issues
Error: "Unable to authenticate" or "E404: Not found"
Diagnostic:
# Check npm authentication
npm whoami --registry=https://npm.pkg.github.com
# Test package access
npm view @agronod/developer-tools-mcp --registry=https://npm.pkg.github.comSolutions:
Configure npm authentication:
bashnpm login --scope=@agronod --registry=https://npm.pkg.github.com # Use your GitHub username and NODE_AUTH_TOKEN as passwordSet registry configuration:
bashnpm config set @agronod:registry https://npm.pkg.github.comVerify authentication:
bashnpm config get //npm.pkg.github.com/:_authToken # Should show your token
Performance Issues
Slow Server Response
Symptoms:
- Commands take long time to execute
- Timeouts during operations
- High CPU/memory usage
Diagnostic:
# Monitor system resources
top
htop # if installed
# Check Claude MCP process usage
ps aux | grep mcp
# Monitor network activity
netstat -an | grep ESTABLISHEDSolutions:
Reduce concurrent servers:
bash# Remove unused servers claude mcp remove unused-server-nameRestart specific servers:
bashclaude mcp remove server-name # Reinstall serverSystem optimization:
- Close unnecessary applications
- Ensure sufficient RAM (4GB+ recommended)
- Check available disk space
Network optimization:
- Use wired connection if possible
- Check firewall settings
- Verify corporate proxy configuration
Network Connectivity Issues
Symptoms:
- Servers fail to connect to external services
- Package installation timeouts
- API calls fail
Diagnostic:
# Test basic connectivity
ping github.com
ping npmjs.org
# Test HTTPS connectivity
curl -I https://api.github.com
# Check DNS resolution
nslookup github.comSolutions:
Firewall configuration:
bash# Check firewall status (macOS) sudo pfctl -s all # Check firewall status (Linux) sudo ufw statusCorporate proxy setup:
bash# Set npm proxy npm config set proxy http://proxy.company.com:8080 npm config set https-proxy https://proxy.company.com:8080 # Set system proxy in environment export HTTP_PROXY=http://proxy.company.com:8080 export HTTPS_PROXY=https://proxy.company.com:8080DNS configuration:
bash# Use alternative DNS (Google) echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
Tool-Specific Issues
Git Operations
Error: "Not a git repository"
Solutions:
# Initialize git repository
git init
# Verify git status
git statusError: "Unable to create commit"
Diagnostic:
# Check git configuration
git config --list | grep user
# Check working directory status
git statusSolutions:
# Configure git user
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
# Stage changes
git add .
# Create commit
git commit -m "Initial commit"Specification Generation
Low Confidence Warnings
Symptoms:
- Tools report confidence < 0.7
- Interactive mode triggered unexpectedly
- Incomplete specifications generated
Solutions:
Load project context:
bash/context-prime "your specific task"Create requirements document:
bash/project-prp "feature name" # Fill out comprehensive requirementsUpdate project documentation:
bash/project-update --focus architectureUse project guidance:
bash/project-next --verbose
File Operations
Error: "Permission denied" on file operations
Solutions:
# Check file permissions
ls -la filename
# Fix permissions
chmod 644 filename # for files
chmod 755 directory # for directories
# Check directory ownership
sudo chown -R $(whoami) directoryEnvironment-Specific Issues
macOS Issues
Code signing issues with MCP servers
Solutions:
# Allow unsigned code execution
sudo spctl --master-disable
# Or allow specific applications
sudo spctl --add /path/to/mcp/serverHomebrew conflicts
Solutions:
# Update Homebrew
brew update && brew upgrade
# Check for conflicts
brew doctor
# Reinstall Node.js via Homebrew
brew reinstall nodeWindows Issues
PowerShell execution policy
Error: "Execution of scripts is disabled on this system"
Solutions:
# Set execution policy (run as Administrator)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Verify policy
Get-ExecutionPolicy -ListWindows Defender interference
Solutions:
Add exclusions for:
- Node.js installation directory
- npm global directory
- Project directories
Temporarily disable real-time protection during setup
Linux Issues
Missing development tools
Solutions:
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install build-essential curl git
# CentOS/RHEL
sudo yum groupinstall "Development Tools"
sudo yum install curl git
# Arch Linux
sudo pacman -S base-devel curl gitRecovery Procedures
Complete MCP Reset
When all else fails, completely reset MCP configuration:
# Stop Claude Code
# Remove all MCP servers
claude mcp list | grep -v "No servers" | xargs -I {} claude mcp remove {}
# Clear MCP configuration (backup first)
cp ~/.claude/mcp.json ~/.claude/mcp.json.backup
rm ~/.claude/mcp.json
# Restart Claude Code and run setup
# Run quick-setup.sh from project rootEnvironment Reset
# Reset npm configuration
rm ~/.npmrc
# Clear npm cache
npm cache clean --force
# Reset Node.js (via package manager)
# macOS with Homebrew:
brew uninstall node && brew install node
# Ubuntu/Debian:
sudo apt-get remove nodejs npm && sudo apt-get install nodejs npmProject Reset
# Reset to clean git state (WARNING: loses uncommitted changes)
git clean -fd
git reset --hard HEAD
# Reinitialize project
/project-init --force
# Load context and continue
/context-primeGetting Help
Log Collection
When reporting issues, collect relevant logs:
# System information
uname -a
node --version
npm --version
claude --version
# MCP server logs
claude mcp logs server-name > server-logs.txt
# Environment variables (sanitized)
env | grep -E "(NODE_|GITHUB_|CLAUDE_)" | sed 's/=.*/=***/' > env-vars.txt
# Git status (if relevant)
git status > git-status.txt
git log --oneline -10 > recent-commits.txtDebug Mode
Enable verbose logging:
# Set debug environment variables
export DEBUG=*
export VERBOSE=true
# Run commands with additional logging
/command-name --verboseNext Steps
- Opinionated Workflow - Return to productive development
- MCP Servers - Explore additional server options
- Report Issues - Get help from the community