mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-29 15:15:27 -07:00
fix(mcp): bundle stdio shim sidecar
This commit is contained in:
@@ -29,11 +29,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd backend
|
cd backend
|
||||||
python build_binary.py
|
python build_binary.py
|
||||||
|
python build_binary.py --shim
|
||||||
|
|
||||||
PLATFORM=$(rustc --print host-tuple)
|
PLATFORM=$(rustc --print host-tuple)
|
||||||
mkdir -p ../tauri/src-tauri/binaries
|
mkdir -p ../tauri/src-tauri/binaries
|
||||||
cp dist/voicebox-server.exe ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}.exe
|
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-server-${PLATFORM}.exe"
|
||||||
|
echo "Built voicebox-mcp-${PLATFORM}.exe"
|
||||||
|
|
||||||
- name: Setup Bun
|
- name: Setup Bun
|
||||||
uses: oven-sh/setup-bun@v2
|
uses: oven-sh/setup-bun@v2
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd backend
|
cd backend
|
||||||
python build_binary.py
|
python build_binary.py
|
||||||
|
python build_binary.py --shim
|
||||||
|
|
||||||
# Get platform tuple
|
# Get platform tuple
|
||||||
PLATFORM=$(rustc --print host-tuple)
|
PLATFORM=$(rustc --print host-tuple)
|
||||||
@@ -123,7 +124,9 @@ jobs:
|
|||||||
|
|
||||||
# Copy with platform suffix
|
# Copy with platform suffix
|
||||||
cp dist/voicebox-server.exe ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}.exe
|
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-server-${PLATFORM}.exe"
|
||||||
|
echo "Built voicebox-mcp-${PLATFORM}.exe"
|
||||||
|
|
||||||
- name: Setup Bun
|
- name: Setup Bun
|
||||||
uses: oven-sh/setup-bun@v2
|
uses: oven-sh/setup-bun@v2
|
||||||
|
|||||||
@@ -16,6 +16,21 @@ import { useServerStore } from '@/stores/serverStore';
|
|||||||
import { formatDate } from '@/lib/utils/format';
|
import { formatDate } from '@/lib/utils/format';
|
||||||
import { SettingRow, SettingSection } from './SettingRow';
|
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
|
* Settings → MCP — configure per-agent voice binding and show copy-paste
|
||||||
* install snippets for major MCP clients. Backend runs at /mcp on the
|
* 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 defaultProfileId = captureSettings?.default_playback_voice_id ?? '';
|
||||||
const mcpUrl = `${serverUrl}/mcp`;
|
const mcpUrl = `${serverUrl}/mcp`;
|
||||||
|
const stdioShimCommand = getStdioShimCommand();
|
||||||
|
|
||||||
const [newClientId, setNewClientId] = useState('');
|
const [newClientId, setNewClientId] = useState('');
|
||||||
const [newLabel, setNewLabel] = useState('');
|
const [newLabel, setNewLabel] = useState('');
|
||||||
@@ -88,8 +104,7 @@ export function MCPPage() {
|
|||||||
{
|
{
|
||||||
mcpServers: {
|
mcpServers: {
|
||||||
voicebox: {
|
voicebox: {
|
||||||
command:
|
command: stdioShimCommand,
|
||||||
'/Applications/Voicebox.app/Contents/MacOS/voicebox-mcp',
|
|
||||||
env: { VOICEBOX_CLIENT_ID: 'claude-code' },
|
env: { VOICEBOX_CLIENT_ID: 'claude-code' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+22
-16
@@ -6,7 +6,7 @@ set -e
|
|||||||
# Determine platform
|
# Determine platform
|
||||||
PLATFORM=$(rustc --print host-tuple 2>/dev/null || echo "unknown")
|
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
|
# Build Python binary
|
||||||
# Resolve PATH to absolute paths before changing directory
|
# 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
|
python -m pip install pyinstaller
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build binary
|
|
||||||
python build_binary.py
|
|
||||||
|
|
||||||
# Create binaries directory if it doesn't exist
|
# Create binaries directory if it doesn't exist
|
||||||
mkdir -p ../tauri/src-tauri/binaries
|
mkdir -p ../tauri/src-tauri/binaries
|
||||||
|
|
||||||
# Copy binary with platform suffix
|
copy_sidecar() {
|
||||||
if [ -f dist/voicebox-server ]; then
|
local name="$1"
|
||||||
cp dist/voicebox-server ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}
|
|
||||||
chmod +x ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}
|
if [ -f "dist/${name}" ]; then
|
||||||
echo "Built voicebox-server-${PLATFORM}"
|
cp "dist/${name}" "../tauri/src-tauri/binaries/${name}-${PLATFORM}"
|
||||||
elif [ -f dist/voicebox-server.exe ]; then
|
chmod +x "../tauri/src-tauri/binaries/${name}-${PLATFORM}"
|
||||||
cp dist/voicebox-server.exe ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}.exe
|
echo "Built ${name}-${PLATFORM}"
|
||||||
echo "Built voicebox-server-${PLATFORM}.exe"
|
elif [ -f "dist/${name}.exe" ]; then
|
||||||
else
|
cp "dist/${name}.exe" "../tauri/src-tauri/binaries/${name}-${PLATFORM}.exe"
|
||||||
echo "Error: Binary not found in dist/"
|
echo "Built ${name}-${PLATFORM}.exe"
|
||||||
exit 1
|
else
|
||||||
fi
|
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!"
|
echo "Build complete!"
|
||||||
|
|||||||
Reference in New Issue
Block a user