troubleshoot-mcp-connection
정보
이 스킬은 Claude Code, Claude Desktop 및 MCP 서버 간의 MCP 서버 연결 문제를 진단하고 해결합니다. Windows 인수 파싱, 인증 실패, 전송 문제 및 플랫폼별 디버깅을 다룹니다. MCP 도구가 표시되지 않거나 "서버를 연결할 수 없음" 오류가 발생하거나, 이전에 작동하던 연결이 중단된 경우 사용하세요.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/troubleshoot-mcp-connectionClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Troubleshoot MCP Connection
Diag + resolve MCP server connection failures.
Use When
- Claude Code|Desktop fails to connect to MCP server
- MCP tools don't appear in sess
- "Cannot attach the server" err
- Connection worked → stopped
- Setting up MCP on new machine
In
- Required: Err msg|symptom
- Required: Client (Claude Code, Desktop, both)
- Required: MCP server (mcptools, HF, custom)
- Optional: Recent config|env changes
Do
Step 1: ID Client + Config
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"
Got: Config file located + readable, MCP server entries w/ command, args, env.
If err: Config doesn't exist|empty → never configured. Follow configure-mcp-server from scratch.
Step 2: Test Server Independently
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()"
Fails:
- R path:
ls "/mnt/c/Program Files/R/" - mcptools installed:
Rscript -e "library(mcptools)" - ellmer dep:
Rscript -e "library(ellmer)"
HF 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
Got: Server proc starts + init out (JSON-RPC handshake or "listening") no errs.
If err: R mcptools fails → check R ver path correct + mcptools in R lib. mcp-remote fails → reinstall global npm install -g mcp-remote + verify on PATH.
Step 3: Diag Common Err Patterns
"Cannot attach the server" (Claude Desktop)
Root: Windows cmd arg parsing.
Fix: env vars instead of --header:
{
"hf-mcp-server": {
"command": "mcp-remote",
"args": ["https://huggingface.co/mcp"],
"env": { "HF_TOKEN": "your_token" }
}
}
Also ensure mcp-remote global (npm install -g mcp-remote), not relying on npx.
"Connection refused"
- Server not running|wrong port
- Firewall blocking
- Wrong transport (stdio vs HTTP)
"Command not found"
- Missing full path to exec
- PATH not configured in exec ctx
- Windows:
C:\\PROGRA~1\\...for paths w/ spaces
MCP tools missing, no err
- Server starts, tools not registered
- Check server stdout for init msgs
- Verify correct MCP protocol ver
Got: Err pattern matched to documented category (cannot attach, conn refused, cmd not found, silent fail).
If err: No match → capture full err out + check server logs. Search exact err in MCP server's GitHub issues.
Step 4: Network + Auth
# 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
Got: HTTP returns 200, whoami returns HF username → confirms net + auth.
If err: curl conn err → DNS|proxy. Token rejected (401) → regen at huggingface.co/settings/tokens + update config.
Step 5: Verify JSON Syntax
# Validate JSON (common issue: trailing commas, missing quotes)
python3 -m json.tool /path/to/config.json
Got: JSON parses no errs → valid syntax.
If err: Common: trailing commas after last entry, missing quotes around strings, mismatched braces. Fix syntax err per parser + re-validate.
Step 6: Platform-Specific Debug
Windows (Claude Desktop):
- Arg parsing differs from Unix
- Spaces in paths break exec
- 8.3 short paths:
C:\PROGRA~1\R\R-45~1.0\bin\x64\Rscript.exe - env vars > cmd-line headers
WSL (Claude Code):
- Unix quoting works
- Full paths w/ spaces (quoted)
- npm/npx via NVM → ensure NVM loaded in exec ctx
Got: Platform-specific issue ID'd (Windows arg parsing, WSL path resolve, NVM ctx).
If err: Windows-specific → switch cmd-line args → env vars for auth. WSL-specific → verify Windows exec path accessible from WSL via full /mnt/c/....
Step 7: Reset + Reconfigure
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)
Got: After remove + re-add, claude mcp list shows correct config + fresh conn succeeds.
If err: Re-add fails → check exec path correct + cmd works direct in terminal. Claude Desktop → ensure fully closed (system tray) before restart.
Step 8: Logs
Claude Code: MCP errs in terminal out at sess start.
Claude Desktop: App logs (location varies by OS).
Server-side: Add logging → capture incoming reqs + errs.
Got: Logs reveal specific point of fail (server start, handshake, auth, tool reg).
If err: No logs → add stderr capture to server cmd (redirect to log file) + reproduce. Claude Desktop → %APPDATA%\Claude\logs\ for app logs.
Check
- Server starts independently no errs
- Config JSON valid
- Client connects success
- MCP tools appear in sess
- Tools exec when called
- Conn persists across reqs
Traps
- Wrong config file: Claude Code (
~/.claude.json) vs Desktop (%APPDATA%\Claude\claude_desktop_config.json) - No restart after config: Desktop needs restart; Code picks up on new sess
- npx in restricted env: npx downloads at runtime. Net|perms restricted → install global.
- Token expiration: HF tokens expire. Regen if auth fails suddenly.
- Version mismatch: MCP protocol vers must be compat between client + server
→
configure-mcp-server— initial MCP setupbuild-custom-mcp-server— custom server debug ctxsetup-wsl-dev-environment— WSL prereq setup
GitHub 저장소
연관 스킬
evaluating-llms-harness
테스팅이 Claude Skill은 MMLU, GSM8K를 포함한 60개 이상의 표준화된 학술 과제에서 LLM 성능을 벤치마크하기 위해 lm-evaluation-harness를 실행합니다. 개발자들이 모델 품질을 비교하고, 학습 진행 상황을 추적하거나 학술 결과를 보고할 수 있도록 설계되었습니다. 이 도구는 HuggingFace와 vLLM 모델을 포함한 다양한 백엔드를 지원합니다.
cloudflare-cron-triggers
테스팅이 스킬은 cron 표현식을 사용하여 Worker를 스케줄링하기 위한 Cloudflare Cron Triggers 구현에 관한 포괄적인 지식을 제공합니다. 주기적 작업, 유지보수 작업, 자동화된 워크플로우 설정 방법을 다루며, 잘못된 cron 표현식이나 시간대 문제 같은 일반적인 이슈들을 해결하는 방법을 포함합니다. 개발자들은 이를 통해 스케줄된 핸들러 구성, cron 트리거 테스트, Workflows 및 Green Compute와의 연동 작업을 수행할 수 있습니다.
webapp-testing
테스팅이 Claude Skill은 Python 스크립트를 통해 로컬 웹 애플리케이션을 테스트하기 위한 Playwright 기반 툴킷을 제공합니다. 프론트엔드 검증, UI 디버깅, 스크린샷 캡처, 로그 확인 기능을 지원하며 서버 라이프사이클을 관리합니다. 브라우저 자동화 작업에 사용하되 컨텍스트 오염을 방지하기 위해 소스 코드를 읽지 않고 스크립트를 직접 실행하세요.
finishing-a-development-branch
테스팅이 스킬은 테스트 통과를 확인한 후 체계적인 통합 옵션을 제시하여 개발자가 완성된 작업을 마무리하도록 돕습니다. 구현이 완료된 후 머지, PR 생성, 브랜치 정리와 같은 워크플로우를 안내합니다. 코드가 준비되고 테스트가 완료되었을 때 개발 프로세스를 체계적으로 마무리하기 위해 사용하세요.
