brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
troubleshoot-mcp-connectionDiagnose and fix MCP server connection issues between Claude Code, Claude Desktop, and MCP servers. Covers Windows argument parsing, authentication failures, transport issues, and platform-specific debugging. Use when Claude Code or Claude Desktop fails to connect to an MCP server, when MCP tools don't appear in sessions, on "cannot attach the server" error…
Independent GitHub snapshot · Automated classification · Original documentation governs
診而解 MCP 之連敗。
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"
得:設之文已得而可讀,其中 MCP 之服列以 command、args、env 之屬。
敗則:若設文不存或為空,則服未嘗設也。依 configure-mcp-server 之術自始而設之。
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()"
若敗:
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
得:服之程已起,出其初之辭(JSON-RPC 之握手或「listening」之言),無訛。
敗則:R mcptools 敗,驗 R 之徑與 mcptools 是否裝於 R 之庫。mcp-remote 敗,以 npm install -g mcp-remote 全裝再驗其在 PATH。
「Cannot attach the server」(Claude Desktop)
其本:Windows 之命參析。
修:用環之變代 --header 之參:
{
"hf-mcp-server": {
"command": "mcp-remote",
"args": ["https://huggingface.co/mcp"],
"env": { "HF_TOKEN": "your_token" }
}
}
並驗 mcp-remote 已全裝(npm install -g mcp-remote),勿賴 npx。
「Connection refused」
「Command not found」
C:\\PROGRA~1\\...MCP 之具不現而無訛
得:訛之相已歸於一類(cannot attach、connection refused、command not found、或默敗)。
敗則:訛不歸任一已知之類者,捕其全出,察服側之記。於 MCP 服之 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
得:HTTP 端返 200,whoami 返其 Hugging Face 之名,網通而證有效。
敗則:curl 報連訛者,察 DNS 之解與代之設。憑被拒(401)者,於 huggingface.co/settings/tokens 再生而更其設。
# Validate JSON (common issue: trailing commas, missing quotes)
python3 -m json.tool /path/to/config.json
得:JSON 解之無訛,設之文法正。
敗則:JSON 之最常之訛者,物或列之末尾餘逗、字串少引、括不對。修析者所報之訛而再驗。
Windows(Claude Desktop):
C:\PROGRA~1\R\R-45~1.0\bin\x64\Rscript.exeWSL(Claude Code):
得:平臺之疾已辨(如 Windows 之參析、WSL 之徑解、或 NVM 境之載)。
敗則:疾屬 Windows 者,以環之變代命首之參為證。屬 WSL 者,驗 Windows 之執自 WSL 以全 /mnt/c/... 之徑可達。
若皆敗:
# 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)
得:去而再加之後,claude mcp list 示其服之設正,新試之連得。
敗則:再加而敗者,驗執之徑正、命於端中直行而通。Claude Desktop 者,驗其全閉(察系統托盤)而後再啟。
Claude Code:察起會時端之輸出有 MCP 之訛否。
Claude Desktop:察應之記(其位依 OS 而異)。
服側:增記於 MCP 之服以捕來請與訛。
得:記之條揭敗之精處(服起、握手、證、具錄)。
敗則:無記可得者,加 stderr 之捕於服之命(如導入記文)而復其敗。Claude Desktop 者,察 %APPDATA%\Claude\logs\ 之應級記。
~/.claude.json)異於 Claude Desktop(%APPDATA%\Claude\claude_desktop_config.json)configure-mcp-server — MCP 之初設build-custom-mcp-server — 自製服之診之境setup-wsl-dev-environment — WSL 之先設