Status: alpha. Analysis is the most exercised path. Treat this as a working prototype rather than a production dependency.
Known limitations:
file://URIs do not work yet, so pass plain file paths such as/Users/username/Videos/clip.mp4(#12)- Packaging and conversion are still under active development
- Path translation between Docker and host environments may need manual configuration
- Interfaces may change between releases
Issue reports are welcome and genuinely useful.
This is a local, single-user MCP server that communicates with a desktop MCP client over standard input and output. It does not implement authentication or authorization in this mode. Do not expose it on a network or share one server instance between users.
The server runs the Shaka Packager executable as a subprocess without a shell. Command arguments are
parsed with shlex and passed to asyncio.create_subprocess_exec, so shell metacharacters in arguments
are not interpreted. Shell-safe is not command-safe: Packager flags and file paths supplied by the client
are still untrusted.
run_shaka_packager accepts Packager arguments supplied by the MCP client. The server does not restrict
input or output paths, so Packager may read or write anywhere the account running the server can. Run the
server with least privilege, for example in a container with only the intended video directory mounted,
and review tool calls in the MCP client before approving them.
Files received as file:// resources are saved under their base filename only, in a shaka-mcp-
subdirectory that the server creates at startup and that only the account running the server can open.
The server deletes that subdirectory when it shuts down normally. Setting TEMP_DIR only chooses where
the subdirectory is created. TEMP_DIR itself and anything else in it are left in place.
Shared or remote use is not built. At minimum it would need:
- OAuth 2.1 resource-server support following the MCP authorization specification
- Per-tool scopes, such as read-only analysis and write-capable packaging
- Propagation of the authenticated user's identity
- Allowlisted input and output directories
- An argument allowlist for
run_shaka_packager - An audit log of every tool call
An MCP (Model Context Protocol) server that integrates Shaka Packager with Claude AI applications for video transcoding, packaging, and analysis.
This server works with the Filesystem MCP Server to enable Claude Desktop to access and process video files on your computer, turning Claude into a powerful assistant for media processing tasks.
- Video analysis: examines media files and reports stream information such as codecs and bitrates
- Media packaging: interface support for HLS and DASH, VOD and live; less exercised than video analysis
- Advanced options: interface support for DRM encryption, ad markers, and format conversion; less exercised than video analysis
- Path handling: translates configured Docker and host paths
- Error reporting: returns execution errors and related context
- Command assistance: provides command-format guidance
- Documentation: provides help and examples
- Python 3.10 or higher
- Shaka Packager installed and available in your PATH
- Download from GitHub
- Or build from source following these instructions
- An MCP-compatible client (like Claude Desktop)
The package is not published to PyPI yet, so install from a clone.
git clone https://github.com/coderjun/shaka-packager-mcp-server.git
cd shaka-packager-mcp-server
pip install -e .Or with uv:
git clone https://github.com/coderjun/shaka-packager-mcp-server.git
cd shaka-packager-mcp-server
uv pip install -e .Since Claude Desktop doesn't directly support uploading video files, we'll use a two-server approach:
- A simplified filesystem MCP server to access video files on your computer
- The Shaka Packager MCP server to analyze and process those videos
Use the official MCP filesystem server to allow Claude to access your video files:
-
Install the official filesystem server with Docker:
docker pull mcp/filesystem
-
Alternatively, you can build it from source following the instructions in the Filesystem MCP Server repository
Locate your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
If the file doesn't exist, create it.
Add the following configuration, making sure to use absolute paths:
{
"mcpServers": {
"filesystem": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount", "type=bind,src=/PATH/TO/VIDEOS/DIRECTORY,dst=/projects/video-drop",
"mcp/filesystem",
"/projects"
]
},
"shaka-packager": {
"command": "/ABSOLUTE/PATH/TO/uv",
"args": [
"run",
"--with",
"mcp[cli]>=1.5.0,<2",
"/ABSOLUTE/PATH/TO/shaka_packager_mcp.py"
],
"env": {
"VIDEO_PATH": "/PATH/TO/VIDEOS/DIRECTORY",
"SHAKA_PACKAGER_PATH": "/PATH/TO/PACKAGER"
}
}
}
}Replace:
/PATH/TO/VIDEOS/DIRECTORYwith the path to the directory containing your video files/ABSOLUTE/PATH/TO/uvwith the full path to your uv executable/ABSOLUTE/PATH/TO/shaka_packager_mcp.pywith the full path to the script file/PATH/TO/PACKAGERwith the full path to your Shaka Packager executable
For example:
{
"mcpServers": {
"filesystem": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount", "type=bind,src=/Users/username/Videos,dst=/projects/video-drop",
"mcp/filesystem",
"/projects"
]
},
"shaka-packager": {
"command": "/Users/username/.local/bin/uv",
"args": [
"run",
"--with",
"mcp[cli]>=1.5.0,<2",
"/Users/username/Development/shaka-packager-mcp-server/shaka_packager_mcp.py"
],
"env": {
"VIDEO_PATH": "/Users/username/Videos",
"SHAKA_PACKAGER_PATH": "/Users/username/.shaka/packager"
}
}
}
}After editing the configuration file, restart Claude Desktop to apply the changes.
-
First, browse your video files using the simplified filesystem server:
- Ask Claude to "List the files in my video directory"
- Navigate to the video file you want to analyze or process
-
Once you've found your video file, use its path with the Shaka Packager tools:
- For analysis: "Please analyze this video: /Users/username/Videos/example.mp4"
- For processing: "Please package this video for HLS: /Users/username/Videos/example.mp4"
If you encounter any issues:
- Make sure both servers are properly configured with absolute paths
- Verify that Shaka Packager is installed and accessible
- Ensure the directory specified for the filesystem server exists and contains videos
- Check Claude Desktop logs for errors at:
- macOS:
~/Library/Logs/Claude/mcp*.log - Windows:
%APPDATA%\Claude\logs\mcp*.log
- macOS:
Once both the Filesystem MCP server and the Shaka Packager MCP server are running in Claude Desktop:
-
Access your video files:
Please show me the files in my Videos directory -
Navigate to your video file:
Please show me the files in the Movies subdirectory -
Copy the file:// URI path of the video you want to process
-
Use the Shaka Packager tools with the file path:
Please analyze this video: file:///Users/username/Videos/my_video.mp4or
Please package this video for HLS and DASH streaming: file:///Users/username/Videos/my_video.mp4 -
The server will execute the appropriate Shaka Packager command and provide a detailed summary of the results
You can also use direct file paths if you know the exact location of your video files:
Please analyze this video: /Users/username/Videos/my_video.mp4
The server provides these tools:
- analyze_video: Examines a video file and provides detailed stream information with intelligent error handling
- run_shaka_packager: Executes any Shaka Packager command with custom arguments and proper path handling
- get_shaka_options: Retrieves available command options and version information
- get_shaka_documentation: Provides comprehensive documentation and examples for using Shaka Packager
The server includes these prompt templates:
- MP4 to TS conversion
- VOD packaging in HLS and DASH
- Live streaming packaging
- Content encryption
- Ad insertion preparation
- Video analysis
- Command format reminder
- Error interpretation guidance
The server can be configured using environment variables:
SHAKA_PACKAGER_PATH: Path to the Shaka Packager executable (highly recommended for Claude Desktop)VIDEO_PATH: Path to your local video directory (used for translating paths between Docker and host)DOCKER_PATH: Docker container mount path (default: "/projects/video-drop")TEMP_DIR: Parent directory for uploaded files (default: the system temp directory). The server creates its ownshaka-mcp-subdirectory inside it and deletes only that subdirectory on shutdown.LOG_LEVEL: Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)COMMAND_TIMEOUT: Timeout in seconds for Shaka Packager commands (default: 300)
You can set these in:
- Your Claude Desktop configuration file (preferred for
SHAKA_PACKAGER_PATHandVIDEO_PATH) - Your environment variables
- A
.envfile in the same directory as the script
Example .env file:
SHAKA_PACKAGER_PATH=/usr/local/bin/packager
VIDEO_PATH=/Users/yourusername/Videos
LOG_LEVEL=DEBUG
# Clone the repository
git clone https://github.com/coderjun/shaka-packager-mcp-server.git
cd shaka-packager-mcp-server
# Install development dependencies with pip
pip install -e ".[dev]"
# Or with uv
uv pip install -e ".[dev]"pytestblack .
isort .The main components of the Shaka Packager MCP server are:
shaka_packager_mcp.py: Main server implementation with MCP tools and promptstests/: Test suite for verifying functionality
This server is designed to work with the official MCP filesystem server for accessing video files.
- Path translation between configured Docker and host paths
- Error reporting with execution details
- Command-format guidance
- Documentation and example support
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to use an AI code copilot, the author does.
If you encounter any issues or have questions:
- Check the troubleshooting section in this README
- Review the Shaka Packager documentation
- Use the
get_shaka_documentationtool for interactive help within Claude - Open an issue on GitHub
- Shaka Packager for the powerful video processing capabilities
- Model Context Protocol (MCP) for the communication framework
- Claude for the AI assistant capabilities
- Anthropic for developing Claude and the MCP standard
