.claude/skills/mcp-problems/SKILL.md
Diagnóstico y solución de problemas de MCP servers en Claude Desktop. Usar cuando los servidores MCP muestran "Server disconnected", fallan al conectar, o tienen problemas de handshake. Cubre servidores Python (MySQL, SQL Server, PostgreSQL) y Node.js en Windows/macOS/Linux.
npx skillsauth add rhayalcantara/evaluacionesempleadosdocker mcp-troubleshootingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guía para diagnosticar y solucionar problemas de conexión de servidores MCP en Claude Desktop.
Server disconnected → Revisar logs de Claude Desktop → Identificar causa → Aplicar solución
# Log del servidor específico
Get-Content "$env:APPDATA\Claude\logs\mcp-server-<nombre>.log" -Tail 50
# Log general de MCP
Get-Content "$env:APPDATA\Claude\logs\mcp.log" -Tail 50
# Log del servidor (si tiene logging propio)
Get-Content "C:\path\to\server\server.log" -Tail 20
# Logs de Claude Desktop
tail -50 ~/Library/Logs/Claude/mcp-server-<nombre>.log # macOS
tail -50 ~/.config/Claude/logs/mcp-server-<nombre>.log # Linux
| Log muestra | Causa | Solución |
|-------------|-------|----------|
| ModuleNotFoundError: No module named 'X' | Dependencia faltante | Ver Problema 1 |
| Solo "Conexión inicial exitosa", sin initialize | Claude no envía handshake | Ver Problema 2 |
| Handshake completo → EOF inmediato | Respuesta inválida a notificaciones | Ver Problema 3 |
| Server transport closed unexpectedly | Proceso termina prematuramente | Ver Problema 4 |
Síntoma: ModuleNotFoundError: No module named 'mysql'
Causa: Claude Desktop usa un Python diferente al de tu terminal.
Solución A - Ruta absoluta en config:
{
"mcpServers": {
"mi-servidor": {
"command": "C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python311\\python.exe",
"args": ["C:\\path\\to\\server.py"],
"cwd": "C:\\path\\to"
}
}
}
Solución B - Instalar en el Python correcto:
# Windows
& "C:\Users\USER\AppData\Local\Programs\Python\Python311\python.exe" -m pip install <modulo>
# macOS/Linux
/usr/local/bin/python3 -m pip install <modulo>
Módulos comunes:
mysql-connector-pythonpyodbcpsycopg2-binarypython-dotenvSíntoma: Log muestra "Conexión exitosa" pero nunca recibe initialize.
Causa: Output no-JSON en stdout antes del handshake.
Verificar: Buscar print() statements que escriban a stdout:
# ❌ MALO - rompe el protocolo MCP
print("Servidor iniciado")
# ✅ CORRECTO - usar stderr
import sys
print("Servidor iniciado", file=sys.stderr)
Solución: Todo logging debe ir a stderr o archivo, nunca stdout.
Síntoma: Log muestra secuencia completa (initialize → tools/list) pero termina con EOF inmediato.
Causa: El servidor envía null para notificaciones (que no requieren respuesta).
Verificar en el código del servidor:
# ❌ MALO - envía "null" a stdout
response_str = json.dumps(response)
print(response_str)
# ✅ CORRECTO - no responder a notificaciones
if response is not None:
response_str = json.dumps(response)
print(response_str)
sys.stdout.flush()
Métodos que NO deben enviar respuesta:
notifications/initializednotifications/cancellednotifications/Síntoma: Server transport closed unexpectedly
Causas comunes:
Métodos MCP requeridos:
# Handlers mínimos que el servidor debe implementar:
"initialize" # Requerido
"notifications/initialized" # Requerido (no responder)
"tools/list" # Requerido
"resources/list" # Recomendado (responder con lista vacía)
"resources/templates/list" # Recomendado (responder con lista vacía)
Respuesta para recursos no implementados:
if method == "resources/list":
return {"jsonrpc": "2.0", "id": msg_id, "result": {"resources": []}}
if method == "resources/templates/list":
return {"jsonrpc": "2.0", "id": msg_id, "result": {"resourceTemplates": []}}
Después de aplicar cambios:
✅ Server started and connected successfully
✅ Manejando solicitud: initialize
✅ Manejando solicitud: notifications/initialized
✅ Manejando solicitud: tools/list
✅ (servidor permanece corriendo, sin EOF)
Para verificar que el servidor funciona independientemente de Claude Desktop:
cd C:\path\to\server
python server.py
Luego enviar manualmente:
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}
Si responde con JSON válido, el servidor funciona correctamente.
Ver references/config-examples.md para ejemplos completos de configuración.
print() a stdout (solo stderr o archivo)notifications/initialized (sin respuesta)resources/list (lista vacía OK)resources/templates/list (lista vacía OK)if response is not None antes de enviar respuestastools
Execute agentic coding tools directly via bash commands with output capture. Use this when the user requests to run AI agents (Gemini, Claude Code, etc.) and get their results directly.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------