/agent-almanac:troubleshoot-mcp-connectionfrom agent-almanac
Diagnoses MCP server connection issues between Claude Code and Claude Desktop, including Windows argument parsing, authentication failures, transport issues, and platform-specific debugging.
Ships in agent-almanac. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Diagnose and resolve MCP server connection failures.
Claude Code (WSL):
# View MCP configuration
claude mcp list
claude mcp get server-name
# Configuration stored in
cat ~/.claude.json | python3 -m json.tool
Claude Desktop (Windows):
# Configuration file location
cat "/mnt/c/Users/$USER/AppData/Roaming/Claude/claude_desktop_config.json"
Expected: Configuration file is located and readable, showing the MCP server entries with command, args, and env fields.
On failure: If the config file does not exist or is empty, the server was never configured. Follow the configure-mcp-server skill to set it up from scratch.
R mcptools:
# Test if R can start the server
"/mnt/c/Program Files/R/R-4.5.0/bin/Rscript.exe" -e "mcptools::mcp_server()"
If this fails:
ls "/mnt/c/Program Files/R/"Rscript -e "library(mcptools)"Rscript -e "library(ellmer)"Hugging Face MCP:
# Test mcp-remote directly
mcp-remote https://huggingface.co/mcp
# Check if mcp-remote is installed
which mcp-remote
npm list -g mcp-remote
Expected: The server process starts and produces initialization output (JSON-RPC handshake or "listening" message) without errors.
On failure: If R mcptools fails, check that the R version path is correct and that mcptools is installed in the R library. If mcp-remote fails, reinstall globally with npm install -g mcp-remote and verify it is on the PATH.
"Cannot attach the server" (Claude Desktop)
Root cause: Windows command argument parsing.
Fix: Use environment variables instead of --header arguments:
{
"hf-mcp-server": {
"command": "mcp-remote",
"args": ["https://huggingface.co/mcp"],
"env": { "HF_TOKEN": "your_token" }
}
}
Also ensure mcp-remote is globally installed (npm install -g mcp-remote), not relying on npx.
"Connection refused"
"Command not found"
C:\\PROGRA~1\\... for paths with spacesMCP tools don't appear but no error
Expected: Error pattern matched to one of the documented categories (cannot attach, connection refused, command not found, or silent failure).
On failure: If the error does not match any known pattern, capture the full error output and check server-side logs. Search for the exact error message in the MCP server's GitHub issues.
# Test Hugging Face API connectivity
curl -I "https://huggingface.co/mcp"
# Verify token validity
curl -H "Authorization: Bearer $HF_TOKEN" https://huggingface.co/api/whoami
Expected: HTTP endpoint returns 200 status and the whoami call returns your Hugging Face username, confirming network connectivity and valid authentication.
On failure: If curl returns a connection error, check DNS resolution and proxy settings. If the token is rejected (401), regenerate the token at huggingface.co/settings/tokens and update the configuration.
# Validate JSON (common issue: trailing commas, missing quotes)
python3 -m json.tool /path/to/config.json
Expected: JSON parses without errors, confirming the configuration file has valid syntax.
On failure: The most common JSON issues are trailing commas after the last entry in an object or array, missing quotes around string values, and mismatched braces. Fix the syntax error reported by the parser and re-validate.
Windows (Claude Desktop):
C:\PROGRA~1\R\R-45~1.0\bin\x64\Rscript.exeWSL (Claude Code):
Expected: Platform-specific issue identified (e.g., Windows argument parsing, WSL path resolution, or NVM context loading).
On failure: If the issue is Windows-specific, switch from command-line arguments to environment variables for authentication. If WSL-specific, verify that the Windows executable path is accessible from WSL using the full /mnt/c/... path.
If all else fails:
# Remove and re-add the server (Claude Code)
claude mcp remove server-name
claude mcp add server-name stdio "/full/path/to/executable" -- args
# Restart Claude Desktop after config changes
# (close and reopen the application)
Expected: After removing and re-adding the server, claude mcp list shows the server with the correct configuration and a fresh connection attempt succeeds.
On failure: If re-adding fails, check that the executable path is correct and the command works when run directly in the terminal. For Claude Desktop, ensure the application is fully closed (check system tray) before restarting.
Claude Code: Look for MCP errors in the terminal output when starting a session.
Claude Desktop: Check application logs (location varies by OS).
Server-side: Add logging to the MCP server to capture incoming requests and errors.
Expected: Log entries reveal the specific point of failure (server startup, handshake, authentication, or tool registration).
On failure: If no logs are available, add stderr capture to the server command (e.g., redirect to a log file) and reproduce the failure. For Claude Desktop, check %APPDATA%\Claude\logs\ for application-level logs.
~/.claude.json) vs Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json)configure-mcp-server - initial MCP setupbuild-custom-mcp-server - custom server debugging contextsetup-wsl-dev-environment - WSL prerequisite setupWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mcp-connection, troubleshooting, debugging, windows, mcp-setup
Generated from the plugin's indexed repository (pjt222/agent-almanac) — no native marketplace selected
npx claudepluginhub p/pjt222-agent-almanac377 skills in this plugin
/adapt-architectureExecute structural metamorphosis using strangler fig migration, chrysalis phases, and interface preservation. Covers transformation planning, parallel running, progressive cutover, rollback design, and post-metamorphosis stabilization for system architecture evolution. Use when assess-form has classified the system as READY for transformation, when migrating from monolith to microservices, when replacing a core subsystem while dependents continue operating, or when any architectural change must be gradual rather than big-bang.
/adapticMaster skill composing the 5-step synoptic cycle for panoramic synthesis across multiple domains. Orchestrates meditate, expand-awareness, observe, awareness, integrate-gestalt, and express-insight into a coherent process that produces unified understanding rather than sequential compromise. Use when a problem genuinely spans 3+ domains and the interactions between domains matter more than depth in any one, when sequential analysis feels like compromise rather than integration, or before major architectural decisions affecting multiple stakeholders.
/add-puzzle-typeScaffold a new puzzle type across all 10+ pipeline integration points in jigsawR. Creates the core puzzle module, wires it into the unified pipeline (generation, positioning, rendering, adjacency), adds ggpuzzle geom/stat layers, updates DESCRIPTION and config.yml, extends the Shiny app, and creates a comprehensive test suite. Use when adding a completely new puzzle type to the package or following the 10-point integration checklist to ensure nothing is missed end-to-end.
Other plugins' skills for the same job