testsAndMisc/linux_configuration/scripts/blender-mcp-serve
Krzysztof kuhy Rudnicki 8be1fac8f9
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (mypy, mypy) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (pylint, pylint) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (rest, ) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (shellcheck, shellcheck) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / lib-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
linux_configuration: track ~/.local/bin wrapper scripts in repo, symlink instead of generating
Moves 7 loose ~/.local/bin scripts into linux_configuration/scripts/ and
tracks the flutter/dart git-env wrapper; fix_flutter_git_env.sh and
unreal_mcp_repo.sh now symlink to the tracked files instead of writing
heredocs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yhTkYV6ZeuAbQYvykFGFc

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 18:49:56 +02: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/src/mcp-servers/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