We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MadnessEngineering/Omnispindle'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
fix_fastmcp_debug.shβ’2.19 KiB
#!/bin/bash
# Fix FastMCP ServerErrorMiddleware debug warnings
# Run this script after pip updates to reapply the debug=False hack
# Compatible with Ubuntu/Linux and macOS
echo "π§ Fixing FastMCP debug mode to suppress ServerErrorMiddleware warnings..."
# Try to find Python executable (try python3 first, then python)
PYTHON_CMD=""
if command -v python3 &> /dev/null; then
PYTHON_CMD="python3"
elif command -v python &> /dev/null; then
PYTHON_CMD="python"
else
echo "β No Python executable found. Install Python first."
exit 1
fi
echo "π Using Python: $PYTHON_CMD"
# Find FastMCP installation path
FASTMCP_PATH=$($PYTHON_CMD -c "import fastmcp; print(fastmcp.__file__)" 2>/dev/null | sed 's/__init__.py$//')
if [ -z "$FASTMCP_PATH" ]; then
echo "β FastMCP not found. Make sure it's installed."
echo " Try: pip install fastmcp"
exit 1
fi
echo "π FastMCP found at: $FASTMCP_PATH"
SERVER_FILE="${FASTMCP_PATH}server/server.py"
if [ ! -f "$SERVER_FILE" ]; then
echo "β FastMCP server.py not found at $SERVER_FILE"
exit 1
fi
# Create backup if it doesn't exist
if [ ! -f "${SERVER_FILE}.backup" ]; then
echo "π Creating backup of original server.py..."
cp "$SERVER_FILE" "${SERVER_FILE}.backup"
fi
# Check if hack is already applied
if grep -q "debug=False" "$SERVER_FILE"; then
echo "β FastMCP debug hack already applied!"
exit 0
fi
# Apply the hack (Linux-compatible sed syntax)
echo "π¨ Applying debug=False hack..."
# Detect OS for sed syntax
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/debug=self\.settings\.debug/debug=False/g' "$SERVER_FILE"
else
# Linux/Ubuntu
sed -i 's/debug=self\.settings\.debug/debug=False/g' "$SERVER_FILE"
fi
# Verify the change
if grep -q "debug=False" "$SERVER_FILE"; then
echo "β FastMCP debug hack applied successfully!"
echo "π ServerErrorMiddleware warnings should now be suppressed."
echo ""
echo "π Modified file: $SERVER_FILE"
echo ""
echo "To restore original behavior, run:"
echo "cp '${SERVER_FILE}.backup' '$SERVER_FILE'"
else
echo "β Failed to apply hack. Check the file manually."
echo "π Target file: $SERVER_FILE"
exit 1
fi