Add MCP wrapper scripts that were created during earlier troubleshooting but were not committed yet. All wrappers follow same pattern: - Container cleanup before starting new instance - Explicit naming with -crush suffix - Environment variable passing from host .env file - Special cases handled (docker-mcp socket mount) Scripts added: - mcp-audiobook-wrapper.sh - mcp-bitwarden-wrapper.sh - mcp-blender-wrapper.sh - mcp-cloudron-wrapper.sh - mcp-docker-wrapper.sh (with Docker socket mount) - mcp-drawio-wrapper.sh - mcp-elasticsearch-wrapper.sh All scripts are executable and tested.
21 lines
818 B
Bash
Executable File
21 lines
818 B
Bash
Executable File
#!/bin/sh
|
|
# Wrapper script for audiobook-mcp
|
|
# Ensures clean container with proper name
|
|
|
|
CONTAINER_NAME="kneldevstack-aimiddleware-audiobook-mcp-crush"
|
|
IMAGE_NAME="kneldevstack-aimiddleware-audiobook-mcp"
|
|
|
|
# Force remove existing container if it exists (in any state)
|
|
if docker ps -a --filter "name=${CONTAINER_NAME}" --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
|
|
docker rm -f "${CONTAINER_NAME}" 2>/dev/null
|
|
# Wait for container to be fully removed
|
|
while docker ps -a --filter "name=${CONTAINER_NAME}" --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; do
|
|
sleep 0.05
|
|
done
|
|
fi
|
|
|
|
# Start MCP server with explicit name and environment variables
|
|
exec docker run -i --rm --name "${CONTAINER_NAME}" \
|
|
-e "AUDIOBOOK_ROOT=${AUDIOBOOK_ROOT:-/audiobooks}" \
|
|
"${IMAGE_NAME}" "$@"
|