fix(mcp): bundle stdio shim sidecar

This commit is contained in:
Jamie Pine
2026-04-25 10:21:52 -07:00
parent c7f50d5668
commit 2e5b8d2d67
4 changed files with 45 additions and 18 deletions
+3
View File
@@ -29,11 +29,14 @@ jobs:
run: |
cd backend
python build_binary.py
python build_binary.py --shim
PLATFORM=$(rustc --print host-tuple)
mkdir -p ../tauri/src-tauri/binaries
cp dist/voicebox-server.exe ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}.exe
cp dist/voicebox-mcp.exe ../tauri/src-tauri/binaries/voicebox-mcp-${PLATFORM}.exe
echo "Built voicebox-server-${PLATFORM}.exe"
echo "Built voicebox-mcp-${PLATFORM}.exe"
- name: Setup Bun
uses: oven-sh/setup-bun@v2
+3
View File
@@ -114,6 +114,7 @@ jobs:
run: |
cd backend
python build_binary.py
python build_binary.py --shim
# Get platform tuple
PLATFORM=$(rustc --print host-tuple)
@@ -123,7 +124,9 @@ jobs:
# Copy with platform suffix
cp dist/voicebox-server.exe ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}.exe
cp dist/voicebox-mcp.exe ../tauri/src-tauri/binaries/voicebox-mcp-${PLATFORM}.exe
echo "Built voicebox-server-${PLATFORM}.exe"
echo "Built voicebox-mcp-${PLATFORM}.exe"
- name: Setup Bun
uses: oven-sh/setup-bun@v2
+17 -2
View File
@@ -16,6 +16,21 @@ import { useServerStore } from '@/stores/serverStore';
import { formatDate } from '@/lib/utils/format';
import { SettingRow, SettingSection } from './SettingRow';
function getStdioShimCommand(): string {
if (typeof navigator === 'undefined') {
return '/Applications/Voicebox.app/Contents/MacOS/voicebox-mcp';
}
const platform = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
if (platform.includes('win')) {
return 'C:\\Program Files\\Voicebox\\voicebox-mcp.exe';
}
if (platform.includes('linux')) {
return '/opt/voicebox/voicebox-mcp';
}
return '/Applications/Voicebox.app/Contents/MacOS/voicebox-mcp';
}
/**
* Settings → MCP — configure per-agent voice binding and show copy-paste
* install snippets for major MCP clients. Backend runs at /mcp on the
@@ -30,6 +45,7 @@ export function MCPPage() {
const defaultProfileId = captureSettings?.default_playback_voice_id ?? '';
const mcpUrl = `${serverUrl}/mcp`;
const stdioShimCommand = getStdioShimCommand();
const [newClientId, setNewClientId] = useState('');
const [newLabel, setNewLabel] = useState('');
@@ -88,8 +104,7 @@ export function MCPPage() {
{
mcpServers: {
voicebox: {
command:
'/Applications/Voicebox.app/Contents/MacOS/voicebox-mcp',
command: stdioShimCommand,
env: { VOICEBOX_CLIENT_ID: 'claude-code' },
},
},
+22 -16
View File
@@ -6,7 +6,7 @@ set -e
# Determine platform
PLATFORM=$(rustc --print host-tuple 2>/dev/null || echo "unknown")
echo "Building voicebox-server for platform: $PLATFORM"
echo "Building Voicebox sidecars for platform: $PLATFORM"
# Build Python binary
# Resolve PATH to absolute paths before changing directory
@@ -19,23 +19,29 @@ if ! python -c "import PyInstaller" 2>/dev/null; then
python -m pip install pyinstaller
fi
# Build binary
python build_binary.py
# Create binaries directory if it doesn't exist
mkdir -p ../tauri/src-tauri/binaries
# Copy binary with platform suffix
if [ -f dist/voicebox-server ]; then
cp dist/voicebox-server ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}
chmod +x ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}
echo "Built voicebox-server-${PLATFORM}"
elif [ -f dist/voicebox-server.exe ]; then
cp dist/voicebox-server.exe ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}.exe
echo "Built voicebox-server-${PLATFORM}.exe"
else
echo "Error: Binary not found in dist/"
exit 1
fi
copy_sidecar() {
local name="$1"
if [ -f "dist/${name}" ]; then
cp "dist/${name}" "../tauri/src-tauri/binaries/${name}-${PLATFORM}"
chmod +x "../tauri/src-tauri/binaries/${name}-${PLATFORM}"
echo "Built ${name}-${PLATFORM}"
elif [ -f "dist/${name}.exe" ]; then
cp "dist/${name}.exe" "../tauri/src-tauri/binaries/${name}-${PLATFORM}.exe"
echo "Built ${name}-${PLATFORM}.exe"
else
echo "Error: ${name} binary not found in dist/"
exit 1
fi
}
python build_binary.py
copy_sidecar voicebox-server
python build_binary.py --shim
copy_sidecar voicebox-mcp
echo "Build complete!"