@sylphx/video-reader-mcp 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/video-reader-mcp +105 -34
- package/package.json +10 -4
- package/bin/native/video-reader-mcp-server +0 -0
package/bin/video-reader-mcp
CHANGED
|
@@ -1,48 +1,119 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# Cue MCP launcher — Rust rmcp only (fail-closed).
|
|
3
|
+
# Resolves native via optionalDependencies, staged bin/native, or cargo target.
|
|
3
4
|
set -euo pipefail
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
PACKAGE_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
7
|
+
|
|
8
|
+
host_platform_key() {
|
|
9
|
+
local os arch
|
|
10
|
+
os="$(uname -s 2>/dev/null || echo unknown)"
|
|
11
|
+
arch="$(uname -m 2>/dev/null || echo unknown)"
|
|
12
|
+
case "$os" in
|
|
13
|
+
Darwin) os="darwin" ;;
|
|
14
|
+
Linux) os="linux" ;;
|
|
15
|
+
*) os="$(printf '%s' "$os" | tr '[:upper:]' '[:lower:]')" ;;
|
|
16
|
+
esac
|
|
17
|
+
case "$arch" in
|
|
18
|
+
x86_64|amd64) arch="x64" ;;
|
|
19
|
+
aarch64|arm64) arch="arm64" ;;
|
|
20
|
+
esac
|
|
21
|
+
printf '%s-%s\n' "$os" "$arch"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
platform_package_name() {
|
|
25
|
+
case "$(host_platform_key)" in
|
|
26
|
+
darwin-arm64) printf '%s\n' '@sylphx/video-reader-mcp-darwin-arm64' ;;
|
|
27
|
+
darwin-x64) printf '%s\n' '@sylphx/video-reader-mcp-darwin-x64' ;;
|
|
28
|
+
linux-x64) printf '%s\n' '@sylphx/video-reader-mcp-linux-x64-gnu' ;;
|
|
29
|
+
linux-arm64) printf '%s\n' '@sylphx/video-reader-mcp-linux-arm64-gnu' ;;
|
|
30
|
+
*) return 1 ;;
|
|
31
|
+
esac
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
is_runnable_native() {
|
|
35
|
+
local candidate="$1"
|
|
36
|
+
[[ -n "$candidate" && -f "$candidate" && -x "$candidate" ]] || return 1
|
|
37
|
+
return 0
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
resolve_from_optional_dep() {
|
|
41
|
+
local pkg_name candidate
|
|
42
|
+
pkg_name="$(platform_package_name 2>/dev/null || true)"
|
|
43
|
+
[[ -n "$pkg_name" ]] || return 1
|
|
44
|
+
local search_roots=(
|
|
45
|
+
"$PACKAGE_ROOT/node_modules"
|
|
46
|
+
"$PACKAGE_ROOT/../node_modules"
|
|
47
|
+
"$PACKAGE_ROOT/../../node_modules"
|
|
48
|
+
)
|
|
49
|
+
for root in "${search_roots[@]}"; do
|
|
50
|
+
candidate="$root/$pkg_name/video-reader-mcp-server"
|
|
51
|
+
if is_runnable_native "$candidate"; then
|
|
52
|
+
printf '%s\n' "$candidate"
|
|
53
|
+
return 0
|
|
54
|
+
fi
|
|
55
|
+
done
|
|
56
|
+
if command -v node >/dev/null 2>&1; then
|
|
57
|
+
candidate="$(
|
|
58
|
+
node -e "
|
|
59
|
+
try {
|
|
60
|
+
const p = require('node:path');
|
|
61
|
+
const { createRequire } = require('node:module');
|
|
62
|
+
const r = createRequire(p.join(process.argv[1], 'package.json'));
|
|
63
|
+
const pkg = r.resolve(process.argv[2] + '/package.json');
|
|
64
|
+
process.stdout.write(p.join(p.dirname(pkg), 'video-reader-mcp-server'));
|
|
65
|
+
} catch { process.exit(1); }
|
|
66
|
+
" "$PACKAGE_ROOT" "$pkg_name" 2>/dev/null || true
|
|
67
|
+
)"
|
|
68
|
+
if is_runnable_native "${candidate:-}"; then
|
|
69
|
+
printf '%s\n' "$candidate"
|
|
70
|
+
return 0
|
|
71
|
+
fi
|
|
72
|
+
fi
|
|
73
|
+
return 1
|
|
74
|
+
}
|
|
6
75
|
|
|
7
76
|
resolve_rust_bin() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
77
|
+
if [[ -n "${VIDEO_READER_MCP_RUST_BIN:-}" && -x "${VIDEO_READER_MCP_RUST_BIN}" ]]; then
|
|
78
|
+
printf '%s\n' "${VIDEO_READER_MCP_RUST_BIN}"
|
|
79
|
+
return 0
|
|
80
|
+
fi
|
|
81
|
+
if bin="$(resolve_from_optional_dep)"; then
|
|
82
|
+
printf '%s\n' "$bin"
|
|
83
|
+
return 0
|
|
84
|
+
fi
|
|
85
|
+
for candidate in \
|
|
86
|
+
"$PACKAGE_ROOT/bin/native/video-reader-mcp-server" \
|
|
87
|
+
"$PACKAGE_ROOT/target/release/video-reader-mcp-server" \
|
|
88
|
+
"$PACKAGE_ROOT/target/debug/video-reader-mcp-server"; do
|
|
89
|
+
if is_runnable_native "$candidate"; then
|
|
90
|
+
printf '%s\n' "$candidate"
|
|
91
|
+
return 0
|
|
92
|
+
fi
|
|
93
|
+
done
|
|
94
|
+
return 1
|
|
24
95
|
}
|
|
25
96
|
|
|
26
97
|
resolve_transport() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
98
|
+
if [[ -n "${VIDEO_READER_MCP_TRANSPORT:-}" ]]; then
|
|
99
|
+
printf '%s\n' "${VIDEO_READER_MCP_TRANSPORT}"
|
|
100
|
+
return 0
|
|
101
|
+
fi
|
|
102
|
+
if [[ -n "${MCP_TRANSPORT:-}" ]]; then
|
|
103
|
+
printf '%s\n' "${MCP_TRANSPORT}"
|
|
104
|
+
return 0
|
|
105
|
+
fi
|
|
106
|
+
printf '%s\n' "stdio"
|
|
36
107
|
}
|
|
37
108
|
|
|
38
109
|
if bin="$(resolve_rust_bin)"; then
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
110
|
+
transport="$(resolve_transport)"
|
|
111
|
+
if [[ "$transport" == "http" ]]; then
|
|
112
|
+
export MCP_TRANSPORT=http
|
|
113
|
+
export VIDEO_READER_MCP_TRANSPORT=http
|
|
114
|
+
fi
|
|
115
|
+
exec "$bin" "$@"
|
|
45
116
|
fi
|
|
46
117
|
|
|
47
|
-
echo "[
|
|
118
|
+
echo "[cue] Rust MCP server not found. Install matching optional native package or run: bun run build:rust" >&2
|
|
48
119
|
exit 1
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylphx/video-reader-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"mcpName": "io.github.SylphxAI/video-reader-mcp",
|
|
5
|
-
"description": "Cue
|
|
5
|
+
"description": "Cue — Evidence-first video reading for AI agents — ffprobe, subtitles, scenes, transcripts, and timelines without frame-by-frame LLM vision.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"cue": "./bin/video-reader-mcp"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
-
"bin/",
|
|
16
|
+
"bin/video-reader-mcp",
|
|
17
17
|
"dist/",
|
|
18
18
|
"README.md",
|
|
19
19
|
"LICENSE",
|
|
@@ -76,5 +76,11 @@
|
|
|
76
76
|
"typescript": "^7.0.2"
|
|
77
77
|
},
|
|
78
78
|
"packageManager": "bun@1.3.12",
|
|
79
|
-
"private": false
|
|
79
|
+
"private": false,
|
|
80
|
+
"optionalDependencies": {
|
|
81
|
+
"@sylphx/video-reader-mcp-darwin-arm64": "0.1.5",
|
|
82
|
+
"@sylphx/video-reader-mcp-darwin-x64": "0.1.5",
|
|
83
|
+
"@sylphx/video-reader-mcp-linux-x64-gnu": "0.1.5",
|
|
84
|
+
"@sylphx/video-reader-mcp-linux-arm64-gnu": "0.1.5"
|
|
85
|
+
}
|
|
80
86
|
}
|
|
Binary file
|