testsAndMisc/linux_configuration/scripts/blender-mcp-serve
Krzysztof kuhy Rudnicki 2a788b741d Repoint MCP paths; parallelise mutation gate
The mutation hook alone took 51 s, so no commit touching the
session_autopsy test could fit the 60 s cap. Mutants now run 4 wide
(19 s). Two oldest evidence files pruned for the 60-file cap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWYFhDShgeHByh6yT9L
2026-11-10 14:25:05 +01:00

25 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# ============================================================================
# MCP entrypoint: guarantee a Blender host exists, then serve the MCP protocol.
#
# Registered as the `blender` MCP server's command. The blender-mcp server
# itself only *connects* to Blender's socket -- it cannot start Blender. If
# nothing hosts port 9876 (e.g. after a reboot) the server comes up and every
# tool call fails with a connection error, which reads like a broken MCP
# rather than a missing host. Starting the host here makes that failure
# impossible instead of relying on someone remembering to run a command.
# ============================================================================
set -euo pipefail
readonly HOST_SCRIPT="/home/kuhy/.local/bin/blender-mcp-host"
readonly SERVER_DIR="/home/kuhy/.local/share/mcp-servers/blender-mcp"
readonly UV="/home/kuhy/.local/bin/uv"
# stdout is the MCP JSON-RPC channel -- any stray byte written there corrupts
# the protocol, so all host-startup chatter goes to stderr.
"$HOST_SCRIPT" start >&2
exec "$UV" run --directory "$SERVER_DIR" blender-mcp