Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

troubleshoot-mcp-connectiontroubleshoot MCP connection 搜索

Agent Skill

troubleshoot-mcp-connection 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

367

周安装

15

GitHub Stars

12

下载量

118
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:troubleshoot-mcp-connection(troubleshoot MCP connection 搜索)
来源仓库:https://github.com/pjt222/development-guides
仓库路径:skills/troubleshoot-mcp-connection
安装命令:
npx skills add https://github.com/pjt222/development-guides --skill troubleshoot-mcp-connection
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pjt222/development-guides --skill troubleshoot-mcp-connection

简介

Troubleshoot MCP connection 搜索技能用于查找、检索和筛选相关信息。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词或任务场景定位信息的任务。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 该技能归类于研究检索类别,适合连接配置和技术问题排查场景。

SKILL.md

Troubleshoot MCP Connection

Diagnose and resolve MCP server connection failures.

When to Use

  • Claude Code or Claude Desktop fails to connect to an MCP server
  • MCP tools don't appear in sessions
  • "Cannot attach the server" errors
  • Connection was working but stopped
  • Setting up MCP on a new machine

Inputs

  • Required: Error message or symptom description
  • Required: Which client (Claude Code, Claude Desktop, or both)
  • Required: Which MCP server (mcptools, Hugging Face, custom)
  • Optional: Recent changes to configuration or environment

Procedure

Step 1: Identify the Client and Configuration

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.

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()"

If this fails:

  • Check R path exists: ls "/mnt/c/Program Files/R/"
  • Check mcptools is installed: Rscript -e "library(mcptools)"
  • Check ellmer dependency: 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.

Step 3: Diagnose Common Error Patterns

"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"

  • Server isn't running or port is wrong
  • Firewall blocking the connection
  • Wrong transport type (stdio vs HTTP)

"Command not found"

  • Missing full path to executable
  • PATH not configured in the execution context
  • On Windows: use C:\\PROGRA~1\\... for paths with spaces

MCP tools don't appear but no error

  • Server starts but tools aren't registered
  • Check server stdout for initialization messages
  • Verify the server uses the correct MCP protocol version

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.

Step 4: Check Network and Authentication

# 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.

Step 5: Verify JSON Configuration Syntax

# 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.

Step 6: Platform-Specific Debugging

Windows (Claude Desktop):

  • Argument parsing differs from Unix
  • Spaces in paths break command execution
  • Use 8.3 short paths: C:\PROGRA~1\R\R-45~1.0\bin\x64\Rscript.exe
  • Environment variables work more reliably than command-line headers

WSL (Claude Code):

  • Unix-style quoting works correctly
  • Can use full paths with spaces (quoted)
  • npm/npx via NVM: ensure NVM is loaded in the execution context

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.

Step 7: Reset and Reconfigure

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.

Step 8: Check Logs

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.

Validation

  • Server starts independently without errors
  • Configuration JSON is valid
  • Client connects successfully
  • MCP tools appear in the session
  • Tools execute correctly when called
  • Connection persists across multiple requests

Common Pitfalls

  • Editing the wrong config file: Claude Code (~/.claude.json) vs Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json)
  • Not restarting after config changes: Claude Desktop requires restart; Claude Code picks up changes on new session
  • npx in restricted environments: npx downloads packages at runtime. If network or permissions are restricted, install globally.
  • Token expiration: Hugging Face tokens can expire. Regenerate if auth failures appear suddenly.
  • Version mismatches: MCP protocol versions must be compatible between client and server

Related Skills

  • configure-mcp-server - initial MCP setup
  • build-custom-mcp-server - custom server debugging context
  • setup-wsl-dev-environment - WSL prerequisite setup

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.16%
按下载量换算40

Claude

28.37%
按下载量换算33

Cursor

19.41%
按下载量换算23

Gemini CLI

8.83%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills