Sponsored by Deepsite.site

VLC MCP Server

Created By
piebro8 months ago
An MCP (Model Context Protocol) Server to play and control movies using VLC.
Content

VLC MCP Server

An MCP (Model Context Protocol) Server to play and control movies using the VLC media player. Use any MCP client to control play videos remotely (e.g. awesome-mcp-clients)

I use my signal-mcp-client running on an old laptop connected to my beamer. This way I can play a movie by sending a signal message. An example of how to use it is shown in the screenshot below.

Usage

This installation is for Linux systems running Ubuntu or a similar Debian-based system like Raspberry Pi OS. With a few modifications it should also work on other systems. Feel free to create a pull request if you get it working on another system.

  1. Install VLC, mediainfo and uv.

    sudo apt-get install vlc mediainfo
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Start the VLC http server:

    export DISPLAY=:0 # needed when running it remotely on a server
    vlc --extraintf=http --http-host=localhost --http-port=8081 --http-password=your_password
    
  3. Add the server to the MCP config file of your client (like signal-mcp-client or awesome-mcp-clients)

    {
        "name": "vlc-mcp-server",
        "command": "uvx",
        "args": [
            "vlc-mcp-server"
        ],
        "env": {
            "ROOT_VIDEO_FOLDER": "path/to/your/video/folder",
            "VLC_HTTP_HOST": "localhost",
            "VLC_HTTP_PORT": "8081",
            "VLC_HTTP_PASSWORD": "your_password"
        }
    }
    

    or clone the repo and use uv with a directory:

    {
        "name": "vlc-mcp-server",
        "command": "uv",
        "args": [
            "--directory",
            "path/to/root/dir/",
            "run",
            "vlc_mcp_player/main.py"
        ],
        "env": {
            "the same as above"
        }
    }
    

Contributing

Contributions to this project are welcome. Feel free to report bugs, suggest ideas, or create merge requests.

Development

Testing

Clone the repo and use mcp-client-for-testing to test the tools of the server.

uvx mcp-client-for-testing \
    --config '
    [
        "the json config from above"
    ]
    ' \
    --client_log_level "INFO" \
	--server_log_level "INFO" \
    --tool_call '{"name": "show_video", "arguments": {"video_title": "David Lynch - Dune", "subtitle_language_code": "en"}}'

Formatting and Linting

The code is formatted and linted with ruff:

uv run ruff format
uv run ruff check --fix

Building with uv

Build the package using uv:

uv build

Releasing a New Version

To release a new version of the package to PyPI, create and push a new Git tag:

  1. Checkout the main branch and get the current version:

    git checkout main
    git pull origin main
    git describe --tags
    
  2. Create and push a new Git tag:

    git tag v0.2.0
    git push origin v0.2.0
    

The GitHub Actions workflow will automatically build and publish the package to PyPI when a new tag is pushed. The python package version number will be derived directly from the Git tag.

Running as a Systemd Service

To ensure the VLC HTTP interface runs automatically on boot and restarts if it fails (on Linux systems), you can set it up as a systemd user service. User services run under your specific user account.

This setup assumes that you have completed the setup steps.

  1. Enable User Lingering to keep your user session active after logging out.

    sudo loginctl enable-linger $USER
    
  2. Create Systemd Service Directory

    mkdir -p /home/$USER/.config/systemd/user/
    
  3. Create Service File for VLC HTTP Server. Make sure vlc is installed using apt and not using snap or change the path to the vlc binary.

    cat << EOF > "/home/$USER/.config/systemd/user/vlc-http.service"
    [Unit]
    Description=VLC Media Player with HTTP Interface
    After=network.target sound.target
    
    [Service]
    Restart=on-failure
    RestartSec=30
    SyslogIdentifier=vlc-http
    Environment="DISPLAY=:0"
    
    ExecStart=/usr/bin/vlc --extraintf=http --http-host=localhost --http-port=8081 --http-password=your_password
    
    ExecStop=/usr/bin/pkill -f '/usr/bin/vlc --extraintf=http --http-host=localhost --http-port=8080'
    
    [Install]
    WantedBy=default.target
    EOF
    
  4. Enable and Start the Services

    systemctl --user daemon-reload
    systemctl --user enable vlc-http.service
    systemctl --user start vlc-http.service
    
  5. Check Service Status and Logs

    systemctl --user status vlc-http.service
    journalctl --user -u vlc-http.service -f
    

License

This project is licensed under the MIT License. See the LICENSE file for details.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
WindsurfThe new purpose-built IDE to harness magic
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Tavily Mcp
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
ChatWiseThe second fastest AI chatbot™
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Playwright McpPlaywright MCP server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
CursorThe AI Code Editor
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors